eb-docker-deploy 0.0.5 → 0.0.6

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: 4b2b80953e5929cb073a96e9c8d931e0ff55c297
4
- data.tar.gz: 564e206885bcc11f24bc3ab128be29de1d272836
3
+ metadata.gz: f3dde0bd7c8812ca6cb93b95f225c8f2fc090292
4
+ data.tar.gz: 4beafc164baaa4ded180dbfe27a0f193788347dd
5
5
  SHA512:
6
- metadata.gz: 612d94bdb7a3340b906abae7f5017a9a3237b8153b81f69cc65673c7579875b85fc720995b541f2380dec8731ffb7a5cbad84a332c6178355f50ff527d90739d
7
- data.tar.gz: 64d8598f62462f557ebce461e898a662d63208830a82310f3739a68a581d369de84a2dad79359d2257c70a255462a310d2c96b22f08f8cb3a8fe8e42516df27a
6
+ metadata.gz: 20de9c29fca11086a03dd94aa7989b33e778952a4c8af6d234371c919c45e5b983cefd2073a13cc272898f7ad2b13d63d796f8e0406034a3dde7d40b3d557d41
7
+ data.tar.gz: 9b6d965e69f936dd13b266615c8aacfbbe3379b725fe1feab33e818208458329ece8f83bf3db3a5bc8bbe70a5e8bd819f6d72ff3b869fa69fab863ae25a2d051
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
 
24
24
  spec.add_dependency 'thor'
25
+ spec.add_dependency 'user_config'
25
26
  end
data/lib/deploy.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'thor'
2
+ require 'user_config'
3
+
2
4
  require 'deploy/output'
3
5
 
4
6
  require 'deploy/deployer'
@@ -4,10 +4,7 @@ module Deploy
4
4
 
5
5
  desc 'setup config', 'setup config'
6
6
  def setup
7
-
8
- raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('~/.aws/config')
9
-
10
- command = "eb init"
7
+ command = 'eb init'
11
8
  system(command)
12
9
  end
13
10
 
@@ -27,6 +24,8 @@ module Deploy
27
24
  push_image(repo, 'latest')
28
25
 
29
26
  run_deploy(version)
27
+
28
+ save_version(version)
30
29
  end
31
30
 
32
31
  method_option :version, aliases: '-v', desc: 'Version'
@@ -40,6 +39,8 @@ module Deploy
40
39
  push_image(repo, 'latest')
41
40
 
42
41
  run_deploy(version)
42
+
43
+ save_version(version)
43
44
  end
44
45
 
45
46
  no_commands do
@@ -67,12 +68,20 @@ module Deploy
67
68
  system(command)
68
69
  end
69
70
 
71
+ def save_version(version)
72
+ config_file['current_version'] = version
73
+ end
74
+
75
+ def config_file
76
+ UserConfig.new('.eb-deploy')['versions']
77
+ end
78
+
70
79
  def check_setup
71
- raise StandardError, 'docker not installed' unless command?('docker')
72
- raise StandardError, 'eb command not installed' unless command?('eb')
73
- raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('.elasticbeanstalk')
74
- raise StandardError, 'elasticbeanstalk not configured' unless File.exist?('~/.aws/config')
75
- raise StandardError, 'ENV DOCKER_REPO not set' unless ENV['DOCKER_REPO']
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?('~/.aws/config')
84
+ (shout('ENV DOCKER_REPO not set'); return false) unless ENV['DOCKER_REPO']
76
85
  end
77
86
 
78
87
  def command?(command)
@@ -1,3 +1,3 @@
1
1
  module Deploy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: user_config
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: deploy with docker and aws eb
56
70
  email:
57
71
  - thogg4@gmail.com