eb-docker-deploy 0.1.1 → 0.2.0
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 +4 -4
- data/eb-docker-deploy.gemspec +2 -0
- data/lib/deploy.rb +1 -0
- data/lib/deploy/deployer.rb +20 -8
- data/lib/deploy/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02df66ec1675e50705fdb62095917a230c4b5649
|
4
|
+
data.tar.gz: f2d019128389c04833cdbba09326e9471e279d63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6019431a1df15632b63d6be92bd1e103a2384fb01f521910303cec5b2e1d591d743f26684f734e01715f7dd22811fbad8eaf2c4eea31812d37583ae655bc9a6
|
7
|
+
data.tar.gz: 680bbd97fa0356a48d08f8a8a80226647cb5c9fe9d7975953b99cff07e0adee9379326a5c740ad73fcfd517dfeae33ae80f7524e6ce884706df3750430797b4d
|
data/eb-docker-deploy.gemspec
CHANGED
data/lib/deploy.rb
CHANGED
data/lib/deploy/deployer.rb
CHANGED
@@ -33,15 +33,19 @@ module Deploy
|
|
33
33
|
repo = ENV['DOCKER_REPO']
|
34
34
|
|
35
35
|
if build
|
36
|
+
notifier('', { color: '#6080C0', title: "Deployment started with build", text: "Deploying version #{version}" })
|
36
37
|
build_image(repo, version)
|
37
38
|
|
38
39
|
tag_image_as_latest(repo, version)
|
39
40
|
|
40
41
|
push_image(repo, version)
|
41
42
|
push_image(repo, 'latest')
|
43
|
+
else
|
44
|
+
notifier('', { color: '#6080C0', title: "Deployment started without build", text: "Deploying version #{version}" })
|
42
45
|
end
|
43
46
|
|
44
47
|
run_deploy(version)
|
48
|
+
notifier('', { color: 'good', title: 'Deployment Succeeded!!', text: "The new version is #{version}" })
|
45
49
|
end
|
46
50
|
|
47
51
|
method_option :version, aliases: '-v', desc: 'Version'
|
@@ -59,8 +63,24 @@ module Deploy
|
|
59
63
|
run_deploy(version)
|
60
64
|
end
|
61
65
|
|
66
|
+
desc 'send test notification', 'send test notification'
|
67
|
+
def test_slack
|
68
|
+
notifier('', { color: 'good', title: 'This is a test notification from eb-docker-deploy.' })
|
69
|
+
end
|
70
|
+
|
62
71
|
no_commands do
|
63
72
|
|
73
|
+
def notifier(message, attachments)
|
74
|
+
if ENV['SLACK_WEBHOOK']
|
75
|
+
@notifier ||= Slack::Notifier.new(ENV['SLACK_WEBHOOK'])
|
76
|
+
@notifier.ping(message, {
|
77
|
+
attachments: [attachments]
|
78
|
+
})
|
79
|
+
else
|
80
|
+
shout 'You can send deployment notifications if you set the SLACK_WEBHOOK environment variable.'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
64
84
|
def build_image(repo, tag)
|
65
85
|
shout "Building Docker Image: #{repo}:#{tag}"
|
66
86
|
command = "docker build -t #{repo}:#{tag} ."
|
@@ -85,14 +105,6 @@ module Deploy
|
|
85
105
|
exit(1) unless system(command)
|
86
106
|
end
|
87
107
|
|
88
|
-
def save_version(version)
|
89
|
-
#config_file['current_version'] = version
|
90
|
-
end
|
91
|
-
|
92
|
-
def aws_config_file
|
93
|
-
#UserConfig.new('.eb-deploy')['versions']
|
94
|
-
end
|
95
|
-
|
96
108
|
def check_setup
|
97
109
|
(shout('docker not installed'); exit(1)) unless command?('docker')
|
98
110
|
(shout('eb command not installed'); exit(1)) unless command?('eb')
|
data/lib/deploy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eb-docker-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: slack-notifier
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: deploy with docker and aws eb
|
70
84
|
email:
|
71
85
|
- thogg4@gmail.com
|