marathon_deploy 0.1.55 → 0.1.56

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b0289636d1856134a9bebb316c059306007928f
4
- data.tar.gz: 1baee536c47b2de9ac27c732e6ca4ff2eea79d3e
3
+ metadata.gz: 1e182d4388289931924735ff4831f9499932fc41
4
+ data.tar.gz: 4e83a35c61fdb0d2a60be351cb01f925986636f1
5
5
  SHA512:
6
- metadata.gz: 2882595a7a1053517a0b1e3316050e0fc4b11d5a066bf38f835b4803a07a45300a580e2edc1282f99a506a40125ef5b0c7c9f0a87691f6dedd28e53832bc3b05
7
- data.tar.gz: fd9359ac1b8251e74c6447ec9fcef5646a62ee92047c7abc5271282deeb0659a0dc881610c5ff4a901b9512497cf4831868c5d58210361e9e067f576b095a5da
6
+ metadata.gz: 679cf7e493b39e2da0db382b669dcd4eb47ceb03c6e27f27cf29f23e22cdc8a323d26efe7f34befa545bb96797e1eb4b4ebd94a9d8a4974af5a0982288447530
7
+ data.tar.gz: f508e2e650c988dd4bd9ca2bfd86376191e926ef713542b5dc1f9e96c6bd6a4998e44a481630503e850de62f85fba708a93d4566f8d5e296e7f6c2402bc76f97
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
- ruby:
3
- - 1.9.3
4
- before_install:
5
- - gem uninstall bundler -x
6
- - gem install bundler --version 1.11.2
2
+ rvm:
3
+ - 2.3.1
4
+ #before_install:
5
+ # - gem uninstall bundler -x
6
+ # - gem install bundler --version 1.11.2
7
7
  deploy:
8
8
  provider: rubygems
9
9
  api_key:
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby "1.9.3"
3
+ ruby "2.3.1"
4
4
 
5
5
  # Specify your gem's dependencies in marathon_deploy.gemspec
6
6
  gemspec
data/README.md CHANGED
@@ -49,6 +49,7 @@ Usage: bin/marathon_deploy [options]
49
49
  -f, --force Force deployment when sending same deploy JSON to Marathon
50
50
  -n, --noop No action. Just display what would be performed.
51
51
  -i, --ignore-preproduction-defaults Ignores the preproduction defaults for cpu, memory, and instance limits
52
+ -R, --retry Will retry the deployment if the initial one fails
52
53
  -e, --environment ENVIRONMENT Default: PREPRODUC
53
54
  ```
54
55
 
@@ -23,6 +23,7 @@ options[:force] = MarathonDeploy::MarathonDefaults::DEFAULT_FORCE_DEPLOY
23
23
  options[:noop] = MarathonDeploy::MarathonDefaults::DEFAULT_NOOP
24
24
  options[:remove_elements] = MarathonDeploy::MarathonDefaults::DEFAULT_REMOVE_ELEMENTS
25
25
  options[:ignore_preproduction_defaults] = MarathonDeploy::MarathonDefaults::DEFAULT_IGNORE_PREPRODUCTION_DEFAULTS
26
+ options[:retry] = MarathonDeploy::MarathonDefaults::DEFAULT_RETRY
26
27
  options[:marathon_username] = nil
27
28
  options[:marathon_password] = nil
28
29
 
@@ -51,6 +52,10 @@ OptionParser.new do |opts|
51
52
  options[:deployment_timeout] = l
52
53
  end
53
54
 
55
+ opts.on("-R", "--retry", "Default: #{options[:retry]}") do |i|
56
+ options[:retry] = true
57
+ end
58
+
54
59
  opts.on("-d", "--debug", "Run in debug mode") do |d|
55
60
  options[:debug] = Logger::DEBUG
56
61
  end
@@ -184,10 +189,15 @@ marathon_endpoints.each do |marathon_url|
184
189
  client = MarathonDeploy::MarathonClient.new(marathon_url, options)
185
190
  client.application = application
186
191
  client.deploy
187
- rescue MarathonDeploy::Error::MissingMarathonAttributesError,MarathonDeploy::Error::BadURLError, Timeout::Error => e
192
+ rescue MarathonDeploy::Error::MissingMarathonAttributesError,MarathonDeploy::Error::BadURLError,Timeout::Error => e
188
193
  $LOG.error(e.message)
189
194
  exit!
190
195
  rescue MarathonDeploy::Error::DeploymentError => e
196
+ $LOG.error("Deployment of #{application} failed => #{e}")
197
+ if options[:retry]
198
+ $LOG.info("Deployment failed, retrying since retry is enabled")
199
+ client.deploy
200
+ end
191
201
  $LOG.error("Deployment of #{application} failed => #{e}")
192
202
  exit!
193
203
  rescue SocketError, MarathonDeploy::Error::MarathonError => e
@@ -26,6 +26,7 @@ module MarathonDeploy
26
26
  DEFAULT_FORCE_DEPLOY = false
27
27
  DEFAULT_NOOP = false
28
28
  DEFAULT_IGNORE_PREPRODUCTION_DEFAULTS = false
29
+ DEFAULT_RETRY = false
29
30
  DEFAULT_REMOVE_ELEMENTS = []
30
31
  DEFAULT_KEEP_ELEMENTS = [':id']
31
32
  ENVIRONMENT_VARIABLE_PREFIX = 'MARATHON_DEPLOY_'
@@ -1,3 +1,3 @@
1
1
  module MarathonDeploy
2
- VERSION = "0.1.55"
2
+ VERSION = "0.1.56"
3
3
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "json"
27
27
  spec.add_dependency "deep_merge", '~> 1.0', '>= 1.0.1'
28
28
 
29
- spec.add_development_dependency "bundler", "~> 1.11.2"
29
+ spec.add_development_dependency "bundler", "~> 1.16.0"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
31
  spec.add_development_dependency "minitest", "~> 5.7"
32
32
  spec.add_development_dependency "yard"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marathon_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.55
4
+ version: 0.1.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Colby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - ~>
66
66
  - !ruby/object:Gem::Version
67
- version: 1.11.2
67
+ version: 1.16.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ~>
73
73
  - !ruby/object:Gem::Version
74
- version: 1.11.2
74
+ version: 1.16.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.0.14
241
+ rubygems_version: 2.0.14.1
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Mesos/Marathon deployment tool.