forked from loopbackio/loopback.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
38 lines (36 loc) · 1.03 KB
/
Jenkinsfile
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
#!groovy
def gitEnv = [
'GIT_COMMITTER_NAME=StrongLoop Bot',
'GIT_AUTHOR_NAME=StrongLoop Bot',
]
node('linux && git') {
stage('checkout') {
checkout scm
}
stage('download updates') {
sh './update-readmes.sh'
sh './update-community-readmes.sh'
}
stage('check updates') {
sh 'git status'
}
stage('commit updates') {
if (sh(returnStatus: true, script: 'git diff --quiet') != 0) {
echo "Updates found, committing and pushing back up to github..."
// this will add new files if the readme list grows, but removing
// existing files will have to be done by a human for now.
sh 'git add pages/en/lb2/readmes'
sh 'git add pages/en/community/readmes'
withEnv(gitEnv) {
sh 'git commit -m "Update READMEs from other repos"'
}
sshagent(credentials: ['loopback-io-deploy']) {
sh 'git push origin HEAD:$BRANCH_NAME'
}
} else {
echo "No updates to commit"
}
}
}