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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e81c5b8b9fc5a3cbee0ec141d8b855ada922aad
4
- data.tar.gz: 5634fc6211f01e61e12282560b456d0e277c6e96
3
+ metadata.gz: 0f68a6c2c8321ba04aef5cc495f3c222426ba79e
4
+ data.tar.gz: a359d87ba39f81684ab20716e7dba74d4fc028fe
5
5
  SHA512:
6
- metadata.gz: d48b49069321afeeb9b0336ea8fb668240cf4d9f7dd2874a108733905bfc433749b5343b9ec09a9b4177fedd64b65ee4fa93cb978a569c62e8dcc0e237386528
7
- data.tar.gz: cb7fe091563ac722cfea8292102783d7165e11ec5b53ab6ca12f340e3cc00777cb357f4dce7cac84b4a39c571888e3a6b683f1beb8a206350e716d70438eaa04
6
+ metadata.gz: 13ca05ef844c7b056ef8f9a06a3aa8210f2df262cc6306cb44b1c7e6c9aae68334f88faf6b3e3a9f08dde420620df69bc3015eb6085bfcc22ad6fe2aedbc7558
7
+ data.tar.gz: 577efa94dd40a64698cb2b481b5b126255fa4d2a339ea665b1d930093b26358e7e2758baf6e420a221d01a343c7caf3cb4edfacd6e5c77bc0a2cabcca1812f8f
data/bin/eb-deploy CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'eb_deploy'
3
+ require 'deploy'
4
4
 
5
- EbDeploy.start(ARGV)
5
+ Deploy::Deployer.start(ARGV)
Binary file
data/lib/deploy.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'thor'
2
+ require 'deploy/output'
3
+
4
+ require 'deploy/deployer'
5
+
6
+ module Deploy
7
+
8
+ end
@@ -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
+
@@ -1,3 +1,3 @@
1
1
  module Deploy
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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