Skip to content

Commit 99e52c7

Browse files
andrcunsbaev
authored andcommitted
add release task (via #17)
1 parent 2e03141 commit 99e52c7

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Jenkinsfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pipeline {
22
agent { docker 'ruby:2.6.3' }
33
parameters {
44
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Perform release?')
5+
string(name: 'RELEASE_VERSION', defaultValue: '', description: 'Release version')
56
}
67
stages {
78
stage('Install') {
@@ -20,8 +21,12 @@ pipeline {
2021
when { expression { return params.RELEASE } }
2122
steps {
2223
configFileProvider([configFile(fileId: 'gem-credentials', variable: 'CREDENTIALS')]) {
23-
sh 'mkdir -p ~/.gem && mv $CREDENTIALS ~/.gem/credentials && chmod 0600 ~/.gem/credentials'
24-
sh 'bundle exec rake release'
24+
sshagent(['qameta-ci_ssh']) {
25+
sh 'mkdir -p ~/.gem && mv $CREDENTIALS ~/.gem/credentials && chmod 0600 ~/.gem/credentials'
26+
sh 'git checkout master && git pull origin master'
27+
sh 'bundle exec rake bump[${RELEASE_VERSION}]'
28+
sh 'bundle exec rake release'
29+
}
2530
}
2631
}
2732
}

tasks/release.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55

66
directory "pkg"
77

8+
desc "Bump allure version"
9+
task :bump, [:version] do |_task, args|
10+
version = args[:version]
11+
File.write("#{root}/ALLURE_VERSION", version, mode: "w")
12+
13+
sh "bundle install --quiet && git commit Gemfile.lock ALLURE_VERSION -m 'Update allure to v#{version}'"
14+
sh "git tag #{version}"
15+
sh "git push origin HEAD --follow-tags"
16+
end
17+
818
ADAPTORS.each do |adaptor|
919
namespace adaptor do
1020
gem = "pkg/#{adaptor}-#{version}.gem"
@@ -27,7 +37,7 @@
2737
end
2838

2939
namespace :all do
40+
task clean: ADAPTORS.map { |adaptor| "#{adaptor}:clean" }
3041
task build: ADAPTORS.map { |adaptor| "#{adaptor}:build" }
31-
task install: ADAPTORS.map { |adaptor| "#{adaptor}:install" }
3242
task push: ADAPTORS.map { |adaptor| "#{adaptor}:push" }
3343
end

0 commit comments

Comments
 (0)