Skip to content

Commit

Permalink
Merge pull request #159 from ndw/travis-fixes
Browse files Browse the repository at this point in the history
Travis fixes
  • Loading branch information
ndw authored Oct 3, 2019
2 parents 8c08a8a + 33e9d9f commit e37be07
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 44 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ install:
- sudo apt-get install xsltproc
- sudo apt-get install libxml-xpath-perl
- sudo apt-get install libxml2-utils
- sudo apt-get install libsaxon-java libxml-commons-resolver1.1-java libsaxon-java
libxerces2-java
- sudo apt-get install libsaxon-java libxml-commons-resolver1.1-java libsaxon-java libxerces2-java
- sudo apt-get install trang
- sudo apt-get install imagemagick
- sudo apt-get install dblatex
Expand Down
104 changes: 62 additions & 42 deletions .travis/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,66 @@ fi

# Remember the SHA of the current build.
SHA=$(git rev-parse --verify HEAD)
DIST=dist

# Clone the minimum of the CDN repo needed.
CDN_REPO="https://$GH_TOKEN@github.com/docbook/cdn.git"

git clone $CDN_REPO cdn --depth=1 -q

# Clean out existing content...
rm -rf cdn/release/xsl/$VERSION
rm -rf cdn/release/xsl-nons/$VERSION
rm -f cdn/release/xsl/index.html
rm -f cdn/release/xsl-nons/index.html

# ...and copy the new one.
mkdir -p cdn/release/xsl
mkdir -p cdn/release/xsl-nons
cp -a $DIST/docbook-xsl-$VERSION cdn/release/xsl/$VERSION
cp -a $DIST/docbook-xsl-nons-$VERSION cdn/release/xsl-nons/$VERSION

# I'm sure there's a more efficient way to do this, but...
for dir in "cdn/release/xsl/$VERSION" "cdn/release/xsl-nons/$VERSION"; do
for file in ".urilist" ".CatalogManager.properties.example"; do
find $dir -name $file -exec rm {} \;
done
done

# We could normally make "current" symbolic links to "snapshot"
# but github's policy doesn't allow to publish symbolic links in pages.
if [ "$VERSION" != "snapshot" ]; then
rm -rf cdn/release/xsl/current
rm -rf cdn/release/xsl-nons/current
cp -a cdn/release/xsl/$VERSION cdn/release/xsl/current
cp -a cdn/release/xsl-nons/$VERSION cdn/release/xsl-nons/current
fi

# copy documentation
rm -rf docbook-xsl-$VERSION
unzip -q $DIST/docbook-xsl-doc-$VERSION.zip
cp -a docbook-xsl-$VERSION/doc cdn/release/xsl/$VERSION/

# If there are no changes, bail out.
cd cdn
if [ `git status --porcelain | wc -l` = 0 ]; then
echo "No changes to the output on this push; exiting."
exit 0
else
cd ..
fi

$here/generate_index.py cdn/release/xsl
$here/generate_index.py cdn/release/xsl-nons

# Now prepare to commit and push to the CDN
cd cdn
git status

git config user.name "Travis CI"
git config user.email "travis-ci"

git add .
git commit -m "Deploy XSL Stylesheets to GitHub Pages: ${SHA}"
git push -q origin HEAD

# Turning off temporarily

# # Clone the minimum of the CDN repo needed.
# CDN_REPO="https://$GH_TOKEN@github.com/docbook/cdn.git"
# git clone $CDN_REPO cdn --depth=1 -q
# # Clean out existing content...
# rm -rf cdn/release/xsl/$VERSION
# rm -rf cdn/release/xsl-nons/$VERSION
# # ...and copy the new one.
# mkdir -p cdn/release/xsl
# mkdir -p cdn/release/xsl-nons
# rm -f cdn/release/xsl/index.html
# rm -f cdn/release/xsl-nons/index.html
# cp -a dist/docbook-xsl-$VERSION cdn/release/xsl/$VERSION
# cp -a dist/docbook-xsl-nons-$VERSION cdn/release/xsl-nons/$VERSION
# # We could normally make "current" symbolic links to "snapshot"
# # but github's policy doesn't allow to publish symbolic links in pages.
# rm -rf cdn/release/xsl/current
# rm -rf cdn/release/xsl-nons/current
# cp -a cdn/release/xsl/$VERSION cdn/release/xsl/current
# cp -a cdn/release/xsl-nons/$VERSION cdn/release/xsl-nons/current
#
# # If there are no changes, bail out.
# # (Note that this doesn't detect additions.)
# #if (cd cdn && git diff --quiet); then
# # echo "No changes to the output on this push; exiting."
# # exit 0
# #fi
#
# $here/generate_index.py cdn/release/xsl
# $here/generate_index.py cdn/release/xsl-nons
#
# # Now prepare to commit and push to the CDN
# cd cdn
# git config user.name "Travis CI"
# git config user.email "travis-ci"
#
# git add .
# git commit -m "Deploy XSL Stylesheets to GitHub Pages: ${SHA}"
# git push -q origin HEAD

echo "Ran publish-release.sh but it did nothing."
43 changes: 43 additions & 0 deletions buildtools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This Dockerfile allowed me to build the 1.0 stylesheets.
# N.B.
# - You may have to copy this file to the root directory in order for the ADD command to work.
# - I built it like this:
# docker build -t xslt10-builder .
# - You have to mount the 1.0 stylesheet directory when you run it.
# - I ran it like this:
# docker run -v /projects/docbook/10xslt:/usr/local/xslt10-stylesheets -it xslt10-builder

FROM ubuntu
MAINTAINER Norman Walsh <ndw@nwalsh.com>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN ln -fs /usr/share/zoneinfo/America/Chicago /etc/localtime
RUN apt-get --yes install tzdata
RUN dpkg-reconfigure --frontend noninteractive tzdata

RUN apt-get --yes install apt-file apt-utils
RUN apt-file update
RUN apt-get --yes dist-upgrade
RUN apt-get --yes install xsltproc libxml-xpath-perl libxml2-utils libsaxon-java libxml-commons-resolver1.1-java \
libxerces2-java trang imagemagick dblatex
RUN apt-get --yes install make w3m git

RUN adduser --gecos "Docker User,,," --uid 501 --disabled-password docker-user

ADD .travis/xmlc /home/docker-user/.xmlc

ENV CLASSPATH=/usr/share/java/xalan2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xml-resolver.jar:/usr/local/xslt10-stylesheets/.travis

VOLUME ["/usr/local/xslt10-stylesheets"]
WORKDIR /usr/local/xslt10-stylesheets

#script:
#- make
#- make check
#- make dist
#- export VERSION=$(make version)

USER docker-user

0 comments on commit e37be07

Please sign in to comment.