support travis
This commit is contained in:
		
							
								
								
									
										37
									
								
								.texlive-minmal-installer.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										37
									
								
								.texlive-minmal-installer.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  | #!/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 | ||||||
							
								
								
									
										19
									
								
								.travis-deploy.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								.travis-deploy.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | #!/bin/bash | ||||||
|  | name="Dongdong Tian" | ||||||
|  | mail="seisman.info@gmail.com" | ||||||
|  | docdir=pdf | ||||||
|  | pdfname=Makefile.pdf | ||||||
|  |  | ||||||
|  | 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 | ||||||
|  |  | ||||||
|  | # Deploy offline HTML and PDF files | ||||||
|  | mkdir build/${docdir} && cd build | ||||||
|  | cp latex/${pdfname} ${docdir}/ | ||||||
|  | ghp-import -b ${docdir} ${docdir} -m 'Update by travis automatically' | ||||||
|  | git push "https://${GH_TOKEN}@${GH_REF}" ${docdir}:${docdir} --force | ||||||
							
								
								
									
										22
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | language: python | ||||||
|  | python: | ||||||
|  |   - "3.5" | ||||||
|  |  | ||||||
|  | sudo: required | ||||||
|  | dist: trusty | ||||||
|  |  | ||||||
|  | branches: | ||||||
|  |   only: | ||||||
|  |     - dev | ||||||
|  |  | ||||||
|  | install: | ||||||
|  |     - pip install -r requirements.txt | ||||||
|  |     - bash ./.texlive-minmal-installer.sh | ||||||
|  |     - source ./srcfile | ||||||
|  |  | ||||||
|  | script: | ||||||
|  |     - make html | ||||||
|  |     - make xelatexpdf | ||||||
|  |  | ||||||
|  | after_success: | ||||||
|  |     bash ./.travis-deploy.sh | ||||||
							
								
								
									
										5
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
									
									
									
									
								
							| @@ -119,9 +119,8 @@ latexpdf: | |||||||
|  |  | ||||||
| xelatexpdf: | xelatexpdf: | ||||||
| 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||||||
| 	@echo "Running LaTeX files through xelatex..." | 	@echo "Runnning LaTeX files through xelatex..." | ||||||
| 	sed -i s/pdflatex/xelatex/ $(BUILDDIR)/latex/Makefile | 	cd $(BUILDDIR)/latex; latexmk -xelatex -shell-escape -interaction=nonstopmode | ||||||
| 	$(MAKE) -C $(BUILDDIR)/latex all-pdf |  | ||||||
| 	@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." | 	@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." | ||||||
|  |  | ||||||
| latexpdfja: | latexpdfja: | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | sphinx | ||||||
|  | sphinx_rtd_theme | ||||||
|  | pygments | ||||||
|  | ghp-import | ||||||
		Reference in New Issue
	
	Block a user