-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathJenkinsfile
32 lines (27 loc) · 969 Bytes
/
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
#!groovy
import groovy.json.JsonSlurper
node {
deleteDir()
checkout scm
docker.image('jcustenborder/packaging-centos-7:37').inside {
stage('bundler') {
sh 'bundle install'
}
stage('spec') {
sh 'rake spec'
}
if (env.BRANCH_NAME == 'master') {
stage('publish') {
withCredentials([usernamePassword(credentialsId: 'puppet_forge', passwordVariable: 'BLACKSMITH_FORGE_PASSWORD', usernameVariable: 'BLACKSMITH_FORGE_USERNAME')]) {
withEnv(['BLACKSMITH_FORGE_URL=https://forgeapi.puppetlabs.com']) {
sh 'rake jenkins_set_version module:tag build module:push'
}
}
sh("git tag ${version}")
sshagent(credentials: ['50a4ec3a-9caf-43d1-bfab-6465b47292da']) {
sh "git push origin ${version}"
}
}
}
}
}