-
Notifications
You must be signed in to change notification settings - Fork 24
/
.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="devon4node"
- REPO_DEST="devon4node.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: jaTrHaS+TJa3nF1xaE4ceZyPjX/5ehFVvco9czHgkM9Hc3Zwq+14C+k8Sli9dyGif4KggxFIsu87i05mLy+PASk7G2AuNMvXeWUa0fnzVCYpzbuyGHFjg+zYnApKbV8cV4MO6ObomeDdTQa1M7a6XN1WJaPnWzKx5AanL2m5qm44p1VoJkn/Km4wZSnsda241+uduEyJo+Zgf8gIRKtvKKs3GvZnoIGtNwE8yX8XYojEl2ZNALuyH3VapQU5QuzyUaRfFmedslwB43kpbBESpQncLW7lhvT1p/3uJDdGKuVyWY25EuFSE0ZnMwzh9rBdf2a3lPPewoer31mSynNSiDBuR8EuSFI/6DHOxJAirCSl74wdrc98qW0UepPqaj0XL2GNfsTkJVXGyQ85/erAxC67beqUR3YuR/3hZuoLqkXcFAU+kuyUN0bYoIkXFSyrDgzi+6OuSY21mU42sGyLOqCp4QV/LuiQCafqE6YY+N4dMvIQzQk6faPdkEL7uRg5OB9zVmZWvambU83k9/kWMtWgsphmEJCl+ODA+5a2MxFrMCfndzyZosw9G9TgRQqfbRdCfWqhM0i+vJX0Y+N0fGekE+pSghzTxQE68egp5gh1zbyXLt4WBQRK5I5ulI78nhEJuBXjO47OMWuYkR+3QUfqRQIiO/PrgVJQE8dutUE=
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