herkko 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 1e4bb15ce4a18b2b70474f690c32c80b1cb87c65
4
- data.tar.gz: bd4c100155073319adb3ad66cccbda4c26b783b1
3
+ metadata.gz: dbf0c54b591fdc987afc4f25d41056e58b52cfa3
4
+ data.tar.gz: 1c9186aa1f643505e66a9f1214cb42e4985d7517
5
5
  SHA512:
6
- metadata.gz: 73e74592872f6fb34f67d45a66dce243f589409939754444c84872e475dfa1318c21f3a97eff5412fedfff216e3ad004b70a35991c31f906cca076ddcbc1f0fe
7
- data.tar.gz: cb20b53b32ed8db219aee0cf7768f9035c095c7d5e34231cb93f8997aa0fcdf39be18ce048df97b5c44256e67fca4bc6d7e223d21b5d9842b992e724ad2337e8
6
+ metadata.gz: ba4ba588eefdf5b39271c610d48a2c282747c8f15c6f47e4f649b92cb192764a55a7ab79783e4d228e5d9e8ab41dc0db871ceb5ab094e96d4ef50f98d180bb47
7
+ data.tar.gz: bb2c0389b83532c3361789eff1e27958c9a8e875ebae4db6cff8818e139d84634cf06669724fafaf54c0aeec7aae322719e7a1a1a1506d0466688e335281b36a
data/lib/herkko/runner.rb CHANGED
@@ -15,7 +15,11 @@ module Herkko
15
15
 
16
16
  def run
17
17
  if ["version", "--version"].include?(environment)
18
- return version
18
+ return print_version
19
+ end
20
+
21
+ if ["help", "--help"].include?(environment)
22
+ return print_usage
19
23
  end
20
24
 
21
25
  return print_usage if environment.nil? || command.nil?
@@ -27,15 +31,34 @@ module Herkko
27
31
  end
28
32
  end
29
33
 
30
- def version
34
+ def print_version
31
35
  Herkko.puts "Herkko #{Herkko::VERSION}"
32
36
  end
33
37
 
34
38
  def print_usage
35
39
  Herkko.puts <<END
36
- Herkko
40
+ # Herkko
41
+
42
+ Run `herkko [remote name] [command]` for example `herkko production deploy`.
43
+
44
+ There are special commands like `deploy` is a special command that does extra checks. Other commands
45
+ are just proxied to the heroku CLI tool (for example `herkko production logs`).
46
+
47
+ ## Naming remotes
48
+
49
+ It's recommended to name your remotes for example production & staging. Then you can always just type `herkko production deploy` to release a new version.
50
+
51
+ ## Commands
52
+
53
+ console | Opens Rails console
54
+ deploy | Deploys new version
55
+ seed | Runs seeds.rb
56
+ migrate | Run migrations and restarts the app
57
+
58
+ ### deploy
59
+
60
+ --skip-ci-check - Skips the Travis CI build status check
37
61
 
38
- Run `herkko [environment] [command]` for example `herkko production deploy`.
39
62
  END
40
63
  end
41
64
 
@@ -78,11 +101,6 @@ END
78
101
  Herkko.run_with_output "heroku run rake db:seed -r #{environment}"
79
102
  end
80
103
 
81
- def check_ci
82
- Herkko.info "Checking CI..."
83
- Herkko::Travis.status_for(current_branch)
84
- end
85
-
86
104
  def migrate
87
105
  Herkko.info "Migrating database..."
88
106
  Herkko.run_with_output %{
@@ -100,6 +118,11 @@ END
100
118
 
101
119
  private
102
120
 
121
+ def check_ci
122
+ Herkko.info "Checking CI..."
123
+ Herkko::Travis.status_for(current_branch)
124
+ end
125
+
103
126
  def deploy!
104
127
  run_migrations = migrations_needed?
105
128
  push_new_code
data/lib/herkko/travis.rb CHANGED
@@ -22,7 +22,7 @@ module Herkko
22
22
  private
23
23
 
24
24
  def self.fetch_status(branch)
25
- Herkko.run("travis", "history", "-l", "1", "-b", branch)
25
+ Herkko.run("travis", "history", "--skip-version-check", "-l", "1", "-b", branch)
26
26
  end
27
27
  end
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module Herkko
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herkko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vesa Vänskä