rat_deployer 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/rat_deployer/cli.rb +5 -4
- data/lib/rat_deployer/config.rb +7 -28
- data/lib/rat_deployer/notifier.rb +8 -8
- data/lib/rat_deployer/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: 9434ec7c84475197340d979cd8cd297eeed41802
|
4
|
+
data.tar.gz: 9168a21f79a69cb597c61b703b3ec1ede5d65026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f62a6495fe7e3fa55c7a958c1bcaf5b39c2355cb1278236abdf51ee0bcd71e4306b572b5f5ef1ad20f1714dbdf448ed2273e11b9673610f843eaac4c737cbb3
|
7
|
+
data.tar.gz: 9b1870d24db2c922e4556d260f129363e3a5385a0f4ca8b7706a11b0b9cf18e14217d7a6f31ef0262f994347168141a342b2dfc032bf2c2b824499a017987d1f
|
data/lib/rat_deployer/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'thor'
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
require 'rat_deployer/command'
|
4
5
|
require 'rat_deployer/notifier'
|
@@ -13,11 +14,11 @@ module RatDeployer
|
|
13
14
|
|
14
15
|
if services.any?
|
15
16
|
services_str = services.join(' ')
|
16
|
-
|
17
|
-
|
17
|
+
compose("pull #{services_str}")
|
18
|
+
compose("up -d --no-deps --force-recreate #{services_str}")
|
18
19
|
else
|
19
|
-
|
20
|
-
|
20
|
+
compose('pull')
|
21
|
+
compose('up -d')
|
21
22
|
end
|
22
23
|
|
23
24
|
RatDeployer::Notifier.notify_deploy_end
|
data/lib/rat_deployer/config.rb
CHANGED
@@ -6,40 +6,19 @@ module RatDeployer
|
|
6
6
|
def self.all
|
7
7
|
@all ||= YAML.load_file(File.expand_path('./rat_config.yml')) || {}
|
8
8
|
end
|
9
|
-
|
10
|
-
def self.env
|
11
|
-
ENV.fetch('RAT_ENV')
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.images
|
15
|
-
all.fetch('images', {})
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.environmental
|
19
|
-
all.fetch('environments', {})
|
20
|
-
end
|
21
|
-
|
22
9
|
def self.for_env(e = env)
|
10
|
+
environmental = all.fetch('environments', {})
|
23
11
|
default_conf = environmental.fetch('default', {})
|
24
12
|
env_conf = environmental.fetch(e)
|
25
|
-
default_conf.deep_merge(env_conf)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.prompt_enabled?
|
29
|
-
ENV['RAT_PROMPT'] != "false"
|
30
|
-
end
|
31
13
|
|
32
|
-
|
33
|
-
# Acceps either a docker-machine machine name
|
34
|
-
# or an object with keys ca_cert, cert, key, and host.
|
35
|
-
def self.machine
|
36
|
-
for_env.fetch("machine")
|
14
|
+
default_conf.deep_merge(env_conf)
|
37
15
|
end
|
38
16
|
|
39
|
-
def self.
|
40
|
-
|
41
|
-
|
42
|
-
end
|
17
|
+
def self.prompt_enabled?() ENV['RAT_PROMPT'] != "false" end
|
18
|
+
def self.machine() for_env.fetch("machine") end
|
19
|
+
def self.remote() ENV['RAT_REMOTE'] =~ /true|1|yes/ end
|
20
|
+
def self.env() ENV.fetch('RAT_ENV') end
|
21
|
+
def self.images() all.fetch('images', {}) end
|
43
22
|
|
44
23
|
def self.remote_machine_flags
|
45
24
|
case machine
|
@@ -14,6 +14,14 @@ module RatDeployer
|
|
14
14
|
notify_deploy "Ended deploy on #{ENV.fetch('RAT_ENV')}"
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.notify(msg)
|
18
|
+
return unless webhook_url
|
19
|
+
return unless webhook_url
|
20
|
+
self.slack_notifier.ping msg
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
17
25
|
def self.notify_deploy(title)
|
18
26
|
return unless webhook_url
|
19
27
|
props = get_deploy_properties
|
@@ -33,14 +41,6 @@ module RatDeployer
|
|
33
41
|
)
|
34
42
|
end
|
35
43
|
|
36
|
-
def self.notify(msg)
|
37
|
-
return unless webhook_url
|
38
|
-
return unless webhook_url
|
39
|
-
self.slack_notifier.ping msg
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
44
|
def self.slack_notifier
|
45
45
|
return unless webhook_url
|
46
46
|
|
data/lib/rat_deployer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rat_deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Oga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|