panteras_api 0.0.23 → 0.0.24

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: a54ac9fcba5c96bb7689355aa598b6ac95dd6ab1
4
- data.tar.gz: 931caa7b4e480aa8fa10f44359dd5d595a3ad939
3
+ metadata.gz: eeb5ebc31839e45b1d91d08a03a821644a6603da
4
+ data.tar.gz: 2e5adbea11f05e82af189b12b46598e58b6647fd
5
5
  SHA512:
6
- metadata.gz: 04e62cdc5f8ad188c5a146ab4649a87345da60b512d1620394bdb8f2fa027251984125f93804ccce4680cd5594da374e3c3a7f371f4dfd66e673b056fd1e9f64
7
- data.tar.gz: 87fcb79ae69b7d03e25b429388a5a4fa0f646fed35a2dd295acb613f960a0b9ef3b90ced8235c241b6aa4bbf6175ee290835f41575888f8e36d1fa1b65f2658c
6
+ metadata.gz: 27e0c7f2826ee4eec93a4a082df45bb7d81d8b4a2f74303a98896c845a0a64173a4d568cfdf12a491b54b4a3141d5de022cd963498be6fa0e61e2a8459203722
7
+ data.tar.gz: 223f6a8d7a341ee53364e6cd531ffa5086a18998d155670a3bc1b76c29210f7bdfa338ab94edbf8ad2c946e96a48a91226b4b70d5b654790c107425f9958f582
@@ -94,24 +94,25 @@ Timeout::timeout(timeout_in_seconds) do
94
94
  #puts mesos.task_ids('chronos-config').sort
95
95
  end
96
96
 
97
-
98
- ## MESOS LOCAL
99
- puts "#" * 75 if config[:debug]
100
- puts "* Mesos tasks ids for tasks running on #{my_fqdn}:" if config[:debug]
101
- mesos_tasks = mesos.my_tasks_ids(my_fqdn, 'marathon').flatten
102
- mesos_tasks = mesos_tasks + mesos.my_tasks_ids(my_fqdn, 'chronos-config').flatten
103
- puts mesos_tasks.sort if config[:debug]
104
- good_news << "#{mesos_tasks.size} mesos tasks running." if ! mesos_tasks.empty?
105
-
106
-
107
97
  ### MARATHON
108
98
  puts "#" * 75 if config[:debug]
109
99
  puts "* Marathon tasks on #{my_fqdn}:" if config[:debug]
110
100
  marathon = MarathonEndpoint.new(mesos.master_hostname, 8080, config[:marathon_username], config[:marathon_password])
101
+ if ! marathon.deployments.empty?
102
+ puts "Deployment in progess"
103
+ exit 0
104
+ end
111
105
  marathon_tasks = marathon.my_task_ids(my_fqdn, 'marathon')
112
106
  puts marathon_tasks.sort if config[:debug]
113
107
  good_news << "#{marathon_tasks.size} marathon tasks running."
114
108
 
109
+ ## MESOS LOCAL
110
+ puts "#" * 75 if config[:debug]
111
+ puts "* Mesos tasks ids for tasks running on #{my_fqdn}:" if config[:debug]
112
+ mesos_tasks = mesos.my_tasks_ids(my_fqdn, 'marathon').flatten
113
+ mesos_tasks = mesos_tasks + mesos.my_tasks_ids(my_fqdn, 'chronos-config').flatten
114
+ puts mesos_tasks.sort if config[:debug]
115
+ good_news << "#{mesos_tasks.size} mesos tasks running." if ! mesos_tasks.empty?
115
116
 
116
117
  ### CHRONOS
117
118
  puts "#" * 75 if config[:debug]
@@ -17,7 +17,11 @@ class MarathonEndpoint
17
17
  def all_apps
18
18
  to_j(get_response_with_redirect(@host, '/v2/apps/', @port, @user, @passwd))[:apps]
19
19
  end
20
-
20
+
21
+ def deployments
22
+ to_j(get_response_with_redirect(@host, '/v2/deployments', @port, @user, @passwd))
23
+ end
24
+
21
25
  def app_names
22
26
  raise StandardError, "Empty response from marathon", caller if all_apps.nil?
23
27
  all_apps.collect { |a| a[:id][1..-1] }
@@ -1,3 +1,3 @@
1
1
  module PanterasApi
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panteras_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Colby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler