herkko 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -2
- data/lib/herkko/runner.rb +11 -7
- data/lib/herkko/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ad6707152df95d3628eb7ba4a27fbe51e7dc596
|
4
|
+
data.tar.gz: fb7b02717ca7de3d3c60da871754e0ab3a01e161
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a6ecec9219fc2f4acc5302a765cb2fece32190e0b649967163c1ee95c1b908edd533eb6e850a04113edd75194792aacc3d5f28564ab652a73ae6281e97479c
|
7
|
+
data.tar.gz: 27d0141de48b61f0b01408de3e1573d744ebbd257ae9b5c1ad4d889488373f8a4829b8e1a282c11b412f131885dadb479ad91fdc2f8d75eaf4aed5d9a5d7f2b1
|
data/README.md
CHANGED
@@ -8,11 +8,18 @@ Install the gem with:
|
|
8
8
|
|
9
9
|
$ gem install herkko
|
10
10
|
|
11
|
-
## Usage
|
11
|
+
## Usage & setup
|
12
|
+
|
13
|
+
Herkko requires Travis gem to check the CI status:
|
14
|
+
|
15
|
+
$ gem install travis
|
12
16
|
|
13
17
|
Herkko uses the git remote names to identify the applications. Usually you have production and staging.
|
14
18
|
|
15
|
-
|
19
|
+
To set up Heroku remotes:
|
20
|
+
|
21
|
+
$ git remote add production https://git.heroku.com/production-app-name-at-heroku.git
|
22
|
+
$ git remote add staging https://git.heroku.com/staging-app-name-at-heroku.git
|
16
23
|
|
17
24
|
To deploy current branch to production:
|
18
25
|
|
@@ -22,6 +29,8 @@ Running the command will check Travis CI, deploy if the build is green and runs
|
|
22
29
|
|
23
30
|
## Commands
|
24
31
|
|
32
|
+
All commands are run `herkko [environment] [command]` like `herkko staging console`
|
33
|
+
|
25
34
|
### deploy
|
26
35
|
|
27
36
|
You can add a file in `doc/after_deployment.{md, txt, rdoc, whatever}` and it
|
@@ -32,10 +41,26 @@ checklist like:
|
|
32
41
|
* Stay alert for a while for exceptions.
|
33
42
|
* Inform the client if it is needed (Basecamp, email, SMS...)
|
34
43
|
|
44
|
+
To put application to maintenance mode while the deployment is running, use flag `--maintenance-mode`.
|
45
|
+
|
46
|
+
CI check can be skipped with `--skip-ci-check`.
|
47
|
+
|
35
48
|
### console
|
36
49
|
|
37
50
|
Open rails console for the application.
|
38
51
|
|
52
|
+
### changelog
|
53
|
+
|
54
|
+
List of commits to be deployed. Compares the current deployed version and the current local version to see what's been committed.
|
55
|
+
|
56
|
+
### seed
|
57
|
+
|
58
|
+
Runs seeds.rb.
|
59
|
+
|
60
|
+
### migrate
|
61
|
+
|
62
|
+
Only runs migrations. This is done automatically on deploy if needed.
|
63
|
+
|
39
64
|
## Contributing
|
40
65
|
|
41
66
|
1. Fork it ( https://github.com/vesan/herkko/fork )
|
data/lib/herkko/runner.rb
CHANGED
@@ -45,7 +45,7 @@ module Herkko
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def deploy
|
48
|
-
Herkko.info "Doing deployment to #{environment}..."
|
48
|
+
Herkko.info "Doing #{forced? ? "forced(!) " : ""}deployment to #{environment}..."
|
49
49
|
fetch_currently_deployed_version
|
50
50
|
|
51
51
|
Herkko.info("Deploying changes:")
|
@@ -99,10 +99,14 @@ module Herkko
|
|
99
99
|
}
|
100
100
|
end
|
101
101
|
|
102
|
+
def forced?
|
103
|
+
arguments && arguments.include?("--force")
|
104
|
+
end
|
105
|
+
|
102
106
|
def push_new_code
|
103
|
-
Herkko.info "Pushing
|
107
|
+
Herkko.info "Pushing commit #{to_be_deployed_sha} from branch #{current_branch} to Heroku..."
|
104
108
|
puts
|
105
|
-
Herkko.run_with_output("git", "push", environment, "master")
|
109
|
+
Herkko.run_with_output("git", "push", environment, "#{to_be_deployed_sha}:master", forced? ? "--force" : nil)
|
106
110
|
puts
|
107
111
|
end
|
108
112
|
|
@@ -156,10 +160,6 @@ module Herkko
|
|
156
160
|
arguments && arguments.include?("--maintenance-mode")
|
157
161
|
end
|
158
162
|
|
159
|
-
def current_branch
|
160
|
-
Herkko.run("git", "rev-parse", "--abbrev-ref", "HEAD")[0].strip
|
161
|
-
end
|
162
|
-
|
163
163
|
def migrations_needed?
|
164
164
|
file_changed?("db/migrate")
|
165
165
|
end
|
@@ -168,6 +168,10 @@ module Herkko
|
|
168
168
|
file_changed?("db/seeds.rb")
|
169
169
|
end
|
170
170
|
|
171
|
+
def current_branch
|
172
|
+
Herkko.run("git", "rev-parse", "--abbrev-ref", "HEAD")[0].strip
|
173
|
+
end
|
174
|
+
|
171
175
|
def currently_deployed_to(environment)
|
172
176
|
Herkko.run("git", "rev-parse", "#{environment}/master")[0].strip
|
173
177
|
end
|
data/lib/herkko/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: herkko
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vesa Vänskä
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|