heroku_rails_deploy 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/heroku_rails_deploy/deployer.rb +8 -5
- data/lib/heroku_rails_deploy/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: bc3e6f646b7ef7c41f69b59029b2c1fdee7cff1c
|
4
|
+
data.tar.gz: 2f6e0b9b32170b947a47980f1d671118fd5ef3cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dbf1c200f8e9647d867a5ece168149fa2c1999d23e42842262a1f1ef76b7ab57b1f4419af1ea49d5a0724cdf213d1aafe834dc3ed8515a7a9a801f6504f023f
|
7
|
+
data.tar.gz: a6c5700adc7fd2b6e1b20567896a7dfaca655440978addd2bdada60aa0999c254d42fd1ea5416711a17b05cf56da213d305b1469e3e169ba2d5ecd10310196ff
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'optparse'
|
2
|
+
require 'shellwords'
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
module HerokuRailsDeploy
|
@@ -47,7 +48,7 @@ module HerokuRailsDeploy
|
|
47
48
|
"Must be in #{app_registry.keys.join(', ')}")
|
48
49
|
end
|
49
50
|
|
50
|
-
raise 'Only master, release or hotfix branches can be deployed to production' if options.environment == 'production' && !production_branch?
|
51
|
+
raise 'Only master, release or hotfix branches can be deployed to production' if options.environment == 'production' && !production_branch?(options.revision)
|
51
52
|
|
52
53
|
puts "Pushing code to Heroku app #{app_name} for environment #{options.environment}"
|
53
54
|
push_code(app_name, options.revision)
|
@@ -63,16 +64,18 @@ module HerokuRailsDeploy
|
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
66
|
-
def production_branch?
|
67
|
-
git_branch_name.match(PRODUCTION_BRANCH_REGEX)
|
67
|
+
def production_branch?(revision)
|
68
|
+
git_branch_name(revision).match(PRODUCTION_BRANCH_REGEX)
|
68
69
|
end
|
69
70
|
|
70
71
|
def push_code(app_name, revision)
|
71
72
|
run_command!("git push --force git@heroku.com:#{app_name}.git #{revision}:master")
|
72
73
|
end
|
73
74
|
|
74
|
-
def git_branch_name
|
75
|
-
|
75
|
+
def git_branch_name(revision)
|
76
|
+
branch_name = `git rev-parse --abbrev-ref #{Shellwords.escape(revision)}`.strip
|
77
|
+
raise "Unable to get branch for #{revision}" unless $?.to_i == 0
|
78
|
+
branch_name
|
76
79
|
end
|
77
80
|
|
78
81
|
def run_migrations(app_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_rails_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|