-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path.travis.yml
87 lines (79 loc) · 3.25 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
80
81
82
83
84
85
86
87
env:
##Do not define 'global' env vars here. They cannot be used with API builds
matrix:
- TARGET=devo8 MAKETARGET=latexpdf-release
- TARGET=devo8 MAKETARGET=html-release
- TARGET=devo10 MAKETARGET=latexpdf-release
- TARGET=devo10 MAKETARGET=html-release
dist: trusty
sudo: false
addons:
apt:
packages:
- build-essential
- git
- inkscape
- libjpeg-dev
- libz-dev
- texlive
- texlive-latex-extra
- texlive-lang-all
- latexmk
language: python
before_install:
- openssl aes-256-cbc -K $key -iv $iv -in install_documentation.tar.enc -out install_documentation.tar -d;
tar -xf install_documentation.tar;
rm -f install_documentation.tar
- echo "[https://www.transifex.com]" > .transifexrc;
echo "hostname = https://www.transifex.com" >> .transifexrc;
echo "password = $TX_PASSWD" >> .transifexrc;
echo "username = api" >> .transifexrc
- git config --global user.email "[email protected]";
git config --global user.name "Travis CI";
git config --global credential.helper store;
echo "https://$GH_TOKEN:[email protected]" >> ~/.git-credentials
# command to install dependencies - this is done in Makefile already
#install: "pip install -r requirements.txt"
script:
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
if [[ "$TARGET" == "devo8" && "$MAKETARGET" == "latexpdf-release" ]]; then
git clone https://www.github.com/DeviationTX/deviation-manual.git $HOME/txgit --depth 20 > /dev/null 2>&1;
cp .transifexrc $HOME/txgit; pushd $HOME/txgit;
tx pull -f -a;
./utils/clean_transifex_merge.py source/locale;
git add source/locale;
git commit -m "`utils/get_altered_languages.py 'Updating translations from Transifex'`";
git push > /dev/null 2>&1 && echo "Successfully uploaded new translations to Github.";
popd; rm -rf $HOME/txgit;
fi;
else
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
tx pull -f -a;
fi;
make $MAKETARGET;
fi;
cache:
apt: true
pip: true
directories:
- build/venv
# Generate new strings for transifex from manual changes
# Upload manual builds to deviationtx.com
after_success:
- if [[ "$TRAVIS_EVENT_TYPE" == "push" ]]; then
if [[ "$MAKETARGET" == "latexpdf-release" ]]; then
if [[ "$TARGET" == "devo8" ]]; then
make gettext; sphinx-intl -c source/conf.py-intl update -p build/locale; tx push -s;
fi;
export TARGET_VERSION=$(echo $TARGET | egrep -o '[[:digit:]]{1,2}');
export TARGET_PDF=$(echo "devo${TARGET_VERSION}manual*.pdf");
echo "Uploading Documentation - $TARGET_PDF";
utils/upload_documentation.pl -documentation -pdf build/pdf-$TARGET/$TARGET_PDF;
else
if [[ "$MAKETARGET" == "html-release" ]]; then
export TARGET_ZIP=$(echo "*.zip");
echo "Uploading Documentation - $TARGET_ZIP";
utils/upload_documentation.pl -documentation -html build/html-$TARGET/$TARGET_ZIP;
fi;
fi;
fi;