heroku_hatchet 4.0.5 → 4.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f291b6db177c6d7a5077a8737ea4d059bf4d45fcb488f1d0cdd191afc86b9112
4
- data.tar.gz: dd7437aa06e8b99e5a2ebeb1ee4fdec8fe1469c3fa8500e01376494df62b236c
3
+ metadata.gz: d083ce00b13be495fe3c6e2d19d66a75d4e390aa960d668edc2355f333653bdf
4
+ data.tar.gz: 2c3033b15be7d3a375ff4f8565f19f7b74da9269bd3f0d79a9b94d58db305810
5
5
  SHA512:
6
- metadata.gz: fb6bcc97860fe4f3d6d8ae37ade5ad6d2f8e66c2338730ebf6c1643ee848787aedf4e09e99280ef56b1c8c7c337c0e94ebf6bb6ca439ec6a16ce8645c58b500e
7
- data.tar.gz: ff1ddf35e6c2331d7db2430637967f36272333af3d18d8ea0c3a83a16995cf5389fe27635fef69630c9a30f96c5967afa7cd480478edfdf60c33bb61fee2dbd5
6
+ metadata.gz: 8740ec9d580dbe263b393dea890c243dce35b062f08ade6a20d232ebc3b212cdd53f44f7d83d1c0102d693564fcbd840a4b5bc736fcb61628354a1a0ad7b6d4d
7
+ data.tar.gz: 11a08221b229977aebdb8be2f403ee4b93b45ab48c66ba0a6a8db5b06ed90379cdfdfa139724a948dfba75101f53357a094ff0d453e8105a7b7a56dd5090f225
data/.travis.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.3.1
4
- before_script: bundle exec rake hatchet:setup_travis
4
+ before_script:
5
+ - bundle exec hatchet ci:setup
5
6
  script: bundle exec parallel_test test/hatchet -n 9
6
7
  after_script: bundle exec rake hatchet:teardown_travis
7
8
  env:
@@ -11,11 +12,5 @@ env:
11
12
  - HATCHET_APP_LIMIT=80
12
13
  - secure: KvuEChRTZYrWd1Q4PKt3YM5FkfuCAOtsKgjC4HDGjCYVNee3793XGwAr0e5LiQqrvHDmbJS7ZPelV3ptor2QJTdmZjPhu/tZKPMLQg7wm8vTcrJflkJDqJl6ECxd40zbUgmo+wSPSvx+K3ZGKqLF4D43vvFJaqBUoAVOGdt66c8=
13
14
  - secure: XuJ4XUraWzNlfY9a+6Mh9lVlLuRY988YAaA8LKQOe2KAT5MRqcZzqlKOwDeTWK0tas68bzK7T8RT/L+6/nck0u5VrPHMhkc8QDBSqcle8kFcBxf/64EnCzB40lZoxvcdQ3wm8E41DRwsI7hAHLdVVNXC8f1/wQOAm77nOEvPdvM=
14
- sudo: false
15
+ sudo: true
15
16
  dist: trusty
16
- addons:
17
- apt:
18
- sources:
19
- - heroku
20
- packages:
21
- - heroku-toolbelt
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD
2
2
 
3
+ ## 4.0.6
4
+
5
+ - Setup script `hatchet ci:setup` added (https://github.com/heroku/hatchet/pull/55)
6
+
3
7
  ## 4.0.5
4
8
 
5
9
  - Allow for using locally checked in repo and skip the hatchet.lock dance (https://github.com/heroku/hatchet/pull/53)
data/README.md CHANGED
@@ -332,15 +332,31 @@ I recommend signing up for a new heroku account for running your tests on travis
332
332
  $ travis encrypt HEROKU_API_KEY=<token> --add
333
333
  ```
334
334
 
335
- You'll also need these specified in your travis.yml:
335
+ You'll also need to download the Heroku CLI. Add the executable `etc/ci_setup.sh` to your project, with contents:
336
336
 
337
337
  ```
338
- addons:
339
- apt:
340
- sources:
341
- - heroku
342
- packages:
343
- - heroku-toolbelt
338
+ #!/usr/bin/env bash
339
+
340
+ sudo apt-get -qq update
341
+ sudo apt-get install software-properties-common
342
+ curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://cli-assets.heroku.com/install-ubuntu.sh | sh
343
+ ```
344
+
345
+ Be sure to change the file permissions with `chmod u+x etc/ci_setup.sh` so that the file is executable.
346
+
347
+ To run this and download the Heroku cli, you will need to add this step before your install or script depending on your Travis setup process.
348
+
349
+ ```
350
+ before_script:
351
+ - bash etc/ci_setup.sh
352
+ ```
353
+
354
+ If your Travis tests are containerized, you may need sudo to complete this successfully. In that case, you'll need to add the following:
355
+
356
+ ```
357
+ sudo: required
358
+ before_install:
359
+ - sudo bash etc/ci_setup.sh
344
360
  ```
345
361
 
346
362
  ## Extra App Commands
data/bin/hatchet CHANGED
@@ -17,6 +17,24 @@ require 'date'
17
17
  require 'yaml'
18
18
 
19
19
  class HatchetCLI < Thor
20
+ desc "ci:install_heroku", "installs the `heroku` cli"
21
+ define_method("ci:install_heroku") do
22
+ if `which heroku` && $?.success?
23
+ puts "The `heroku` command is already installed"
24
+ return
25
+ else
26
+ puts "installing `heroku` command"
27
+ end
28
+ script = File.expand_path File.join(__dir__, "../etc/setup_heroku.sh")
29
+ cmd(script)
30
+ end
31
+
32
+ desc "ci:setup", "sets up project to run on a linux CI environment"
33
+ define_method("ci:setup") do
34
+ script = File.expand_path File.join(__dir__, "../etc/ci_setup.rb")
35
+ cmd(script)
36
+ end
37
+
20
38
  desc "install", "installs repos defined in 'hatchet.json'"
21
39
  def install
22
40
  warn_dot_ignore!
@@ -46,12 +64,6 @@ class HatchetCLI < Thor
46
64
  self.lock if missing_commit
47
65
  end
48
66
 
49
- def load_lockfile
50
- return YAML.safe_load(File.read('hatchet.lock')).to_h
51
- rescue Errno::ENOENT => e
52
- raise "No such file found `hatchet.lock` please run `$ bundle exec hatchet lock`"
53
- end
54
-
55
67
  desc "locks to specific git commits", "updates hatchet.lock"
56
68
  def lock
57
69
  lock_hash = {}
@@ -98,6 +110,11 @@ class HatchetCLI < Thor
98
110
  end
99
111
 
100
112
  private
113
+ def load_lockfile
114
+ return YAML.safe_load(File.read('hatchet.lock')).to_h
115
+ rescue Errno::ENOENT => e
116
+ raise "No such file found `hatchet.lock` please run `$ bundle exec hatchet lock`"
117
+ end
101
118
 
102
119
  def bad_repo?(url)
103
120
  `git ls-remote --exit-code -h "#{url}"`
data/etc/ci_setup.rb ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler'
3
+ puts "== Setting Up CI =="
4
+
5
+ netrc_file = "#{ENV['HOME']}/.netrc"
6
+ unless File.exists?(netrc_file)
7
+ File.open(netrc_file, 'w') do |file|
8
+ file.write <<-EOF
9
+ machine git.heroku.com
10
+ login #{ENV.fetch('HEROKU_API_USER')}
11
+ password #{ENV.fetch('HEROKU_API_KEY')}
12
+ EOF
13
+ end
14
+ end
15
+
16
+ [
17
+ "bundle exec hatchet ci:install_heroku",
18
+ "bundle exec hatchet install",
19
+ "if [ `git config --get user.email` ]; then echo 'already set'; else `git config --global user.email '#{ENV.fetch('HEROKU_API_USER')}'`; fi",
20
+ "if [ `git config --get user.name` ]; then echo 'already set'; else `git config --global user.name 'BuildpackTester'` ; fi",
21
+ ].each do |command|
22
+ puts "== Running: #{command}"
23
+ Bundler.with_clean_env do
24
+ result = `#{command}`
25
+ raise "Command failed: #{command.inspect}\nResult: #{result}" unless $?.success?
26
+ end
27
+ end
28
+ puts "== Done =="
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ sudo apt-get -qq update
5
+ sudo apt-get install software-properties-common
6
+ curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://cli-assets.heroku.com/install-ubuntu.sh | sh
data/lib/hatchet/tasks.rb CHANGED
@@ -1,28 +1,8 @@
1
1
  namespace :hatchet do
2
2
  task :setup_ci do
3
- puts "== Setting Up Travis =="
4
- netrc_file = "#{ENV['HOME']}/.netrc"
5
- unless File.exists?(netrc_file)
6
- File.open(netrc_file, 'w') do |file|
7
- file.write <<-EOF
8
- machine git.heroku.com
9
- login #{ENV.fetch('HEROKU_API_USER')}
10
- password #{ENV.fetch('HEROKU_API_KEY')}
11
- EOF
12
- end
13
- end
14
- [
15
- "bundle exec hatchet install",
16
- "if [ `git config --get user.email` ]; then echo 'already set'; else `git config --global user.email '#{ENV.fetch('HEROKU_API_USER')}'`; fi",
17
- "if [ `git config --get user.name` ]; then echo 'already set'; else `git config --global user.name 'BuildpackTester'` ; fi",
18
- ].each do |command|
19
- puts "== Running: #{command}"
20
- Bundler.with_clean_env do
21
- result = `#{command}`
22
- raise "Command failed: #{command.inspect}\nResult: #{result}" unless $?.success?
23
- end
24
- end
25
- puts "== Done =="
3
+ script = File.expand_path = File.join(__dir__, "../../etc/ci_setup.rb")
4
+ out = `#{script}`
5
+ raise "Command #{script.inspect} failed\n#{out}"
26
6
  end
27
7
 
28
8
  task :setup_travis do
@@ -1,3 +1,3 @@
1
1
  module Hatchet
2
- VERSION = "4.0.5"
2
+ VERSION = "4.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: platform-api
@@ -194,6 +194,8 @@ files:
194
194
  - README.md
195
195
  - Rakefile
196
196
  - bin/hatchet
197
+ - etc/ci_setup.rb
198
+ - etc/setup_heroku.sh
197
199
  - hatchet.gemspec
198
200
  - hatchet.json
199
201
  - hatchet.lock