lita-ey-deploy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lita/handlers/ey_deploy.rb +11 -7
- data/lita-ey-deploy.gemspec +1 -1
- data/spec/lita/handlers/ey_deploy_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8a5ff6689d0fbe3ee862f223d7cbb7f64c7fb1
|
4
|
+
data.tar.gz: f4b533d909c7a39027587fd4011435d6676e4b4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31aed7dbe7a9db6ec0c0f74e3948a80835579b7305ff1f2391934010b6925f5e78a21d0b42262f2e75ca70dca5e3cecb5d5ea63a0755a7882a695928d0f4703b
|
7
|
+
data.tar.gz: 0c7d19aefd0940bee10dcd716eb2bd492680cf7fe934923322a8d90c8a79c45bbfd7e83d5072d7838e821f15a7d2232c69406b942e1561a103601ea87756b7ba
|
data/Gemfile.lock
CHANGED
@@ -4,12 +4,12 @@ module Lita
|
|
4
4
|
module Handlers
|
5
5
|
class EyDeploy < Handler
|
6
6
|
|
7
|
-
route(/deploy help/i, :help, command: true, help: {
|
8
|
-
"deploy help" => "Display list of apps and envs available, and groups authorized to deploy on them"
|
7
|
+
route(/ey deploy help/i, :help, command: true, help: {
|
8
|
+
"ey deploy help" => "Display list of apps and envs available, and groups authorized to deploy on them"
|
9
9
|
})
|
10
10
|
|
11
|
-
route(/deploy (\w*) (\w*)( [\w\/\.\-\_]*)?/i, :deploy, command: true, help: {
|
12
|
-
"deploy [app] [env] <branch_name>" => "Deploy specified branch (or default) to env [test, staging, production]"
|
11
|
+
route(/ey deploy (\w*) (\w*)( [\w\/\.\-\_]*)?/i, :deploy, command: true, help: {
|
12
|
+
"ey deploy [app] [env] <branch_name>" => "Deploy specified branch (or default) to env [test, staging, production]"
|
13
13
|
})
|
14
14
|
|
15
15
|
def self.default_config(config)
|
@@ -37,8 +37,8 @@ module Lita
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def deploy(response)
|
40
|
-
app
|
41
|
-
env
|
40
|
+
app = response.matches[0][0].strip
|
41
|
+
env = response.matches[0][1].strip
|
42
42
|
|
43
43
|
response.reply "Deploy what to where?" and return unless valid_app?(app) && valid_env?(app, env)
|
44
44
|
|
@@ -54,7 +54,7 @@ module Lita
|
|
54
54
|
feedback_msg = deploy_result.include?(ey_failure_msg) ? failed_msg : success_msg
|
55
55
|
response.reply feedback_msg
|
56
56
|
else
|
57
|
-
response.reply
|
57
|
+
response.reply access_denied % { group_name: required_group_to_deploy(app, env) }
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -92,6 +92,10 @@ module Lita
|
|
92
92
|
"Deployment failed! Shame on you!"
|
93
93
|
end
|
94
94
|
|
95
|
+
def access_denied
|
96
|
+
"Sorry, you don't have access; you must be at %{group_name} group."
|
97
|
+
end
|
98
|
+
|
95
99
|
def default_branch_for(app, env)
|
96
100
|
config.apps[app]["envs"][env]["default_branch"] || "master"
|
97
101
|
end
|
data/lita-ey-deploy.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita::Handlers::EyDeploy, lita_handler: true do
|
4
|
-
it { routes_command("deploy appname envname develop").to(:deploy) }
|
5
|
-
it { routes_command("deploy appname envname release/1.0").to(:deploy) }
|
4
|
+
it { routes_command("ey deploy appname envname develop").to(:deploy) }
|
5
|
+
it { routes_command("ey deploy appname envname release/1.0").to(:deploy) }
|
6
6
|
end
|