From 4bb87ef0b04b1e33aba000fc01be37725e206df5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 12 Jan 2023 11:20:21 +0000 Subject: [PATCH] [PROF-6762] Migrate Ruby gem release step to use new api key **What does this PR do?**: Update the Ruby release step to use the new api key. **Motivation**: Keep up with rubygems.org security best practices. **Additional Notes**: (N/A) **How to test the change?**: Because rubygems.org doesn't allow re-pushing the same version of a gem, you can actually run `docker-compose run push_to_rubygems` and observe that rubygems.org accepts the new key and command, but then complains that the current version of libdatadog (1.0.1) has already been pushed before. --- ruby/README.md | 1 - ruby/Rakefile | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ruby/README.md b/ruby/README.md index 585bbdf0d0..7173fbc079 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -26,7 +26,6 @@ Note: Publishing new releases to rubygems.org can only be done by Datadog employ 3. [ ] Update the file with the `LIB_VERSION` and `VERSION` to use 4. [ ] Commit change, open PR, get it merged 5. [ ] Release by running `docker-compose run push_to_rubygems`. - (When asked for rubygems credentials, check your local friendly Datadog 1Password.) 6. [ ] Verify that release shows up correctly on: ## Contributing diff --git a/ruby/Rakefile b/ruby/Rakefile index 573b298747..f713d25ba9 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -120,6 +120,11 @@ task push_to_rubygems: [ ] do system("gem signout") # make sure there are no existing credentials in use + puts "Please input 'libdatadog ruby release key' from 'Profiling - Falcon' Datadog 1Password:" + input = $stdin.gets.strip + + ENV["GEM_HOST_API_KEY"] = input + system("gem push pkg/libdatadog-#{Libdatadog::VERSION}.gem") system("gem push pkg/libdatadog-#{Libdatadog::VERSION}-x86_64-linux.gem") system("gem push pkg/libdatadog-#{Libdatadog::VERSION}-aarch64-linux.gem")