Fixes to release scripts (#238)

This commit is contained in:
Daniel Azuma 2019-10-09 10:55:44 -07:00 committed by GitHub
parent 41bb5f13b2
commit 5523a75fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 4 deletions

View File

@ -17,6 +17,37 @@ before_action {
} }
} }
# Fetch magictoken to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "releasetool-magictoken"
backend_type: FASTCONFIGPUSH
}
}
}
# Fetch api key to use with Magic Github Proxy
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "magic-github-proxy-api-key"
backend_type: FASTCONFIGPUSH
}
}
}
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "docuploader_service_account"
}
}
}
# Download resources for system tests (service account key, etc.) # Download resources for system tests (service account key, etc.)
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-ruby" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-ruby"
@ -37,6 +68,11 @@ env_vars: {
value: "github/google-auth-library-ruby/.kokoro/build.sh" value: "github/google-auth-library-ruby/.kokoro/build.sh"
} }
env_vars: {
key: "TRAMPOLINE_SCRIPT"
value: "trampoline_v1.py"
}
env_vars: { env_vars: {
key: "JOB_TYPE" key: "JOB_TYPE"
value: "release" value: "release"
@ -51,3 +87,8 @@ env_vars: {
key: "REPO_DIR" key: "REPO_DIR"
value: "github/google-auth-library-ruby" value: "github/google-auth-library-ruby"
} }
env_vars: {
key: "PACKAGE"
value: "googleauth"
}

View File

@ -23,3 +23,5 @@ platforms :jruby do
group :development do group :development do
end end
end end
gem "gems", "~> 1.2"

View File

@ -1,4 +1,5 @@
# -*- ruby -*- # -*- ruby -*-
require "json"
require "bundler/gem_tasks" require "bundler/gem_tasks"
task :ci do task :ci do
@ -7,12 +8,12 @@ task :ci do
sh "bundle exec rspec" sh "bundle exec rspec"
end end
task :release, :tag do |_t, args| task :release_gem, :tag do |_t, args|
tag = args[:tag] tag = args[:tag]
raise "You must provide a tag to release." if tag.nil? raise "You must provide a tag to release." if tag.nil?
# Verify the tag format "vVERSION" # Verify the tag format "vVERSION"
m = tag.match(/v(?<version>\S*)/) m = tag.match(/google-auth-library-ruby\/v(?<version>\S*)/)
raise "Tag #{tag} does not match the expected format." if m.nil? raise "Tag #{tag} does not match the expected format." if m.nil?
version = m[:version] version = m[:version]
@ -33,7 +34,7 @@ task :release, :tag do |_t, args|
sh "bundle exec rake build" sh "bundle exec rake build"
end end
path_to_be_pushed = "pkg/#{version}.gem" path_to_be_pushed = "pkg/googleauth-#{version}.gem"
if File.file? path_to_be_pushed if File.file? path_to_be_pushed
begin begin
::Gems.push File.new(path_to_be_pushed) ::Gems.push File.new(path_to_be_pushed)
@ -75,7 +76,7 @@ namespace :kokoro do
.first.split("(").last.split(")").first || "0.1.0" .first.split("(").last.split(")").first || "0.1.0"
end end
Rake::Task["kokoro:load_env_vars"].invoke Rake::Task["kokoro:load_env_vars"].invoke
Rake::Task["release"].invoke "v/#{version}" Rake::Task["release_gem"].invoke "google-auth-library-ruby/v#{version}"
end end
end end