eb-docker-deploy 0.0.4 → 0.0.5
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 +37 -24
- data/lib/deploy/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: 4b2b80953e5929cb073a96e9c8d931e0ff55c297
|
4
|
+
data.tar.gz: 564e206885bcc11f24bc3ab128be29de1d272836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 612d94bdb7a3340b906abae7f5017a9a3237b8153b81f69cc65673c7579875b85fc720995b541f2380dec8731ffb7a5cbad84a332c6178355f50ff527d90739d
|
7
|
+
data.tar.gz: 64d8598f62462f557ebce461e898a662d63208830a82310f3739a68a581d369de84a2dad79359d2257c70a255462a310d2c96b22f08f8cb3a8fe8e42516df27a
|
data/lib/deploy/deployer.rb
CHANGED
@@ -2,8 +2,11 @@ module Deploy
|
|
2
2
|
class Deployer < Thor
|
3
3
|
include Deploy::Output
|
4
4
|
|
5
|
-
desc 'setup
|
5
|
+
desc 'setup config', 'setup config'
|
6
6
|
def setup
|
7
|
+
|
8
|
+
raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('~/.aws/config')
|
9
|
+
|
7
10
|
command = "eb init"
|
8
11
|
system(command)
|
9
12
|
end
|
@@ -16,23 +19,14 @@ module Deploy
|
|
16
19
|
version = options[:version]
|
17
20
|
repo = ENV['DOCKER_REPO']
|
18
21
|
|
19
|
-
|
20
|
-
command = "docker build -t #{repo}:#{version} ."
|
21
|
-
system(command)
|
22
|
+
build_image(repo, version)
|
22
23
|
|
23
|
-
|
24
|
-
command = "docker tag -f #{repo}:#{version} #{repo}:latest"
|
25
|
-
system(command)
|
24
|
+
tag_image_as_latest(repo, version)
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
system(command)
|
30
|
-
shout "Pushing Docker Image: #{repo}:latest"
|
31
|
-
command = "docker push #{repo}:latest"
|
32
|
-
system(command)
|
26
|
+
push_image(repo, version)
|
27
|
+
push_image(repo, 'latest')
|
33
28
|
|
34
|
-
|
35
|
-
system(command)
|
29
|
+
run_deploy(version)
|
36
30
|
end
|
37
31
|
|
38
32
|
method_option :version, aliases: '-v', desc: 'Version'
|
@@ -41,25 +35,44 @@ module Deploy
|
|
41
35
|
version = options[:version]
|
42
36
|
repo = ENV['DOCKER_REPO']
|
43
37
|
|
44
|
-
|
45
|
-
command = "docker tag -f #{repo}:#{version} #{repo}:latest"
|
46
|
-
system(command)
|
38
|
+
tag_image_as_latest(repo, version)
|
47
39
|
|
48
|
-
|
49
|
-
command = "docker push #{repo}:latest"
|
50
|
-
system(command)
|
40
|
+
push_image(repo, 'latest')
|
51
41
|
|
52
|
-
|
53
|
-
system(command)
|
42
|
+
run_deploy(version)
|
54
43
|
end
|
55
44
|
|
56
45
|
no_commands do
|
57
46
|
|
47
|
+
def build_image(repo, tag)
|
48
|
+
shout "Building Docker Image: #{repo}:#{tag}"
|
49
|
+
command = "docker build -t #{repo}:#{tag} ."
|
50
|
+
system(command)
|
51
|
+
end
|
52
|
+
|
53
|
+
def tag_image_as_latest(repo, tag)
|
54
|
+
shout "Tagging #{tag} Docker Image as Latest"
|
55
|
+
command = "docker tag -f #{repo}:#{tag} #{repo}:latest"
|
56
|
+
system(command)
|
57
|
+
end
|
58
|
+
|
59
|
+
def push_image(repo, tag)
|
60
|
+
shout "Pushing Docker Image: #{repo}:#{tag}"
|
61
|
+
command = "docker push #{repo}:#{tag}"
|
62
|
+
system(command)
|
63
|
+
end
|
64
|
+
|
65
|
+
def run_deploy(version)
|
66
|
+
command = "eb deploy --label #{version}"
|
67
|
+
system(command)
|
68
|
+
end
|
69
|
+
|
58
70
|
def check_setup
|
59
71
|
raise StandardError, 'docker not installed' unless command?('docker')
|
60
72
|
raise StandardError, 'eb command not installed' unless command?('eb')
|
61
73
|
raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('.elasticbeanstalk')
|
62
|
-
raise StandardError, '
|
74
|
+
raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('~/.aws/config')
|
75
|
+
raise StandardError, 'ENV DOCKER_REPO not set' unless ENV['DOCKER_REPO']
|
63
76
|
end
|
64
77
|
|
65
78
|
def command?(command)
|
data/lib/deploy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eb-docker-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|