forked from devonfw/cobigen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
54 lines (54 loc) · 2.8 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="[email protected]"
- REPO_SOURCE="tools-cobigen"
- REPO_DEST="tools-cobigen.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: LaDZLvPaW1O59PbNnkNo/e18/fsdPDmlS5dF2hfbljAgYfdCwyiJbCAoUMyM1NcAHQ/28zNWaVP8u5cADNbQGA3X4FYSfCRTaq5Ikm0AOObb/JQrhvMMkSfzhM1AU/oglUfYtwcBWdCEhUrsX97tZPoVCjlaqrjiBWYDyp70NAxrKpXnNEiy4GRPUHSy9WIgfYcG5Y2V1mZHWmkurhtUL6Xy2SL6Uq9/VazqlI6Yxry9AXpZHQynjQlmbMkGPC71AIcb8vfY47a/n7mwnztzfTuRUnIZKyetIiT0GHPErg0S2IBGk1LTxBd9mFk1lKCybbUv1G7ROxrYaw1yeRwcsb7tLRwX8QT9HfcDSIzKO7fr92HsGzSsPrjsCObGPxLPPUTqSC+DDIU1S2KChqjLXuq6AOdY0qWAuUOhtp+ksb1oqEQnWowKfJ17Z5ijuC7alPAdlHqlN9BY/AYkyUpr1azOJuBKwG1uMkhxTjLKnu8HHZ0onkcwkKwTjl+FEfaIWBqiIFl/2VPSZ+jLlcccgzW3emVI2EzZFDTX9wIzgE0BJx1ZV3aQQ74gbVNngDyl9BS2ncSIG2YCC6gJfSfYyGl00cctHdq9QtR61XJdklQmAw2vjdq4me3WT7lPx1BeAkxZL1l7xmUovt7kpdd9NDD26b8a8ITLqgQ377RZ3nI=
stages:
- name: Documentation
if: (branch = master) AND (type = push)
jobs:
include:
- stage: Documentation
script:
# Clone repositories
- git clone -b master --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://${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://${GITHUB_TOKEN}@${GH_REPO_CONSOLIDATE}"
git push origin-wiki master
fi