forked from billryan/algorithm-exercise
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
79 lines (73 loc) · 2.67 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
language: node_js
node_js:
- "stable"
before_install:
# update first
- sudo apt-get update -qq
# install Chinese fonts
- sudo apt-get install -y fonts-arphic-gbsn00lp
# Install Gitbook
- npm install gitbook-cli -g
- npm install svgexport -g
# Clone the repository
- cd ~
- git clone --depth=10 --branch=master git://github.com/billryan/algorithm-exercise.git
before_script:
# install calibre latest version
- sudo -v && wget --no-check-certificate -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
# install qiniu sync
- wget http://devtools.qiniu.io/qiniu-devtools-linux_amd64-current.tar.gz
- tar xfz qiniu-devtools-linux_amd64-current.tar.gz
- cp algorithm-exercise/conf/qiniu_sync.json ~/
script:
# replace with real key
- sed -i "s/AccessKey/$QAK/g" qiniu_sync.json
- sed -i "s/SecretKey/$QSK/g" qiniu_sync.json
- mkdir -p ~/upload
- cd ~/algorithm-exercise
- gitbook install
# - gitbook build ./ --format=json
# - gitbook build ./
- gitbook pdf ./ ~/upload/algorithm_billryan_print.pdf
# - gitbook epub ./ ~/upload/algorithm_billryan.epub
# - gitbook mobi ./ ~/upload/algorithm_billryan.mobi
after_success:
# copy website html files to upload
# - tar czf algorithm_billryan_html.tar.gz _book/
# - cp algorithm_billryan_html.tar.gz ~/upload/
# upload to qiniu
- ~/qrsync ~/qiniu_sync.json
# # cd ~
# - cd ~
# # install source code pro
# - mkdir -p /tmp/code_pro
# - cd /tmp/code_pro/
# - wget https://github.com/adobe-fonts/source-code-pro/archive/1.017R.tar.gz
# - tar xzf 1.017R.tar.gz
# - mkdir -p ~/.fonts/fontconfig/conf.d/
# - cp source-code-pro-1.017R/OTF/*.otf ~/.fonts/
# - sudo fc-cache -f -v
# # install google noto Simplified Chinese
# - mkdir -p /tmp/noto
# - cd /tmp/noto
# - wget https://www.google.com/get/noto/pkgs/NotoSansCJKSC-hinted.zip
# - https://www.google.com/get/noto/pkgs/NotoSerif-unhinted.zip
# - unzip NotoSansCJKSC-hinted.zip
# - unzip NotoSerif-unhinted.zip
# - mkdir -p ~/.fonts/noto
# - mv *.otf ~/.fonts/noto
# # update fonts
# - cd ~
# - cp ~/algorithm-exercise/conf/10-latin.conf ~/.fonts/fontconfig/conf.d/
# - cp ~/algorithm-exercise/conf/15-noto-cjksc.conf ~/.fonts/fontconfig/conf.d/
# - cp ~/algorithm-exercise/conf/20-noto-cjk.conf ~/.fonts/fontconfig/conf.d/
# - sudo fc-cache -f -v
# # generate different locales
# - sudo locale-gen zh_CN.UTF-8
# - cd ~/algorithm-exercise
# - export LANG=zh_CN.UTF-8
# - gitbook pdf ./ ~/upload/algorithm_billryan_desktop.pdf
# - ~/qrsync ~/qiniu_sync.json
branches:
only:
- master