k8sflow 0.11.7 → 0.11.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: 8f3d51f7f1aad598518c94f3d9e6ba3ac2fa5991
4
- data.tar.gz: 8045001672972572641603b56b2680d04c596d03
3
+ metadata.gz: 6bfcd17a59b7f7d4a15c1020561a9817dd028166
4
+ data.tar.gz: a11c8e02fccaf09c2a0cb5ef6d020832c6ea487f
5
5
  SHA512:
6
- metadata.gz: f99a2579ab97dc7056b1bc3683ce272703b8a85763b059a1e4df9f084cb889230e3deef01c1cfc3d4dc7a96830a5847cd6d9878f39e412614573a87c262472da
7
- data.tar.gz: 3c11f9f6c3fc1ea3657c3dbcafe35cf6fa585edfc1b6a395e710e1c5eae582a7a09048a6ea3299644954ef7045f1825d8ac833b937dc0b04a5a56667174692a2
6
+ metadata.gz: dec3eaab85f886f135ac2002bfec269462f4b58019e9276596beed24c0bbbd7a892ffc26d4436a9354eb7b01300bbfc2f76c5754fe2f619b94d942bf93569b16
7
+ data.tar.gz: 76b6f0629673cfc43a3795f32a05c0ae0edd0f91837c90809e9a2332e3e83ae02479d0477345e91788e2e171bf3302a8f8e0f27e106dda8b646fa08dfe98ef71
@@ -1,8 +1,9 @@
1
1
  require 'erb'
2
+ require_relative 'docker_topic'
2
3
  module K8sflow
3
4
 
4
- module Image
5
- class ImageBase < Clitopic::Command::Base
5
+ module Docker
6
+ class DockerImageBase < Clitopic::Command::Base
6
7
  class << self
7
8
 
8
9
  def kv_parse(list)
@@ -92,77 +93,5 @@ module K8sflow
92
93
 
93
94
  end
94
95
  end
95
-
96
-
97
- class ImageTopic < Clitopic::Topic::Base
98
- register name: 'image',
99
- description: 'Mange image lifecylces'
100
-
101
- option :registry, '-r', '--registry DOCKER_REPO', 'Docker registry to pull/fetch images'
102
- option :path, '-p', '--path DOCKERFILE PATH', 'dockerfiles source directory to'
103
- option :docker_api, "-H", "--host", "docker api endpoint", default: "unix://"
104
- option :tag, '-t', '--tag TAG', "Image tag", default: 'latest'
105
-
106
- #dockerfile templates
107
- option :files, "-f", "--files FILE1,FILE2", Array, "List files to copy in dockerfile directory, i.e 'files/*',/etc/conf.cfg'"
108
- option :tpl, "-l", "--tpl=Dockerfile", "The Dockerfile Template", default: 'Dockerfile.tpl'
109
- option :vars, "-x", "--vars=VARS", Array, "Variables required by the dockerfile"
110
-
111
- #docker build options
112
- option :build_opts, "--build OPTS", "docker build options"
113
- end
114
-
115
-
116
- class Dockerfile < ImageBase
117
- register name: 'dockerfile',
118
- banner: 'image:dockerfile [options]',
119
- description: 'Generate a dockerfile with templated vars .',
120
- topic: 'image'
121
-
122
- def self.call
123
- puts @options
124
- create_dockerfile
125
- end
126
- end
127
-
128
- class Build < ImageBase
129
- register name: 'build',
130
- description: 'build docker image',
131
- banner: 'image:build [OPTIONS]',
132
- topic: 'image'
133
-
134
- option :skip_dockerfile, "--skip-dockerfile", "-s", "Skip Create dockerfile"
135
- def self.call
136
- puts @options
137
- create_dockerfile unless @options[:skip_dockerfile]
138
- dockerbuild
139
- end
140
- end
141
-
142
- class Push < ImageBase
143
- register name: 'push',
144
- description: 'push dockerimage to docker hub',
145
- banner: 'image:push [OPTIONS]',
146
- topic: 'image'
147
-
148
- option :skip_build, "--skip-build", "skip docker build"
149
- option :skip_dockerfile, "--skip-dockerfile", "skip create dockerfile"
150
- def self.call
151
- create_dockerfile unless @options[:skip_dockerfile]
152
- dockerbuild unless @options[:skip_build]
153
- dockerpush
154
- end
155
- end
156
-
157
-
158
- class List < Clitopic::Command::Base
159
- register name: 'list',
160
- description: 'List available tags in a registry',
161
- topic: 'image'
162
-
163
- def self.call
164
- end
165
- end
166
96
  end
167
-
168
97
  end
@@ -0,0 +1,13 @@
1
+ module K8sflow
2
+ module Docker
3
+ class DockerTopic < Clitopic::Topic::Base
4
+ register name: 'docker',
5
+ description: 'Mange docker image and run'
6
+
7
+ option :registry, '-r', '--registry DOCKER_REPO', 'Docker registry to pull/fetch images'
8
+ option :docker_api, "-H", "--host", "docker api endpoint", default: "unix://"
9
+ option :tag, '-t', '--tag TAG', "Image tag", default: 'latest'
10
+
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,56 @@
1
+ require_relative 'docker_image_base'
2
+ module K8sflow
3
+ module Docker
4
+
5
+
6
+ class Dockerfile < DockerImageBase
7
+ register name: 'dockerfile',
8
+ banner: 'docker:dockerfile [options]',
9
+ description: 'Generate a dockerfile with templated vars .',
10
+ topic: 'docker'
11
+
12
+ option :files, "-f", "--files FILE1,FILE2", Array, "List files to copy in dockerfile directory, i.e 'files/*',/etc/conf.cfg'"
13
+ option :tpl, "-l", "--tpl=Dockerfile", "The Dockerfile Template", default: 'Dockerfile.tpl'
14
+ option :vars, "-x", "--vars=VARS", Array, "Variables required by the dockerfile"
15
+ option :path, '-p', '--path DOCKERFILE git repositry', 'dockerfiles source directory to'
16
+
17
+ def self.call
18
+ create_dockerfile
19
+ end
20
+ end
21
+
22
+ class Build < DockerImageBase
23
+ register name: 'build',
24
+ description: 'build docker image',
25
+ banner: 'docker:build [OPTIONS]',
26
+ topic: 'docker'
27
+
28
+ option :build_opts, "--build OPTS", "docker build options"
29
+ option :skip_dockerfile, "--skip-dockerfile", "-s", "Skip Create dockerfile"
30
+ inherited_options :build
31
+
32
+ def self.call
33
+ create_dockerfile unless @options[:skip_dockerfile]
34
+ dockerbuild
35
+ end
36
+ end
37
+
38
+ class Push < DockerImageBase
39
+ register name: 'push',
40
+ description: 'push dockerimage to docker hub',
41
+ banner: 'docker:push [OPTIONS]',
42
+ topic: 'docker'
43
+
44
+ option :skip_build, "--skip-build", "skip docker build"
45
+ inherited_options :build, :dockerfile
46
+
47
+ def self.call
48
+ create_dockerfile unless @options[:skip_dockerfile]
49
+ dockerbuild unless @options[:skip_build]
50
+ dockerpush
51
+ end
52
+ end
53
+
54
+ end
55
+
56
+ end
@@ -6,8 +6,8 @@ module K8sflow
6
6
  module Command
7
7
 
8
8
  class Run < Clitopic::Command::Base
9
- register name: 'index',
10
- banner: 'Usage: k8sflow run [options] CMD',
9
+ register name: 'run',
10
+ banner: 'Usage: k8sflow docker:run [options] CMD',
11
11
  description: "Run CMD on a (de)attached container
12
12
 
13
13
  Exemples:
@@ -17,21 +17,19 @@ $ k8sflow run -t 2.27.3 -r mydocker/repo -e APP_ENV=production -h tcp://docker-h
17
17
  Run a web server detached and bind container port to host port
18
18
  $ k8sflow run -t 2.10 -p 3000:3000 'run server -p 3000'
19
19
  ",
20
- topic: {name: 'run', description: 'Run CMD on a (de)attached container'}
20
+ topic: 'docker'
21
21
 
22
22
  option :port, "-p", "--port ctn_port:host_port", Array, "Publish a container's port(s) to the host"
23
23
  option :port_all, "-P", "--port-all", Array, "Publish all exposed ports to random ports"
24
24
  option :detach, "-d", "--detach", "daemonize container", default: false
25
- option :tag, "-t", "--tag TAG", "image-tag"
26
- option :registry, "-r", "--registry REPO", "image-repository"
27
25
  option :app, "-A", "--app APPNAME", "application name"
28
26
  option :envs, "-e", "--env VAR=VALUE,VAR2=VALUE2", Array, "envvars list"
29
27
  option :heroku, "--heroku APP", "get all envs from heroku"
30
28
  option :heroku_db, "--heroku-db", "get DB envs only from heroku"
31
29
  option :tty, "--[no-]tty", "Use tty"
32
- option :docker_api, "-h", "--host HOST", "docker api endpoint", default: "unix://"
33
30
  option :aliases, "--aliases a=x,b=y", "commands aliases, usefull in the default file"
34
31
 
32
+
35
33
  class << self
36
34
  attr_accessor :aliases
37
35
 
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module K8sflow
3
- VERSION = '0.11.7'
3
+ VERSION = '0.11.8'
4
4
  VERSION_NAMES = {1 => 'France II',
5
5
  2 => 'R.C. Rickmers',
6
6
  3 => 'Thomas W. Lawson',
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k8sflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.7
4
+ version: 0.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Legrand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cli-topic
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.9'
19
+ version: 0.9.10
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.9'
26
+ version: 0.9.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: docker-api
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,10 @@ files:
81
81
  - lib/k8sflow.rb
82
82
  - lib/k8sflow/cli.rb
83
83
  - lib/k8sflow/command.rb
84
- - lib/k8sflow/command/image.rb
84
+ - lib/k8sflow/command/docker/docker_image_base.rb
85
+ - lib/k8sflow/command/docker/docker_topic.rb
86
+ - lib/k8sflow/command/docker/image.rb
87
+ - lib/k8sflow/command/docker/run.rb
85
88
  - lib/k8sflow/command/maintenance.rb
86
89
  - lib/k8sflow/command/pg/backup.rb
87
90
  - lib/k8sflow/command/pg/copy.rb
@@ -93,7 +96,6 @@ files:
93
96
  - lib/k8sflow/command/pg/ps.rb
94
97
  - lib/k8sflow/command/pg/psql.rb
95
98
  - lib/k8sflow/command/pg/restore.rb
96
- - lib/k8sflow/command/run.rb
97
99
  - lib/k8sflow/utils/heroku.rb
98
100
  - lib/k8sflow/version.rb
99
101
  - spec/spec_helper.rb