Sha256: 436fb0f23cb1274dba7b9ff4b8b30472811e9be5a94deff1adfb0af5e5403017

Contents?: true

Size: 1010 Bytes

Versions: 12

Compression:

Stored size: 1010 Bytes

Contents

namespace :hatchet do
  task :setup_ci do
    puts "== Setting Up Travis =="
    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')}
EOF
      end
    end
    [
     "bundle exec hatchet install",
     "if [ `git config --get user.email` ]; then echo 'already set'; else `git config --global user.email '#{ENV.fetch('HEROKU_API_USER')}'`; fi",
     "if [ `git config --get user.name` ];  then echo 'already set'; else `git config --global user.name  'BuildpackTester'`      ; fi",
    ].each do |command|
      puts "== Running: #{command}"
      Bundler.with_clean_env do
        result = `#{command}`
        raise "Command failed: #{command.inspect}\nResult: #{result}" unless $?.success?
      end
    end
    puts "== Done =="
  end

  task :setup_travis do
    Rake::Task["hatchet:setup_ci"].invoke
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
heroku_hatchet-4.0.5 lib/hatchet/tasks.rb
heroku_hatchet-4.0.4 lib/hatchet/tasks.rb
heroku_hatchet-4.0.3 lib/hatchet/tasks.rb
heroku_hatchet-4.0.2 lib/hatchet/tasks.rb
heroku_hatchet-4.0.1 lib/hatchet/tasks.rb
heroku_hatchet-4.0.0 lib/hatchet/tasks.rb
heroku_hatchet-3.1.1 lib/hatchet/tasks.rb
heroku_hatchet-3.1.0 lib/hatchet/tasks.rb
heroku_hatchet-3.0.6 lib/hatchet/tasks.rb
heroku_hatchet-3.0.5 lib/hatchet/tasks.rb
heroku_hatchet-3.0.4 lib/hatchet/tasks.rb
heroku_hatchet-3.0.3 lib/hatchet/tasks.rb