forked from devonfw/ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (63 loc) · 2.93 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
language: java
dist: bionic
jdk:
- openjdk11
sudo: required
env:
global:
- ORG="devonfw"
- EMAIL="icsddevonfwsupport.apps2@capgemini.com"
- REPO_SOURCE="ide"
- REPO_DEST="ide.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: UiDrM43BAEZuPP7foI6jn4L/5c1E2dZWqH3lo4QD15PNWm0oUEd0bralpW3UQDL094olWuxvngcX2MAv8MRZFkjgYMhUFgAbt7Q5UJrRuZamey/GCmw7HrkNTupV4EJIZpGCzBDTD7H+LsRGw7BJ/+flTuTZMFFDyPo45ePOxZS8Rv24KGT5WYDBLdDQgr1E9zsAX+CRg6b9oNYcrSNXlRaK3u+pa1G2lw1Uq1Z8+9GVcM3cjUMem8EsrMckdGqMmyZite0ZuUIu0Jsrm3BCjxQyDuWihJ3lOvaBzyuHUlaQnKHFo2CKILiW4kn5Iyt1/UN14PSZCjOi35nFVSwLT+5uvJJIryrz+ZCfwyjg8joNPl7xJNX5k1zSTv3Wo5XZGhvGHLJSI7Vm7PSVhdjWj7wJKweiyeZpwIrtCqMkKwetCMzN0FPe4rhd4UebKLKoyfhHp9q6vkDlbxvCj1iHG59KbcdO5PWROiwfaSrE/Hy5V5TKh2siRuDnzrvPmq07Y4cEekqKtJ6Fb/QzgD/Rj0Po7RihP5hcZkGRsblw62NqFRKutyTkoOlehIizguFJkb4uXIH51ovSK2FYTEwuiB8/2gt9H9L3Cp0l6BNjuifPRDfAiLNPcMw6tmJNYc3RJNPAI/oW1XK/tAjYoiUESZPeudTRM5aQ7VXxocFrV0Q=
stages:
- name: Build
- name: Documentation
jobs:
include:
- stage: Build
install: skip
script:
- mvn install
- stage: Documentation
if: (type = push) AND (branch = master)
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://${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}; else return 0; fi;
git submodule init
git submodule update
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