From 1ed394c41135119bfcfa7f9cb4d592c715221332 Mon Sep 17 00:00:00 2001 From: JakeQuilty Date: Tue, 18 Aug 2020 17:30:19 -0400 Subject: [PATCH 1/3] Bump version to v5.3.3 --- CHANGELOG.md | 9 ++++++++- lib/conjur-api/version.rb | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2849799f..7e4db81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [5.3.3] - 2020-08-18 +### Changed +- Release process is updated to ensure that the published Ruby Gem matches a tag in this repository, + so that consumers of this gem can always reference the correct source code included in any given version. + [cyberark/conjur-api-ruby](https://github.com/cyberark/conjur-api-ruby/issues/173) + ## 5.3.2 - 2018-09-24 ### Added - Add `Conjur::API.authenticator_list`, `Conjur::API.authenticator_enable`, and @@ -315,7 +321,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [2.0.0] - 2013-13-12 -[Unreleased]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.1...HEAD +[Unreleased]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.3...HEAD +[5.3.3]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.1...v5.3.3 [5.3.1]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.0...v5.3.1 [5.3.0]: https://github.com/cyberark/conjur-api-ruby/compare/v5.1.0...v5.3.0 [5.1.0]: https://github.com/cyberark/conjur-api-ruby/compare/v5.0.0...v5.1.0 diff --git a/lib/conjur-api/version.rb b/lib/conjur-api/version.rb index 4ca2cddc..4dbc2d97 100644 --- a/lib/conjur-api/version.rb +++ b/lib/conjur-api/version.rb @@ -19,6 +19,6 @@ module Conjur class API - VERSION = "5.3.2" + VERSION = "5.3.3" end end From 835ed83e8cffb750c474b70b66b30b494298fe1c Mon Sep 17 00:00:00 2001 From: JakeQuilty Date: Tue, 18 Aug 2020 17:30:58 -0400 Subject: [PATCH 2/3] Update publish to RubyGems process Updates Release docs/workflow to match the newer release process Also removes an unnecessary check for branch master when tagging Removing bin/release: Since the process changed, the old process had requirements and workflows in bin/release that did not transfer over. * required local changes to "version bump files" that would get pushed with the new tag * the new flow asks for a tag change after the "bump pr" * committed and pushed file changed directly to master * this isn't a standard workflow we follow Keeping bin/release would have meant deleting almost the entire script and re-writing it to just do the tagging. --- CONTRIBUTING.md | 28 +++++++++++++++------------- Jenkinsfile | 9 ++------- bin/release | 43 ------------------------------------------- 3 files changed, 17 insertions(+), 63 deletions(-) delete mode 100755 bin/release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d8c92afd..b1c304e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -120,20 +120,22 @@ $ docker-compose down ## Releasing -Releasing a new version of this Gem: +### Update the version and changelog -1. Update the version -1. Run the release script +1. Create a new branch for the version bump. +1. Based on the unreleased content, determine the new version number and update + the [version.rb](lib/conjur-api/version.rb) file. +1. Commit these changes - `Bump version to x.y.z` is an acceptable commit message - and open a PR + for review. Your PR should include updates to `lib/conjur-api/version.rb`, and + `CHANGELOG.md`. -### Update The Version +### Add a git tag -- The version file (`lib/conjur-api/version.rb`) has been updated with an appropriate Semantic version number. -- The `CHANGELOG.md` file has been updated to reflect the release version and appropriate release notes. +1. Once your changes have been **reviewed and merged into master**, tag the version + using `git tag -a "vx.y.z" -m "vx.y.z release"`. Note this requires you to be able to sign releases. + Consult the [github documentation on signing commits](https://help.github.com/articles/signing-commits-with-gpg/) + on how to set this up. `vx.y.z release` is an acceptable tag message. +1. Push the tag: `git push vx.y.z` (or `git push origin vx.y.z` if you are working + from your local machine). -Next, save -- but do not commit -- the changes above. - -### Run The Release Script - -```sh -./bin/release -``` +After pushing the tag, a matching version will be published to [RubyGems](https://rubygems.org/gems/conjur-api/versions)! diff --git a/Jenkinsfile b/Jenkinsfile index ad37575a..05926785 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,16 +40,11 @@ pipeline { } } - // Only publish to RubyGems if branch is 'master' - // AND the tag begins with 'v' ex) v5.3.2 + // Only publish to RubyGems if the tag begins with 'v' ex) v5.3.2 stage('Publish to RubyGems?') { agent { label 'releaser-v2' } - when { - allOf { - branch 'master'; tag "v*" - } - } + when { tag "v*" } steps { // Clean up first sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd' diff --git a/bin/release b/bin/release deleted file mode 100755 index 04b255f4..00000000 --- a/bin/release +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -e - -git fetch --tags - -if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then - echo "Must be on the master branch to releases. Please switch with 'git checkout master'." - exit 1 -fi - -version_file="$(cat lib/conjur-api/version.rb)" -re='VERSION = "([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,})"' -if [[ "$version_file" =~ $re ]]; then - version="v${BASH_REMATCH[1]}" -else - echo "Failed to find a version in 'lib/conjur-api/version.rb'" - exit 1 -fi - -last_release=$(git describe --abbrev=0 --tags) - -echo "The last release was: $last_release" -echo "The next release will be: $version" - -if [ "$version" = "$last_release" ]; then - echo 'To release, the VERSION file must be incremented to the latest release number.' - exit 1 -fi - -if [[ ! $(git status --porcelain) ]]; then - echo 'Your Git is clean. Please update the lib/conjur-api/version.rb, and CHANGELOG.md before releasing. The script will handle commits and pushing.' - exit 1 -fi - -# Make sure we have the most recent changes, without destroying local changes. -git stash -git pull --rebase origin master -git stash pop - -# Perform a commit, tag, and push. The tag needs to be present before the commit -# to insure Jenkins has what it needs to make a decision about a release. -git commit -am "$version" -git tag -a "$version" -m "$version release" -git push --follow-tags From 2273b770e6f81fb13598e422f8aec20d289cef98 Mon Sep 17 00:00:00 2001 From: JakeQuilty Date: Wed, 19 Aug 2020 14:23:04 -0400 Subject: [PATCH 3/3] replace non-exitent node releaser-v2 is no longer a node that exists. Infra recomended trying executor-v2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 05926785..251d7a4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,7 +42,7 @@ pipeline { // Only publish to RubyGems if the tag begins with 'v' ex) v5.3.2 stage('Publish to RubyGems?') { - agent { label 'releaser-v2' } + agent { label 'executor-v2' } when { tag "v*" } steps {