diff --git a/.travis.yml b/.travis.yml index 37ced9a85..6263bd6f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/publish-release.sh b/.travis/publish-release.sh index 8502aaa0c..bde8c363e 100755 --- a/.travis/publish-release.sh +++ b/.travis/publish-release.sh @@ -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." diff --git a/buildtools/Dockerfile b/buildtools/Dockerfile new file mode 100644 index 000000000..b3c4db359 --- /dev/null +++ b/buildtools/Dockerfile @@ -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 + +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