-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathJenkinsfile
More file actions
40 lines (40 loc) · 1.26 KB
/
Jenkinsfile
File metadata and controls
40 lines (40 loc) · 1.26 KB
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
pipeline {
agent { docker 'ruby:2.6.3' }
parameters {
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Perform release?')
string(name: 'RELEASE_VERSION', defaultValue: '', description: 'Release version')
}
stages {
stage('Install') {
steps {
sh 'gem install bundler -v 2.0.1'
sh 'bundle install'
}
}
stage('Lint') {
steps { sh 'bundle exec rake rubocop' }
}
stage('Test') {
steps { sh 'bundle exec rake test' }
}
stage('Release') {
when { expression { return params.RELEASE } }
steps {
configFileProvider([configFile(fileId: 'gem-credentials', variable: 'CREDENTIALS')]) {
sshagent(['qameta-ci_ssh']) {
sh 'mkdir -p ~/.gem && mv $CREDENTIALS ~/.gem/credentials && chmod 0600 ~/.gem/credentials'
sh 'git checkout master && git pull origin master'
sh 'bundle exec rake version[${RELEASE_VERSION:-minor}] release'
}
}
}
}
}
post {
always { deleteDir() }
failure {
slackSend message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} failed (<${env.BUILD_URL}|Open>)",
color: 'danger', teamDomain: 'qameta', channel: 'allure', tokenCredentialId: 'allure-channel'
}
}
}