apmate 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apmate/cli.rb +2 -2
- data/lib/apmate/commands/promote.rb +10 -5
- data/lib/apmate/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: 48fb29f3369c91d7f198329c9d56970d16ed86c4
|
4
|
+
data.tar.gz: d1f48cbff536affe35281e9a2569527d66731e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5fbd1465e4179e41a98fad45160543978cc7c7d69120a5ab66c67fa633007ecfe6c61af2f0acfd84ee6837431470897dc5edf287b4375fc770b6fc7d4b2144b
|
7
|
+
data.tar.gz: ad610c19fda43eb310822d021cd39a03a8a930f94fd20901666eafbd254befef79bf2d4dd31a515648fb793f1d327ccb7578c253c8c598116937515240d7959d
|
data/lib/apmate/cli.rb
CHANGED
@@ -106,13 +106,13 @@ class Apmate::CLI
|
|
106
106
|
log_output(output, opts)
|
107
107
|
end
|
108
108
|
|
109
|
-
def self.apmate_promote(env_from, env_to, opts)
|
109
|
+
def self.apmate_promote(env_from, env_to, artifact, opts)
|
110
110
|
Apmate::Logger.logger.debug "Beginning post request."
|
111
111
|
|
112
112
|
uri = URI("#{Apmate::CLI::APMATE_URL}#{ENDPOINTS[:promote_environment]}")
|
113
113
|
Apmate::Logger.logger.debug "uri: #{uri}"
|
114
114
|
|
115
|
-
payload = { environment_from: env_from, environment_to: env_to }
|
115
|
+
payload = { environment_from: env_from, environment_to: env_to, artifact: artifact }
|
116
116
|
Apmate::Logger.logger.debug "payload: #{payload}"
|
117
117
|
|
118
118
|
request = Net::HTTP::Post.new(uri)
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module Apmate::CLI::Command
|
2
2
|
PROMOTE = Cri::Command.define do
|
3
3
|
name 'promote'
|
4
|
-
usage 'promote <environment_from> <environment_to>'
|
5
|
-
summary 'Promotes values from one environment to another environment.'
|
6
|
-
description
|
4
|
+
usage 'promote <environment_from> <environment_to> [artifact]'
|
5
|
+
summary 'Promotes artifact environment values from one environment to another environment.'
|
6
|
+
description %q(
|
7
|
+
Promotes artifact environment values from one environment to another environment.
|
8
|
+
Default behavior promotes all artifact environment values from one environment to another environment.
|
9
|
+
Optionally, you may specify a single artifact to be promoted.
|
10
|
+
)
|
7
11
|
|
8
12
|
flag :h, :help, 'show help for this command' do |value, cmd|
|
9
13
|
puts cmd.help
|
@@ -16,8 +20,9 @@ module Apmate::CLI::Command
|
|
16
20
|
Apmate::Logger.logger.debug "opts: #{opts}"
|
17
21
|
Apmate::Logger.logger.debug "args: #{args}"
|
18
22
|
Apmate::Logger.logger.debug "cmd: #{cmd.to_s}"
|
19
|
-
cmd.run(['-h']) unless args.count == 2
|
20
|
-
|
23
|
+
cmd.run(['-h']) unless (args.count == 2 || args.count == 3)
|
24
|
+
artifact = args[2] || nil
|
25
|
+
Apmate::CLI.apmate_promote(args[0], args[1], artifact, opts)
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
data/lib/apmate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apmate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Baldridge
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|