forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
48 lines (43 loc) · 1.18 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
39
40
41
42
43
44
45
46
47
library(identifier: '[email protected]', retriever: modernSCM(
[$class: 'GitSCMSource',
remote: '[email protected]:cloudops/cloudmc-jenkins-shared.git',
credentialsId: 'gh-jenkins']))
pipeline {
agent { label 'api-docs' }
options { disableConcurrentBuilds() }
environment {
GIT_URL = '[email protected]:cloudops/cloudmc-api-docs.git'
}
stages {
stage('Setup') {
steps {
deleteDir()
git credentialsId: 'gh-jenkins', url: env.GIT_URL, branch: env.BRANCH_NAME
}
}
stage('Deploy github pages') {
when {
expression {
env.BRANCH_NAME == 'cmc-dev'
}
}
steps{
script {
sh "sudo bundle install"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'gh-jenkins', usernameVariable: 'GIT_AUTHOR_NAME', passwordVariable: 'GIT_PASSWORD']]) {
sh 'set +x'
sh 'git config user.name "$GIT_AUTHOR_NAME"'
sh 'git config user.password "$GIT_PASSWORD"'
sh 'set -x'
sh "./deploy.sh"
}
}
}
}
}
post{
always {
notifySlack currentBuild.result
}
}
}