Commit acc1703e authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

Merge branch 'master' of gitlab.com:gitlab-org/labkit-ruby

parents 4ba7b9d1 4af1440d
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
  spec.name = "gitlab-labkit"
  spec.version = "0.1.0"
  spec.version = `git describe --tags`.chomp.gsub(/^v/, "")
  spec.authors = ["Andrew Newdigate"]
  spec.email = ["andrew@gitlab.com"]

@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
  spec.homepage = "http://about.gitlab.com"
  spec.license = "MIT"

  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|tools)/}) }
  spec.require_paths = ["lib"]
  spec.required_ruby_version = ">= 2.4.0"

+31 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'

mkdir -p ~/.gem/
temp_file=$(mktemp)

# Revert change the credentials file
function revert_gem_cred_switch {
  mv "$temp_file" ~/.gem/credentials
}

if [[ -f ~/.gem/credentials ]]; then
  echo "Temporarily moving existing credentials to $temp_file"
  mv ~/.gem/credentials "$temp_file"
  trap revert_gem_cred_switch EXIT
fi

cat <<EOD > ~/.gem/credentials
---
:rubygems_api_key: $RUBYGEMS_API_KEY
EOD
chmod 600 ~/.gem/credentials

set -x
rm -rf pkg/
mkdir -p pkg/
bundle install
bundle exec rake build
gem push pkg/*.gem