dockerhelper 0.0.3 → 0.0.4

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: 8bec3a523719acd104ddce4ae0f3b2180eeae91c
4
- data.tar.gz: c428627da6a159c3f0e6fc6b7129d4ee6264e656
3
+ metadata.gz: cbb11a7f10e11248eaf1ff08f253c41e5352bfc6
4
+ data.tar.gz: e663a7ddf2acaf0b77f8531f37998f5b982df1e3
5
5
  SHA512:
6
- metadata.gz: 4660d2a114a52144f8d728e2af23c1d41b6341d5e3ce80cf369fb85cfb3420396a854da0254ca9cb8ff18c8be23fd38c1942e39ff55408b0d5588b1a005d6264
7
- data.tar.gz: 7c060304e6bb89bca3ef3a7a51ef5b83428ec65cf578a2d96a3296ec6a15efa28db4b1aff11b87089d557f5e4041a8ff00bf050959fab4f4b2e80d8e5c1dab77
6
+ metadata.gz: 0211dbcba6b420356d5b991469790edb34ec41fb85ea779f05f15a1df6032c6ca01f4b4654166ce8788c66c0597ed50852980df35982ed94fa319efca46de96c
7
+ data.tar.gz: a19c400f9515c7fb49772ddced168f5731b479d9c60603c8bd218da8b792bb4a55243249241166c34c128fe8d794f49c045b7070ad8957586e0c03b0a1592927
data/README.md CHANGED
@@ -56,5 +56,4 @@ rake docker:production:kube:gen_rc # Generate replication controller for the cu
56
56
  rake docker:production:pull # Pull git repo
57
57
  rake docker:production:push # Push docker images to Docker Hub
58
58
  rake docker:production:repo_tag # Tag docker image
59
-
60
59
  ```
@@ -33,6 +33,16 @@ module Dockerhelper
33
33
  label: 'kubectl-get-rc').run
34
34
  end
35
35
 
36
+ def replication_controller_create
37
+ Command.new("kubectl create -f #{replication_controller_filename}",
38
+ label: 'kubectl-create-rc').run
39
+ end
40
+
41
+ def replication_controller_delete
42
+ Command.new("kubectl delete -f #{replication_controller_filename}",
43
+ label: 'kubectl-delete-rc').run
44
+ end
45
+
36
46
  def replication_controller_yaml
37
47
  yaml_in = File.read(config.kube_rc_template)
38
48
  ERB.new(yaml_in).result(binding)
@@ -14,7 +14,7 @@ module Dockerhelper
14
14
  end
15
15
 
16
16
  desc 'Build docker image'
17
- task :build do
17
+ task :docker_build do
18
18
  config.docker.build(config.dockerfile, tag: config.docker_image)
19
19
  end
20
20
 
@@ -35,12 +35,13 @@ module Dockerhelper
35
35
  end
36
36
 
37
37
  desc 'Git clone, build image, and push image to Docker Hub'
38
- task :deploy => [:pull, :build, :repo_tag, :push]
38
+ task :build => [:pull, :docker_build, :repo_tag, :push, 'kube:gen_rc']
39
39
 
40
40
  namespace :kube do
41
41
  desc 'Generate replication controller for the current build'
42
42
  task :gen_rc do
43
43
  config.kubernetes.write_replication_controller
44
+ puts "Created replication-controller: #{config.kubernetes.replication_controller_filename}"
44
45
  end
45
46
 
46
47
  desc 'Get current replication controller version'
@@ -49,9 +50,20 @@ module Dockerhelper
49
50
  end
50
51
 
51
52
  desc 'Run replication controller rolling-update'
52
- task :rolling_update do
53
+ task :rolling_update => [:gen_rc] do
53
54
  config.kubernetes.rolling_update
54
55
  end
56
+
57
+ desc 'Create replication controller'
58
+ task :create_rc => [:gen_rc] do
59
+ config.kubernetes.replication_controller_create
60
+ end
61
+
62
+ desc 'Delete replication controller (USE WITH CAUTION)'
63
+ task :delete_rc do
64
+ # TODO add "are you sure?" prompt
65
+ config.kubernetes.replication_controller_delete
66
+ end
55
67
  end
56
68
  end
57
69
  end
@@ -1,3 +1,3 @@
1
1
  module Dockerhelper
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerhelper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh McDade