forked from devonfw/jump-the-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (41 loc) · 2.19 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
language: generic
env:
global:
- ORG="devonfw"
- EMAIL="[email protected]"
- REPO_SOURCE="jump-the-queue"
- REPO_DEST="jump-the-queue.wiki"
- GH_REPO_SOURCE="github.com/${ORG}/${REPO_SOURCE}.git"
- GH_REPO_DEST="github.com/${ORG}/${REPO_DEST}.git"
- secure: qw5fXAE/9J2aTmmRsEDTPd6VRmk174aRKzRB9UOnBOUvT4fx8IYC248KoR/vnLcK0/Vygpb/xJN9wPcVpTfO8w7L55GF/Ppy9MyC15aShEVu+TlVWZL4Fto4MZBEuQsx/hMRCOVKszDzjBY902uto+beUKabE3v50u/AIALDhUohhbcX4XBsZ9LltA4GoaXdZ2gMAFO02h3ZZ0FASK2zsTfVaqf5nbjDbrxiu6LwoCXMg9PbIrp4CHoH957MnTzjwOA+t7PhgEYZf+nY1hOTlrLRvzpYAr9JzMYnHXEkzh1+qK7DtYCnmO8NDCOEZHA/pWAXNn07ZpzhWHPXD2JDzpryw26uIyWPP7EUPXsTmVyWe4JM4domg0ZVFQKhR1k9GphifOqX7hIsjaf8JsTG279xXuXd7fvByasMC8+Vsp7kyrv+Pte35dOCmDxJNT+6h9RCNki7pD3mmdXG76SV7NVFgU9ilmR7/zWmbFNoaD2xpjoA5kjJLbDyi5punOW5/ig+gSKpfr61xDDR7OoNgucFN7b39l1g2DSj4tMb2OoB3uRRW04aDTymOcit4g4iEw3W/akK4pm4fkNOQ0S8C1gF3QPPR98NlwbD8ovgsj1kJCgf39o1m/1nInZJt5AwJeR8Kl5sRdWadL1RlH8QLHd85zBPNxA4bW7gQog2TvM=
stages:
- name: Documentation
if: (branch = master) AND (type = push)
jobs:
include:
- stage: Documentation
script:
# Clone necessary repositories
- cd ..
- git clone https://${GH_REPO_DEST}
# Clean up wiki repository, copy documentation there
- cd ${REPO_DEST} && rm -rf * && cd ..
- yes | cp -rf ${REPO_SOURCE}/documentation/* ${REPO_DEST}/
- cd ${REPO_DEST}
# Remove .asciidoc file extension from relative links
- grep -lr "link:[a-zA-Z0-9_.-]*\.asciidoc\[" . | xargs -r sed -i "s/\(link:[a-zA-Z0-9_.-]*\)\.asciidoc\(\[\)/\1\2/g"
# Terminate Travis CI build when no changes detected
- |
if git diff-index --quiet HEAD && [ ! -n "$(git status -s)" ]; then
set +e
pkill -9 -P $$ &> /dev/null || true
exit 0
else
git config user.email ${EMAIL}
git config user.name ${USER}
git status
git add .
git commit -m "${REPO_SOURCE} documentation | Travis CI build number $TRAVIS_BUILD_NUMBER"
git remote add origin-wiki "https://${USER}:${GITHUB_TOKEN}@${GH_REPO_DEST}"
git push origin-wiki master
fi