forked from ooni/ooni.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
57 lines (48 loc) · 2.76 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
---
branches:
only:
- master # that's unreasonable to have N versions of gh-pages website :)
git:
depth: 3 # https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth
dist: trusty # more "modern" stuff, that's default on 2017-10-18
sudo: false # speedup, that's default on 2017-10-18
language: python # speedup
python:
- 2.7
install:
- mkdir -p bin contrib
# FIXME: 0.30 causes https://openobservatory.github.io/post/ to appear in wrong order
- wget https://github.com/gohugoio/hugo/releases/download/v0.29/hugo_0.29_Linux-64bit.tar.gz -O /tmp/hugo_0.29_Linux-64bit.tar.gz
- echo '80011b40b64781a5adfbf882fe3ab3b3c526e9ba8583fb532cd2331ffbe44a9e /tmp/hugo_0.29_Linux-64bit.tar.gz' >/tmp/hugo_0.29_checksums.txt
- sha256sum --check /tmp/hugo_0.29_checksums.txt
- tar -xf /tmp/hugo_0.29_Linux-64bit.tar.gz -C bin/
- pip install sphinx sphinx_rtd_theme # Should I specify sphinx versions?
- if [ ! -d contrib/ooni-probe ]; then git clone --depth 1 --branch master https://github.com/ooni/probe-legacy.git contrib/ooni-probe; else cd contrib/ooni-probe && git pull --ff-only origin master; fi
script:
# keep this in-sync with `Makefile`, this copy-pasta is here to track execution time of each step at Travis CI
# `public` directory is a scratchpad for website generator
# `design` directory is http://openobservatory.github.io/design/ website for https://github.com/openobservatory/design repo
- rm -rf public design
- bin/hugo --theme=ooni --buildDrafts --baseUrl=https://ooni.torproject.org
- make -C contrib/ooni-probe/docs clean
- make -C contrib/ooni-probe/docs html
- cp -R contrib/ooni-probe/docs/build/html/ public/docs/
- git show HEAD -q '--format=# HELP ooni_web_mtime UNIX Time of the commit used to build website.%n# TYPE ooni_web_mtime gauge%nooni_web_mtime %ct' >public/_web.mtime.txt
- touch public/.nojekyll
env:
# GITHUB_TOKEN=... for @OONIWebPusher see ooni-sysadmin/scripts/mk-travis-vault-env for example
# Travis `pages` deploy provides requires "personal access token", that's why it's not a deploy key, see https://docs.travis-ci.com/user/deployment/pages/ for details
# Password for the @OONIWebPusher is maintained by leonid@openobservatory.org, password reset email address is admin@openobservatory.org
- secure: "c9wPMEIZ6qWZi2uQl8RvDq9bVnOhxwDlZPJLyT4m+5WBJau36pBVfZdG8Wxp20dV778jzTrwE1TzFAD80+E95XN0dzQtG2TZASJ/q0IXi7qR4xEnuUi0kDkLAqcvyS1PxQi1W0aUp0t4jYIiqLBDfPol0rJYwTIbsECMv3Rhvyo="
deploy:
on:
branch: master # XXX: wtf does it mean?
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: public
repo: OpenObservatory/OpenObservatory.github.io
target_branch: master
name: OONI Web Pusher
email: admin@openobservatory.org # publishing OONI with deploy@travis-ci.org is ugly
...