nomade 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nomade/deployer.rb +12 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57489957cb990a28ffbd23c94b9d655ec517a43cd4e8f2101d7e7cddb17bfcf7
4
- data.tar.gz: 305ac1c39551b472ad16c3553fb4f5965b4eebfb08ea51b2557ff26cd8153af8
3
+ metadata.gz: e55097372de361a10d732fb15534044a7f61e2d7d3f99bcdbc32d247aa38fe15
4
+ data.tar.gz: 3eb026188607bb0dd4814f996d7a5290733832cd669bdc73942a8c3c3f825115
5
5
  SHA512:
6
- metadata.gz: 17a0f1d1cb4e15de6ec6fedea6f5d0d4675e72628596f0fba951c3143699ac79eaeed36138d7b6d1f895f2689b3f187c839e67c782a6c201f7ce57ba34dfbd53
7
- data.tar.gz: 5ca41d3f6f53e5e670512575b256ef06688d3ce54303303b0075ab2ba9e1088fbe0f3fe856fe3e2568d958e6938323e0333195ee7eab54de7df4557d37b96a99
6
+ metadata.gz: e048c5df4f909bfdb575c12740a12b7e2985a74782eb6b54689f203356684754ea52f7b8f2eebabe0f44de24d1f7bc22815c6a86b19fdeddbbdfb9fd943ab1e9
7
+ data.tar.gz: 1bbd0a9dcf2417651dfab2a64c41c3ffd39a80795d55f92dcc155f10d7c6e5b03f01a6982d11515eb79a54098ca2f7ad387098e3fa83400b6dffad9e7b5600ef
@@ -15,6 +15,12 @@ module Nomade
15
15
  Nomade::Hooks::DEPLOY_FINISHED => [],
16
16
  Nomade::Hooks::DEPLOY_FAILED => [],
17
17
  }
18
+ add_hook(Nomade::Hooks::DEPLOY_FAILED, lambda {|hook_type, nomad_job, messages|
19
+ @logger.error "Failing deploy:"
20
+ messages.each do |message|
21
+ @logger.error "- #{message}"
22
+ end
23
+ })
18
24
 
19
25
  self
20
26
  end
@@ -45,22 +51,21 @@ module Nomade
45
51
  _deploy
46
52
  run_hooks(Nomade::Hooks::DEPLOY_FINISHED, @nomad_job, nil)
47
53
  rescue Nomade::NoModificationsError => e
48
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "No modifications to make, exiting!"])
49
- exit(0)
54
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "No modifications to make, exiting!"].compact.uniq)
50
55
  rescue Nomade::GeneralError => e
51
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "GeneralError hit, exiting!"])
56
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "GeneralError hit, exiting!"].compact.uniq)
52
57
  exit(1)
53
58
  rescue Nomade::AllocationFailedError => e
54
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "Allocation failed with errors, exiting!"])
59
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "Allocation failed with errors, exiting!"].compact.uniq)
55
60
  exit(3)
56
61
  rescue Nomade::UnsupportedDeploymentMode => e
57
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "Deployment failed with errors, exiting!"])
62
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "Deployment failed with errors, exiting!"].compact.uniq)
58
63
  exit(4)
59
64
  rescue Nomade::FailedTaskGroupPlan => e
60
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "Couldn't plan correctly, exiting!"])
65
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "Couldn't plan correctly, exiting!"].compact.uniq)
61
66
  exit(5)
62
67
  rescue Nomade::DeploymentFailedError => e
63
- run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.message, "Couldn't deploy succesfully, exiting!"])
68
+ run_hooks(Nomade::Hooks::DEPLOY_FAILED, @nomad_job, [e.class.to_s, e.message, "Couldn't deploy succesfully, exiting!"].compact.uniq)
64
69
  exit(6)
65
70
  end
66
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nomade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Grubbe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2020-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yell