eb-docker-deploy 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffbe0a4f0f4722bd8cd942165db069948bfafba0
4
- data.tar.gz: fb1f34a497945c46e7d0bebf2220796edcaacae7
3
+ metadata.gz: e29adfe0238660e12dbf72c3c61312ca8119eec5
4
+ data.tar.gz: e29fc212596b9a58f608e7e45b2727843c40aae3
5
5
  SHA512:
6
- metadata.gz: 83505aebe2ca0c416088be82c04ecae1d6b129874d6838b63a5c502ccb1563da1209ec8264dc3e94d647fc3cf09db0f9f83e9cf1a41313128cfb4e393c45168c
7
- data.tar.gz: 847110071c031b4bb8b5054d08bfa1a40788efebf5ba6a97e37b18d191e5eb2bdf661a2a0aac7d3488536b2ec99a38cba1d4ee6eef88f4d406f666dcfbe589ef
6
+ metadata.gz: f132cb170ad9c3cbe30e824d11d5707eb303d7d42e0e88bafa1b25f17126c649fa7f0e407bb038b56c5a464bedc5dabc6c30d7323e333b6d359f18e85943a955
7
+ data.tar.gz: 3d1de0d80dc55d8309e8eea7326e5d9fc3d847cba34539ac17b4f93b14e130cc3afca9fcd2c63ce56a8edaa0993886abefbe9a70dafcba32c4468965e7e9b7e3
@@ -9,29 +9,36 @@ module Deploy
9
9
  end
10
10
 
11
11
  method_option :version, aliases: '-v', desc: 'Version'
12
+ method_option :build, aliases: '-b', desc: 'Build Image'
12
13
  desc 'deploy', 'deploy'
13
14
  def deploy
14
15
  check_setup
15
16
 
17
+ build = options[:build]
18
+
16
19
  version = options[:version]
20
+ (shout('You must pass a version with -v'); exit(1)) unless version
21
+
17
22
  repo = ENV['DOCKER_REPO']
18
23
 
19
- build_image(repo, version)
24
+ if build
25
+ build_image(repo, version)
20
26
 
21
- tag_image_as_latest(repo, version)
27
+ tag_image_as_latest(repo, version)
22
28
 
23
- push_image(repo, version)
24
- push_image(repo, 'latest')
29
+ push_image(repo, version)
30
+ push_image(repo, 'latest')
31
+ end
25
32
 
26
33
  run_deploy(version)
27
-
28
- save_version(version)
29
34
  end
30
35
 
31
36
  method_option :version, aliases: '-v', desc: 'Version'
32
37
  desc 'rollback', 'rollback'
33
38
  def rollback
34
39
  version = options[:version]
40
+ (shout('You must pass a version with -v'); exit(1)) unless version
41
+
35
42
  repo = ENV['DOCKER_REPO']
36
43
 
37
44
  tag_image_as_latest(repo, version)
@@ -39,8 +46,6 @@ module Deploy
39
46
  push_image(repo, 'latest')
40
47
 
41
48
  run_deploy(version)
42
-
43
- save_version(version)
44
49
  end
45
50
 
46
51
  no_commands do
@@ -48,40 +53,40 @@ module Deploy
48
53
  def build_image(repo, tag)
49
54
  shout "Building Docker Image: #{repo}:#{tag}"
50
55
  command = "docker build -t #{repo}:#{tag} ."
51
- system(command)
56
+ exit(1) unless system(command)
52
57
  end
53
58
 
54
59
  def tag_image_as_latest(repo, tag)
55
60
  shout "Tagging #{tag} Docker Image as Latest"
56
61
  command = "docker tag -f #{repo}:#{tag} #{repo}:latest"
57
- system(command)
62
+ exit(1) unless system(command)
58
63
  end
59
64
 
60
65
  def push_image(repo, tag)
61
66
  shout "Pushing Docker Image: #{repo}:#{tag}"
62
67
  command = "docker push #{repo}:#{tag}"
63
- system(command)
68
+ exit(1) unless system(command)
64
69
  end
65
70
 
66
71
  def run_deploy(version)
67
72
  command = "eb deploy --label #{version}"
68
- system(command)
73
+ exit(1) unless system(command)
69
74
  end
70
75
 
71
76
  def save_version(version)
72
- config_file['current_version'] = version
77
+ #config_file['current_version'] = version
73
78
  end
74
79
 
75
80
  def config_file
76
- UserConfig.new('.eb-deploy')['versions']
81
+ #UserConfig.new('.eb-deploy')['versions']
77
82
  end
78
83
 
79
84
  def check_setup
80
- (shout('docker not installed'); return false) unless command?('docker')
81
- (shout('eb command not installed'); return false) unless command?('eb')
82
- (shout('elasticbeanstalk not configured. run setup command'); return false) unless File.exist?('.elasticbeanstalk')
83
- (shout('aws not configured. run setup command'); return false) unless File.exist?(File.expand_path('~/.aws/config'))
84
- (shout('ENV DOCKER_REPO not set'); return false) unless ENV['DOCKER_REPO']
85
+ (shout('docker not installed'); exit(1)) unless command?('docker')
86
+ (shout('eb command not installed'); exit(1)) unless command?('eb')
87
+ (shout('elasticbeanstalk not configured. run setup command'); exit(1)) unless File.exist?('.elasticbeanstalk')
88
+ (shout('aws credentials not configured.'); exit(1)) unless File.exist?(File.expand_path('~/.aws/config'))
89
+ (shout('ENV DOCKER_REPO not set'); exit(1)) unless ENV['DOCKER_REPO']
85
90
  end
86
91
 
87
92
  def command?(command)
@@ -1,3 +1,3 @@
1
1
  module Deploy
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
4
+ version: 0.0.8
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-17 00:00:00.000000000 Z
11
+ date: 2015-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.2.2
108
+ rubygems_version: 2.4.5
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: deploy with docker and aws eb