Improve jenkins build and potential to publish

This commit is contained in:
Zach Leslie
2018-01-06 13:41:25 -08:00
parent 23d7e2402f
commit 35b795632b
3 changed files with 28 additions and 9 deletions

29
Jenkinsfile vendored
View File

@@ -1,20 +1,31 @@
pipeline {
agent any
triggers { pollSCM('*/15 * * * *') }
environment {
PATH = "$PATH:~/.rbenv/bin"
}
stages {
stage('bundle') {
stage('test') {
steps {
sh 'bundle'
sh '. .env.sh && printenv && bundle'
sh '. .env.sh && bundle exec rake test'
}
}
stage('rake test') {
steps {
sh 'bundle exec rake test'
stage('build') {
when {
branch 'master'
}
}
stage('module:build') {
steps {
sh 'bundle exec rake module:build'
sh '. .env.sh && bundle exec rake clean'
sh '. .env.sh && bundle exec rake build'
sh '[ "$(git rev-list -n 1 $(git tag | tail -n 1 ))" == "$(git rev-list -n 1 HEAD)" ] && bundle exec rake publish pkg/*.tar.gz'
}
}
}
}
}