eb-docker-deploy 0.2.0 → 0.3.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/lib/deploy/deployer.rb +22 -3
- data/lib/deploy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67b183671bb59c1df4a045ea9c85fb88d3ca4556
|
|
4
|
+
data.tar.gz: db28728d203c093b528cb4409f83223b9f63acf8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21a1b760b2c9d75f561ecb477512bbc7e0085877900f789d00e7245feba37e7101806408a089ca68d404eea770993ef89e4d300fa39a3de05fef65bf2d2c2bca
|
|
7
|
+
data.tar.gz: 5b0465af2ebb7557b8c98a0c215318b0da85b32c26681f861b5880665f036841f010626b21609adebb2ffe7f80015fa7df927f9236c21158b296f22d09446ad5
|
data/lib/deploy/deployer.rb
CHANGED
|
@@ -45,22 +45,29 @@ module Deploy
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
run_deploy(version)
|
|
48
|
-
notifier('', { color: 'good', title: 'Deployment Succeeded!!', text: "The
|
|
48
|
+
notifier('', { color: 'good', title: 'Deployment Succeeded!!', text: "The current version is #{version}" })
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
method_option :version, aliases: '-v', desc: 'Version'
|
|
52
52
|
desc 'rollback', 'rollback'
|
|
53
53
|
def rollback
|
|
54
|
+
check_setup
|
|
55
|
+
|
|
54
56
|
version = options[:version]
|
|
55
57
|
(shout('You must pass a version with -v'); exit(1)) unless version
|
|
56
58
|
|
|
57
59
|
repo = ENV['DOCKER_REPO']
|
|
58
60
|
|
|
61
|
+
notifier('', { color: '#6080C0', title: "Rollback started", text: "Rolling back to version #{version}" })
|
|
62
|
+
|
|
63
|
+
pull_image(repo, version)
|
|
64
|
+
|
|
59
65
|
tag_image_as_latest(repo, version)
|
|
60
66
|
|
|
61
67
|
push_image(repo, 'latest')
|
|
62
68
|
|
|
63
|
-
|
|
69
|
+
run_rollback(version)
|
|
70
|
+
notifier('', { color: 'good', title: 'Rollback Succeeded!!', text: "The current version is #{version}" })
|
|
64
71
|
end
|
|
65
72
|
|
|
66
73
|
desc 'send test notification', 'send test notification'
|
|
@@ -99,12 +106,24 @@ module Deploy
|
|
|
99
106
|
exit(1) unless system(command)
|
|
100
107
|
end
|
|
101
108
|
|
|
109
|
+
def pull_image(repo, tag)
|
|
110
|
+
shout "Pulling Docker Image: #{repo}:#{tag}"
|
|
111
|
+
command = "docker pull #{repo}:#{tag}"
|
|
112
|
+
exit(1) unless system(command)
|
|
113
|
+
end
|
|
114
|
+
|
|
102
115
|
def run_deploy(version)
|
|
103
|
-
shout "
|
|
116
|
+
shout "deploying #{version} to elastic beanstalk"
|
|
104
117
|
command = "eb deploy --label #{version}"
|
|
105
118
|
exit(1) unless system(command)
|
|
106
119
|
end
|
|
107
120
|
|
|
121
|
+
def run_rollback(version)
|
|
122
|
+
shout "deploying #{version} to elastic beanstalk"
|
|
123
|
+
command = "eb deploy --version #{version}"
|
|
124
|
+
exit(1) unless system(command)
|
|
125
|
+
end
|
|
126
|
+
|
|
108
127
|
def check_setup
|
|
109
128
|
(shout('docker not installed'); exit(1)) unless command?('docker')
|
|
110
129
|
(shout('eb command not installed'); exit(1)) unless command?('eb')
|
data/lib/deploy/version.rb
CHANGED