This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
55 lines (55 loc) · 2.91 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
language: generic
env:
global:
- ORG="devonfw"
- EMAIL="[email protected]"
- REPO_SOURCE="cicdgen"
- REPO_DEST="cicdgen.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: T8AkwLwR8026W/nEzGKMU5aBA2gP0duMf53Nc/WCX5nQZ+aHJK3JbvdJzmyjD/x8JSgZsu4Enfg+B7AOPmarzH3ZQLXMDv8W/RjY1q1FBeqy0P0/qvctjzJSz3InhQ+7pqJWqf7kbQnlwXVgiTQOM65WHMftR4K1RaArAlUGfRFMO4Kr/q5ftzGETnQkU+q1hiQNZGGRYe8nwUi4aUUkUr0VJs/rjoyKBl+/gTlMjReCkhoV1uy0TrZdGmzxoFC8s9pZTndyL2cm1wQ13dGr2V0/ghUeT6AqbDZSWpLk458rdFhEPRn3t4haBQVLVGHOuDny3Qe5d77iuz0rUbO606HnFBdrRihkOOq8QUP0PXs8em//vN0kyKbYqac9eGO3OvTRuvzocXaIoYmjJ6lZ43k3NaXDDKUtMtFkMwkREEr20UN8//FQ9C2kyD1O5IglxTG2ukEWsazvUqslol/KhoZL0xgFpExAF2ugqfqeromvjz2VWpQSy9rFYZCWH0sY410mK207U0CLzcWabPfVvIHvK/Oi+M2XhwQHJw13H3UhEmIXbZUX4Ryporu1wmF2WgfmKxwx2mF9FSBMOHGMITGWlOwxfzrsBtCd/jLlUzbc6w/dFTss0fSX6DrbQSkXFT8aKvR8xy3ccFUPwaN6g0p1n2E48HrPD/xa0JMIYWA=
stages:
- name: Documentation
if: (branch = develop) AND (type = push)
jobs:
include:
- stage: Documentation
if: (type = push) AND (branch = develop)
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