kapost_deploy 0.3.0 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec74484d566600db2d970d3cd10cdbc0d3bdf18a
|
4
|
+
data.tar.gz: 9bea6eee09788817bf41aa9fe3b61896bc1ebd17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7957a7ca81654118b1749d8c54baf5ba5cbe71ffcce966ec3b4c6e94f4d5a588d30394efe6a12e1714135ef73784830fdc70675e7498e593bd8235e9bfc10e5a
|
7
|
+
data.tar.gz: 5e12d896124256040f0880a90064d53425cf0d2c2cca7ebd329c4a748db67961e55b9199044763b05fcf4dc3de5a3b43ef9a16124b2061488461b88a54bb71a3
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module KapostDeploy
|
4
|
+
module Plugins
|
5
|
+
# Validates runtime configuration
|
6
|
+
class ValidateBeforePromote
|
7
|
+
def initialize(config)
|
8
|
+
@config = config
|
9
|
+
end
|
10
|
+
|
11
|
+
def before
|
12
|
+
fail <<~MSG unless @config.heroku_api_token
|
13
|
+
No 'heroku_api_token' configured. Set config.heroku_api_token to your
|
14
|
+
API secret token (use `heroku auth:token` to get it).
|
15
|
+
MSG
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/kapost_deploy/task.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "rake"
|
4
4
|
require "rake/tasklib"
|
5
5
|
require "kapost_deploy/heroku/app_promoter"
|
6
|
+
require "kapost_deploy/plugins/validate_before_promote"
|
6
7
|
|
7
8
|
module KapostDeploy
|
8
9
|
##
|
@@ -41,6 +42,7 @@ module KapostDeploy
|
|
41
42
|
|
42
43
|
instance.validate
|
43
44
|
instance.define
|
45
|
+
instance.add_plugin(KapostDeploy::Plugins::ValidateBeforePromote)
|
44
46
|
instance
|
45
47
|
end
|
46
48
|
|
@@ -59,7 +61,7 @@ module KapostDeploy
|
|
59
61
|
def defaults
|
60
62
|
@name = :promote
|
61
63
|
@pipeline = nil
|
62
|
-
@heroku_api_token =
|
64
|
+
@heroku_api_token = ENV["HEROKU_DEPLOY_API_TOKEN"]
|
63
65
|
@app = nil
|
64
66
|
@to = nil
|
65
67
|
@before = -> {}
|
@@ -69,8 +71,6 @@ module KapostDeploy
|
|
69
71
|
end
|
70
72
|
|
71
73
|
def validate
|
72
|
-
fail "No 'heroku_api_token' configured."\
|
73
|
-
"Set config.heroku_api_token to your API secret token" if heroku_api_token.nil?
|
74
74
|
fail "No 'pipeline' configured. Set config.pipeline to the name of your pipeline" if pipeline.nil?
|
75
75
|
fail "No 'app' configured. Set config.app to the application to be promoted" if app.nil?
|
76
76
|
fail "No 'to' configured. Set config.to to the downstream application to be promoted to" if to.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapost_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Croft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- lib/kapost_deploy/plugins/notify_honeybadger_after_promote.rb
|
267
267
|
- lib/kapost_deploy/plugins/slack_after_promote.rb
|
268
268
|
- lib/kapost_deploy/plugins/slack_github_diff.rb
|
269
|
+
- lib/kapost_deploy/plugins/validate_before_promote.rb
|
269
270
|
- lib/kapost_deploy/slack/notifier.rb
|
270
271
|
- lib/kapost_deploy/task.rb
|
271
272
|
- lib/tasks/console.rake
|