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 +4 -4
- data/README.md +0 -1
- data/lib/dockerhelper/kubernetes.rb +10 -0
- data/lib/dockerhelper/rake.rb +15 -3
- data/lib/dockerhelper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb11a7f10e11248eaf1ff08f253c41e5352bfc6
|
4
|
+
data.tar.gz: e663a7ddf2acaf0b77f8531f37998f5b982df1e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0211dbcba6b420356d5b991469790edb34ec41fb85ea779f05f15a1df6032c6ca01f4b4654166ce8788c66c0597ed50852980df35982ed94fa319efca46de96c
|
7
|
+
data.tar.gz: a19c400f9515c7fb49772ddced168f5731b479d9c60603c8bd218da8b792bb4a55243249241166c34c128fe8d794f49c045b7070ad8957586e0c03b0a1592927
|
data/README.md
CHANGED
@@ -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)
|
data/lib/dockerhelper/rake.rb
CHANGED
@@ -14,7 +14,7 @@ module Dockerhelper
|
|
14
14
|
end
|
15
15
|
|
16
16
|
desc 'Build docker image'
|
17
|
-
task :
|
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 :
|
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
|
data/lib/dockerhelper/version.rb
CHANGED