Sha256: ea73d376544d2621f7c40396168454d9bce7a964b0d7bb02f58180722cbfa409

Contents?: true

Size: 984 Bytes

Versions: 11

Compression:

Stored size: 984 Bytes

Contents

#!/usr/bin/env ruby
require 'shellwords'

STDOUT.sync = true

def run_cmd(command)
  puts "== Running: #{command}"
  result = `#{command}`
  raise "Command failed: #{command.inspect}\nResult: #{result}" unless $?.success?
end

puts "== Setting Up CI =="

netrc_file = "#{ENV['HOME']}/.netrc"
unless File.exists?(netrc_file)
  File.open(netrc_file, 'w') do |file|
    file.write <<-EOF
machine git.heroku.com
  login #{ENV.fetch('HEROKU_API_USER')}
  password #{ENV.fetch('HEROKU_API_KEY')}
machine api.heroku.com
  login #{ENV.fetch('HEROKU_API_USER')}
  password #{ENV.fetch('HEROKU_API_KEY')}
EOF
    run_cmd 'chmod 0600 "$HOME/.netrc"'
  end
end

run_cmd "bundle exec hatchet ci:install_heroku"
run_cmd "bundle exec hatchet install"
run_cmd "git config --get user.email > /dev/null || git config --global user.email #{ENV.fetch('HEROKU_API_USER').shellescape}"
run_cmd "git config --get user.name > /dev/null || git config --global user.name 'BuildpackTester'"

puts "== Done =="

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
heroku_hatchet-7.3.3 etc/ci_setup.rb
heroku_hatchet-7.3.2 etc/ci_setup.rb
heroku_hatchet-7.3.1 etc/ci_setup.rb
heroku_hatchet-7.3.0 etc/ci_setup.rb
heroku_hatchet-7.2.0 etc/ci_setup.rb
heroku_hatchet-7.1.3 etc/ci_setup.rb
heroku_hatchet-7.1.2 etc/ci_setup.rb
heroku_hatchet-7.1.1 etc/ci_setup.rb
heroku_hatchet-7.1.0 etc/ci_setup.rb
heroku_hatchet-7.0.0 etc/ci_setup.rb
heroku_hatchet-6.0.0 etc/ci_setup.rb