opsworks_rolling_deploy 0.1.5 → 0.2.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: 3680fd9b29410b92c99d1bf0735012a7a76276b3
4
- data.tar.gz: e7a4f2db49853a68d5be65bc608d7620877aafd6
3
+ metadata.gz: 75c26834f819887f4de5f1f29a56a096b71d8627
4
+ data.tar.gz: db0a4705226c700c45b77d765f4bdee3eaa279c4
5
5
  SHA512:
6
- metadata.gz: 0e3f1e0f7d9579b8fa65937b60943bacdd7b75f26b7da78f8d740afb5089b9df644b90baa261510807a1fb194da920d84ff71e900d8a13955fba0b788968bd80
7
- data.tar.gz: 0a3168735afa0146fa226d4e45663071e6f7741dee025c1d2070f816ad48150c1240c755c954c4138e084819372008cfbc1f46af28911671a7f04243d0ff910e
6
+ metadata.gz: 7246125d7f76426e6558072f5108cece84da7c837358f79fe8f3601f63948f0bbc55ee45b5c196135a8ad37d2ef957e7b4f5ee34bce269d4f04fb1d1a5becd15
7
+ data.tar.gz: cd5c4109c81dc743f6161dd8bcd1bc27e2182a0014ded434bbaf82cafb39536c60aa1133bf9c233ae4ff448d7899747b22e88e9ce207529546de379b72c4efa2
@@ -13,6 +13,7 @@ module OpsworksRollingDeploy
13
13
 
14
14
  option "--command", "COMMAND", "the command to be executed by opsworks", default: 'deploy'
15
15
  option "--command-args", "COMMAND_ARGS", "the args to the command to be executed by opsworks as JSON (e.g. '{\"migrate\":[\"true\"]}'", default: '{}'
16
+ option "--custom-json", "CUSTOM_JSON", " A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values (e.g. '{\"key1\": \"value1\", \"key2\": \"value2\",...}'", default: '{}'
16
17
 
17
18
  option "--pretend", :flag, "pretend execution"
18
19
  option "--verbose", :flag, "display aws commands"
@@ -21,7 +22,7 @@ module OpsworksRollingDeploy
21
22
  def execute
22
23
  OpsworksRollingDeploy.set_verbose(verbose?)
23
24
  OpsworksRollingDeploy.set_auth_default(aws_id, aws_secret) if aws_id
24
- Services::DeployService.new.deploy(stack, layer, app, command, JSON.parse(command_args), pretend?, exclude_list)
25
+ Services::DeployService.new.deploy(stack, layer, app, command, JSON.parse(command_args), custom_json, pretend?, exclude_list)
25
26
  end
26
27
  end
27
28
  end
@@ -7,11 +7,11 @@ module OpsworksRollingDeploy
7
7
  module Services
8
8
  class DeployService
9
9
 
10
- include OpsworksRollingDeploy::Clients
10
+ include OpsworksRollingDeploy::Clients
11
11
  include OpsworksRollingDeploy::OutputMethods
12
12
  include OpsworksRollingDeploy::ElbMethods
13
13
 
14
- def deploy(stack_name, layer_name, app_name, command, command_args, pretend = true, exclude_patterns = [])
14
+ def deploy(stack_name, layer_name, app_name, command, command_args, custom_json, pretend = true, exclude_patterns = [])
15
15
  @pretend = pretend
16
16
  stack = get_stack(stack_name) || fail("Stack not found #{stack_name}'")
17
17
  app = get_app(stack, app_name) || fail("App not found #{app_name}'")
@@ -22,7 +22,7 @@ module OpsworksRollingDeploy
22
22
  instances.each_with_index do |instance, idx|
23
23
  pools = remove_from_pools(stack, app, instance)
24
24
  comment = [ (layer ? layer.name : 'Full'), "#{idx+1}/#{instances.size}" ].compact.join(' ')
25
- create_deployment(stack, app, instance, command, command_args, comment)
25
+ create_deployment(stack, app, instance, command, command_args, custom_json, comment)
26
26
  add_into_pools(stack, instance, pools)
27
27
  end
28
28
  end
@@ -60,7 +60,7 @@ module OpsworksRollingDeploy
60
60
  end
61
61
 
62
62
  def instances_to_deploy(stack, layer, _app, exclude_patterns)
63
- # XXX I did not figure out how to filter instances running the app
63
+ # XXX I did not figure out how to filter instances running the app
64
64
 
65
65
  ops_client.describe_instances(stack_id: stack.stack_id).instances.select do |instance|
66
66
  if layer && !instance.layer_ids.include?(layer.layer_id)
@@ -81,17 +81,17 @@ module OpsworksRollingDeploy
81
81
  end
82
82
  end
83
83
 
84
- def create_deployment(stack, app, instance, command, command_args, comment)
84
+ def create_deployment(stack, app, instance, command, command_args, custom_json, comment)
85
85
  info 'Instance', instance.hostname, instance.ec2_instance_id, "Deploying", comment
86
86
  return if pretend?
87
87
  deployment = ops_client.create_deployment({
88
88
  stack_id: stack.stack_id,
89
- command: {name: command, args: command_args || {}},
90
- comment: comment,
91
- custom_json: '{}',
89
+ command: {name: command, args: command_args || {}},
90
+ comment: comment,
91
+ custom_json: custom_json,
92
92
  app_id: app.app_id,
93
- instance_ids: [instance.instance_id],
94
- })
93
+ instance_ids: [instance.instance_id],
94
+ })
95
95
  wait_until_deployed(deployment.deployment_id)
96
96
  end
97
97
 
@@ -108,7 +108,7 @@ module OpsworksRollingDeploy
108
108
  status = ops_client.describe_deployments(deployment_ids: [deployment_id]).deployments.first.status
109
109
 
110
110
  if status != "running"
111
- puts status
111
+ puts status
112
112
  fail "Deploy status #{status}}" if status != 'successful'
113
113
  return
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module OpsworksRollingDeploy
2
- VERSION = '0.1.5'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks_rolling_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romeu Henrique Capparelli Fonseca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aws-sdk
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: colorize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: byebug
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: Manage a rolling deploy over opsworks stack instances, removing each
@@ -131,9 +131,9 @@ executables:
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - .gitignore
135
- - .rspec
136
- - .travis.yml
134
+ - ".gitignore"
135
+ - ".rspec"
136
+ - ".travis.yml"
137
137
  - CODE_OF_CONDUCT.md
138
138
  - Gemfile
139
139
  - LICENSE.txt
@@ -162,17 +162,17 @@ require_paths:
162
162
  - lib
163
163
  required_ruby_version: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - '>='
165
+ - - ">="
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - '>='
170
+ - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.4.6
175
+ rubygems_version: 2.4.5.1
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Utilities for opsworks rolling deploy