Permalink
Browse files

简化travis

  • Loading branch information...
1 parent dfa6f46 commit 87e0f30b6019f828f19c76b92bfe6d29d0a28d17 @seisman seisman committed May 31, 2016
Showing with 23 additions and 73 deletions.
  1. +0 −37 .texlive-minmal-installer.sh
  2. +12 −28 .travis-deploy.sh
  3. +11 −8 .travis.yml
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# Install minimal TeXLive 2015 for GMT_docs
-#
-#REMOTE=http://mirrors.ustc.edu.cn/CTAN/systems/texlive/tlnet
-REMOTE=http://ctan.sharelatex.com/tex-archive/systems/texlive/tlnet/
-TEXBIN=/usr/local/texlive/2015/bin/x86_64-linux
-PACKAGES="titlesec fandol ctex threeparttable framed wrapfig upquote capt-of needspace multirow eqparbox environ trimspaces zhnumber zapfding latexmk"
-
-# install TeXLive
-mkdir -p /tmp/install-texlive
-cd /tmp/install-texlive/
-curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xz -C ./ --strip-components=1
-
-cat << EOF > texlive.profile
-selected_scheme scheme-minimal
-TEXMFHOME ~/.texmf
-TEXMFCONFIG ~/.texlive/texmf-config
-TEXMFVAR ~/.texlive/texmf-var
-collection-basic 1
-collection-genericrecommended 1
-collection-latex 1
-collection-latexextra 0
-collection-latexrecommended 1
-collection-xetex 1
-collection-langchinese 0
-option_autobackup 0
-option_doc 0
-option_src 0
-EOF
-
-sudo ./install-tl -profile texlive.profile -repository $REMOTE
-sudo $TEXBIN/tlmgr update --self --all --repository $REMOTE
-sudo $TEXBIN/tlmgr install $PACKAGES --repository $REMOTE
-
-cd -
-echo export PATH=$TEXBIN:'$PATH' > srcfile
View
@@ -1,35 +1,19 @@
#!/bin/bash
-#
-# Deploy master branch only
-#
-# TRAVIS_BRANCH:
-# - triggered by commit => the name of the branch currently being built
-# - triggered by a PR => the name of the branch targeted by the pull request
-# TRAVIS_PULL_REQUEST:
-# - is a pull request => pull request number
-# - not a pull request => false
-name="Dongdong Tian"
-mail="seisman.info@gmail.com"
+
docdir=doc-dev
docname=GMT_modules-dev
pdfname=GMT_modules.pdf
-if [ ${TRAVIS_BRANCH} = "master" -a ${TRAVIS_PULL_REQUEST} = 'false' ]; then
- echo "In master branch, deploying now..."
- git config user.name "${name}"
- git config user.email "${mail}"
-
- # Deploy Github Pages
- ghp-import -b gh-pages -n build/html -m 'Update by travis automatically'
- git push "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages --force --quiet
+git config user.name "Dongdong Tian"
+git config user.email "seisman.info@gmail.com"
- # Deploy offline HTML and PDF files
- mkdir build/${docdir} && cd build
- mv html ${docname} && zip -r ${docdir}/${docname}.zip ${docname}
+# Deploy Github Pages
+ghp-import -b gh-pages -n build/html -m 'Update by travis automatically'
+git push "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages --force
- cp latex/${pdfname} ${docdir}/${docname}.pdf
- ghp-import -b ${docdir} ${docdir} -m 'Update by travis automatically'
- git push "https://${GH_TOKEN}@${GH_REF}" ${docdir}:${docdir} --force --quiet
-else
- echo "Not in master branch"
-fi
+# Deploy offline HTML and PDF files
+mkdir build/${docdir} && cd build
+mv html ${docname} && zip -r ${docdir}/${docname}.zip ${docname}
+cp latex/${pdfname} ${docdir}/${docname}.pdf
+ghp-import -b ${docdir} ${docdir} -m 'Update by travis automatically'
+git push "https://${GH_TOKEN}@${GH_REF}" ${docdir}:${docdir} --force --quiet
View
@@ -1,18 +1,21 @@
language: python
-python:
- - "3.5"
-
sudo: required
dist: trusty
-branches:
- only:
- - master
+branch:
+ only:
+ - master
install:
+ # python
- pip install -r requirements.txt
- - bash ./.texlive-minmal-installer.sh
- - source ./srcfile
+ # TeXLive
+ - curl -sSL https://raw.githubusercontent.com/ustctug/mini-texlive/master/install-tl.sh -o install-tl.sh
+ - sed -i 's!http://mirrors.ustc.edu.cn/CTAN!http://ctan.sharelatex.com/tex-archive!' install-tl.sh
+ - sudo bash install-tl.sh
+ - source ~/.bash_profile
+ - export TLMGR=`which tlmgr`
+ - sudo $TLMGR update --self --all -repository http://ctan.sharelatex.com/tex-archive/systems/texlive/tlnet/
script:
- make html

0 comments on commit 87e0f30

Please sign in to comment.