forked from galasa-dev-archives/managers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithubdocs.sh
More file actions
executable file
·42 lines (31 loc) · 811 Bytes
/
githubdocs.sh
File metadata and controls
executable file
·42 lines (31 loc) · 811 Bytes
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
#!/bin/sh +e
#
# Copyright contributors to the Galasa project
#
# SPDX-License-Identifier: EPL-2.0
#
echo "Checking for changes"
CHANGED=$(git status -s .)
echo $CHANGED
if [ -z "$CHANGED" ]; then
echo "No changes detected"
exit 0
fi
echo "Configing user"
git config user.name '$DOC_USER'
git config user.email $DOC_EMAIL
echo "Adding changes"
git add .
echo "Committing changes"
git commit -m "Generated manager docs $BUILD_TAG"
echo "Pushing branch"
git push -f origin $DOC_BRANCH
echo "Checking for Pull Request"
PR=$(hub pr list -h $DOC_BRANCH)
echo $PR
if [ ! -z "$PR" ]; then
echo 'Pull Request is open'
exit 0
fi
echo "No Pull Request exists, creating one"
hub pull-request -b next -h $DOC_BRANCH -m "Autogenned Manager Documentation" -m "Jenkins run $BUILD_TAG" -r $DOC_REVIEWERS