-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
54 lines (54 loc) · 2.81 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
language: generic
env:
global:
- ORG="devonfw"
- EMAIL="icsddevonfwsupport.apps2@capgemini.com"
- REPO_SOURCE="shop-floor"
- REPO_DEST="shop-floor.wiki"
- REPO_CONSOLIDATE="devonfw-guide"
- GH_REPO_SOURCE="github.com/${ORG}/${REPO_SOURCE}.git"
- GH_REPO_DEST="github.com/${ORG}/${REPO_DEST}.git"
- GH_REPO_CONSOLIDATE="github.com/${ORG}/${REPO_CONSOLIDATE}.git"
- secure: ZXLIyezlWyMqgBe44jC3NdTObxszQy7KJy6uAet2R9vpSC57fVp5bXtqmj83cbHXZo1tRYeNsRrCeQ76Kd6Y0idgeGTre1U9ToDm7wryws2k8Ww5wRbTBqD2Rn+0MboBuGLQBHHL9hmHfqc9+FJfZl1j/4L16Bqmc8t7iGCjRrUegk6L0xKaOghDvc+RJ5+k+KZ3TMepXayRsoXG5lnirI180zHRlm1dfS8jhemL6bO3VGjVYsagfd77c48vPZvZfCRco9t0Crv5HoynSjFlTr8HN81hegqsL0tvsH5aMDR7JRVGb9m06iWpLGp/sigfL845v304r2iVgDUC6VLdRjpoftSaWhdr1hI9Yhx5bpywNbHcLnc/tCpOXrYxwhJrC62vx3WsXB40N8CQuTbZmy5xF/FafKpjOrFg8r7esexrz2valY8Ic/5s2JDV+cdbjJ9YcDmhc+B4vj7OE+HHBVqfs/O3rXhE+DDvszGoiuGN2Rts0vqB4qecBbmSo4ZDgMrHEO0j21od1+dmA1ITM4cPGcEkTVW5wbzSaV++px40qUFuXpj+cGLMXrcsufYz21mF75k7Z7tDN6SfBZzVaZNSePG3gmsiaNLxjBBbiBYj4qhaHWiSoLyduZFFHx45TsuJtts2L620Arzk/PJZt1uLy0fTgIrV849exj8/qiE=
stages:
- name: Documentation
if: (branch = develop) AND (type = push)
jobs:
include:
- stage: Documentation
script:
# Clone repositories
- git clone -b develop --single-branch https://${GH_REPO_SOURCE}
- git clone https://${GH_REPO_DEST}
- git clone https://${GH_REPO_CONSOLIDATE}
# Update wiki repository with documentation folder contents
- yes | cp -rf ${REPO_SOURCE}/documentation/* ${REPO_DEST}/
- cd ${REPO_DEST}
- grep -lr "link:[a-zA-Z0-9_.-]*.asciidoc.*" .| xargs -r sed -i "s/.asciidoc//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
cd ../${REPO_CONSOLIDATE}
if [ ! -d ${REPO_DEST} ]; then git submodule add https://${GH_REPO_DEST}; fi;
git submodule init
git submodule update --recursive --remote
cd ${REPO_DEST}
git checkout master
git pull
cd ..
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_CONSOLIDATE}"
git push origin-wiki master
fi