forked from mate-desktop/mate-desktop.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
124 lines (111 loc) · 3.91 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# vim: set ts=2 sts=2 sw=2 expandtab :
dist: xenial
sudo: required
language: bash
services:
- docker
cache:
directories:
- cache/
- output/
before_install:
- curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build
- chmod +x docker-build
install:
- sudo apt-get install -y python3-pip python3-setuptools
- sudo pip3 install --upgrade pip
- sudo pip install PyGithub
- ./docker-build --name ${DISTRO} --config .travis.yml --install
script:
- ./docker-build --name ${DISTRO} --verbose --config .travis.yml --build scripts
deploy:
#preview website
- provider: pages
github-token: $GITHUB_TOKEN
skip_cleanup: true
committer-from-gh: true
target-branch: gh-pages
local-dir: www
on:
all_branches: true
condition: '$TRAVIS_BRANCH != master'
#deploy offical website
- provider: script
script: ./docker-build --config .travis.yml --release scripts
skip_cleanup: true
on:
branch: master
after_success:
- 'if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
URL="https://preview.mate-desktop.dev";
COMMENT="Preview website deployed.";
curl -H "Authorization: token $GITHUB_TOKEN" -X POST
-d "{\"state\": \"success\", \"description\": \"$COMMENT\", \"context\":\"nikola-build\", \"target_url\": \"$URL\"}"
https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA};
fi'
env:
- DISTRO="archlinux/base"
##########################################################
# THE FOLLOWING LINES IS USED BY docker-build
##########################################################
requires:
archlinux:
- java-runtime-headless
- java-runtime=8
- jpegoptim
- nikola
- openssh
- optipng
- python-ghp-import
- python-typogrify
- rsync
- tar
- unzip
before_scripts:
- cd ${START_DIR}
- mkdir -p yui-compressor-builds
- cd yui-compressor-builds
- if [ ! -f yuicompressor-2.4.8.jar ];then
- curl -Ls -o yuicompressor-2.4.8.jar https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar
- curl -Ls -o yuicompressor.sh https://aur.archlinux.org/cgit/aur.git/plain/yuicompressor.sh?h=yuicompressor
- sed -i "s|x\.y\.z|2.4.8|" yuicompressor.sh
- install -D -m644 yuicompressor-2.4.8.jar /usr/share/java/yuicompressor-2.4.8.jar
- install -D -m755 yuicompressor.sh /usr/bin/yuicompressor
- fi
build_scripts:
- if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_BRANCH" != "master" ]]; then
- sed -i '/SITE_URL/s!//mate-desktop.org/!//preview.mate-desktop.dev/!' conf.py
- sed -i '/WEBSITE_PREVIEW/s!False!True!' conf.py
- sed -i 's!PREVIEW_COMMITID!'${TRAVIS_COMMIT:0:12}'!' conf.py
- fi
- if [ -f cache/.doit.db ];then
- cp cache/.doit.db . # Restore from cache
- fi
- nikola build
after_scripts:
- cd ${START_DIR}
- rsync -a --delete output/ www/
- cp .doit.db cache
- find www -type d -exec chmod 755 {} \;
- find www -type f -exec chmod 644 {} \;
- if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_BRANCH" != "master" ]]; then
- echo 'preview.mate-desktop.dev' > www/CNAME
- fi
releases:
scripts_release:
- cd $TRAVIS_BUILD_DIR
- if [ ! -d ~/.ssh ];then
- mkdir -p ~/.ssh/
- chmod 700 ~/.ssh/
- fi
- openssl aes-256-cbc -K $KEY_KB4VKL2L4TA5APOT -iv $IVS_WD0JIBOJGJW5QPAH -in scripts/data.bin -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
- if [ -f ~/.ssh/config ];then
- mv ~/.ssh/config ~/.config.bak
- fi
- echo -e "Host *\n\tStrictHostKeyChecking=no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config
- 'rsync -a -e "ssh -o StrictHostKeyChecking=no" --delete www/ [email protected]:mate-desktop.org/'
- rm -f ~/.ssh/id_rsa
- if [ -f ~/.config.bak ];then
- mv ~/.config.bak ~/.ssh/config
- fi