eb-docker-deploy 0.0.1 → 0.0.2
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/bin/eb-deploy +2 -2
- data/eb-docker-deploy-0.0.1.gem +0 -0
- data/lib/deploy.rb +8 -0
- data/lib/deploy/deployer.rb +47 -0
- data/lib/deploy/output.rb +37 -0
- data/lib/deploy/version.rb +1 -1
- metadata +5 -2
- data/lib/eb_deploy.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f68a6c2c8321ba04aef5cc495f3c222426ba79e
|
4
|
+
data.tar.gz: a359d87ba39f81684ab20716e7dba74d4fc028fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13ca05ef844c7b056ef8f9a06a3aa8210f2df262cc6306cb44b1c7e6c9aae68334f88faf6b3e3a9f08dde420620df69bc3015eb6085bfcc22ad6fe2aedbc7558
|
7
|
+
data.tar.gz: 577efa94dd40a64698cb2b481b5b126255fa4d2a339ea665b1d930093b26358e7e2758baf6e420a221d01a343c7caf3cb4edfacd6e5c77bc0a2cabcca1812f8f
|
data/bin/eb-deploy
CHANGED
Binary file
|
data/lib/deploy.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
module Deploy
|
2
|
+
class Deployer < Thor
|
3
|
+
include Deploy::Output
|
4
|
+
|
5
|
+
desc 'setup eb', 'setup eb'
|
6
|
+
def setup
|
7
|
+
command = "eb init"
|
8
|
+
system(command)
|
9
|
+
end
|
10
|
+
|
11
|
+
method_option :version, aliases: '-v', desc: 'Version'
|
12
|
+
desc 'deploy', 'deploy'
|
13
|
+
def deploy
|
14
|
+
check_setup
|
15
|
+
|
16
|
+
version = options[:version]
|
17
|
+
repo = ENV['DOCKER_REPO']
|
18
|
+
|
19
|
+
shout 'Building Docker Image'
|
20
|
+
command = "docker build -t #{repo}:#{version} ."
|
21
|
+
system(command)
|
22
|
+
|
23
|
+
shout 'Tagging Docker Image'
|
24
|
+
command = "docker tag -f #{repo}:#{version} #{repo}:latest"
|
25
|
+
system(command)
|
26
|
+
|
27
|
+
#command = "eb deploy -l #{version}"
|
28
|
+
#system(command)
|
29
|
+
end
|
30
|
+
|
31
|
+
no_commands do
|
32
|
+
|
33
|
+
def check_setup
|
34
|
+
raise StandardError, 'docker not installed' unless command?('docker')
|
35
|
+
raise StandardError, 'eb command not installed' unless command?('eb')
|
36
|
+
raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('.elasticbeanstalk')
|
37
|
+
raise StandardError, 'Env DOCKER_REPO not set' unless ENV['DOCKER_REPO']
|
38
|
+
end
|
39
|
+
|
40
|
+
def command?(command)
|
41
|
+
system("which #{command} > /dev/null 2>&1")
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Deploy
|
2
|
+
module Output
|
3
|
+
|
4
|
+
def shout(message)
|
5
|
+
message_size = message.size
|
6
|
+
if message_size < 77
|
7
|
+
# lines are always 80 characters
|
8
|
+
stars = '*' * (77 - message_size)
|
9
|
+
puts(green("+ ") + "#{message} #{green(stars)}")
|
10
|
+
else
|
11
|
+
puts(green('+ ') + message)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def red(message)
|
16
|
+
colorize(31, message)
|
17
|
+
end
|
18
|
+
|
19
|
+
def green(message)
|
20
|
+
colorize(32, message)
|
21
|
+
end
|
22
|
+
|
23
|
+
def yellow(message)
|
24
|
+
colorize(33, message)
|
25
|
+
end
|
26
|
+
|
27
|
+
def pink(message)
|
28
|
+
colorize(35, message)
|
29
|
+
end
|
30
|
+
|
31
|
+
def colorize(color_code, message)
|
32
|
+
"\e[#{color_code}m#{message}\e[0m"
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
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.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim
|
@@ -66,9 +66,12 @@ files:
|
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- bin/eb-deploy
|
69
|
+
- eb-docker-deploy-0.0.1.gem
|
69
70
|
- eb-docker-deploy.gemspec
|
71
|
+
- lib/deploy.rb
|
72
|
+
- lib/deploy/deployer.rb
|
73
|
+
- lib/deploy/output.rb
|
70
74
|
- lib/deploy/version.rb
|
71
|
-
- lib/eb_deploy.rb
|
72
75
|
homepage: ''
|
73
76
|
licenses:
|
74
77
|
- MIT
|
data/lib/eb_deploy.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
|
3
|
-
class EbDeploy < Thor
|
4
|
-
|
5
|
-
desc 'setup eb', 'setup eb'
|
6
|
-
def setup
|
7
|
-
command = "eb init"
|
8
|
-
system(command)
|
9
|
-
end
|
10
|
-
|
11
|
-
method_option :version, aliases: '-v', desc: 'Version'
|
12
|
-
desc 'deploy', 'deploy'
|
13
|
-
def deploy
|
14
|
-
check_setup
|
15
|
-
|
16
|
-
version = options[:version]
|
17
|
-
repo = ENV['DOCKER_REPO']
|
18
|
-
|
19
|
-
say 'Building Docker Image'
|
20
|
-
command = "docker build -t #{repo}:#{version} ."
|
21
|
-
system(command)
|
22
|
-
|
23
|
-
say 'Tagging Docker Image'
|
24
|
-
command = "docker tag #{repo}:#{version} #{repo}:latest"
|
25
|
-
system(command)
|
26
|
-
|
27
|
-
#command = "eb deploy -l #{version}"
|
28
|
-
#system(command)
|
29
|
-
end
|
30
|
-
|
31
|
-
no_commands do
|
32
|
-
|
33
|
-
def check_setup
|
34
|
-
raise StandardError, 'docker not installed' unless command?('docker')
|
35
|
-
raise StandardError, 'eb command not installed' unless command?('eb')
|
36
|
-
raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('.elasticbeanstalk')
|
37
|
-
raise StandardError, 'Env DOCKER_REPO not set' unless ENV['DOCKER_REPO']
|
38
|
-
end
|
39
|
-
|
40
|
-
def command?(command)
|
41
|
-
system("which #{command} > /dev/null 2>&1")
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|