-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from heroku/schneems/easy-setup
Move setup script into it's own command.
- Loading branch information
Showing
5 changed files
with
57 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
require 'bundler' | ||
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')} | ||
EOF | ||
end | ||
end | ||
|
||
[ | ||
"bundle exec hatchet ci:install_heroku", | ||
"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 ==" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
sudo apt-get -qq update | ||
sudo apt-get install software-properties-common | ||
curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://cli-assets.heroku.com/install-ubuntu.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters