devkitkat 0.1.30 → 0.1.35

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
  SHA256:
3
- metadata.gz: 3152cc8e42ea8f2250acaf60e0617f38b6feefdfbcbcee6ce17c39d96a4489f0
4
- data.tar.gz: 980bd93077f8158669103d0b13ba2bf4169ed1ca7dfa011c6a85b17c1e11866b
3
+ metadata.gz: 165a5288cd8a82c659cdb88bd8f26f78b8cbed8e1d694d7860c420a1d5237494
4
+ data.tar.gz: 25b48673025000c5b1122a8ddd899d1cf4962ec2de5e1ad8826785ac5ce6420a
5
5
  SHA512:
6
- metadata.gz: acf978184845ac81f6d1df26b0d35f47916fb1885c07b2d65ee43bfe72d19ee9bb8b99ca36aa35239d49139ce67a6e34830216a525edc43aeec43f65d5101562
7
- data.tar.gz: a07603e9275c93826e39d1a298fb3fac31c4e77b19b1d6985ee66be4ae90bcea138f902c85785989f184cf3f95482a39cf1fe7e36ac02dae5a4fa8a0e0f0d9ee
6
+ metadata.gz: fc5073ab8d1b7221fa0e557a40131b2bbaba1a57e3d401800852924c6613352b1cecfdfa60b952d23ef4c94dcd069c43e798418397ea43aab993c804cc593d8b
7
+ data.tar.gz: 493248dc330f0781484edcf5d089c3579154447c2369169f931a4e8dd2fd14446c5263bb59b612ca79f6559dfc9d3a999e271837cffba55c5c5b538096c72378
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devkitkat (0.1.29)
4
+ devkitkat (0.1.35)
5
5
  activesupport (~> 6.0.0)
6
6
  colorize (~> 0.8.1)
7
- docker-api (~> 1.34.2)
7
+ docker-api (~> 2.0.0)
8
8
  parallel (~> 1.17.0)
9
9
  pry (~> 0.12.2)
10
10
  pry-nav
@@ -14,25 +14,25 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- activesupport (6.0.2.2)
17
+ activesupport (6.0.3.5)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 0.7, < 2)
20
20
  minitest (~> 5.1)
21
21
  tzinfo (~> 1.1)
22
- zeitwerk (~> 2.2)
23
- coderay (1.1.2)
22
+ zeitwerk (~> 2.2, >= 2.2.2)
23
+ coderay (1.1.3)
24
24
  colorize (0.8.1)
25
- concurrent-ruby (1.1.6)
25
+ concurrent-ruby (1.1.8)
26
26
  diff-lcs (1.3)
27
- docker-api (1.34.2)
27
+ docker-api (2.0.0)
28
28
  excon (>= 0.47.0)
29
29
  multi_json
30
- excon (0.73.0)
31
- i18n (1.8.2)
30
+ excon (0.79.0)
31
+ i18n (1.8.9)
32
32
  concurrent-ruby (~> 1.0)
33
33
  method_source (0.9.2)
34
- minitest (5.14.0)
35
- multi_json (1.14.1)
34
+ minitest (5.14.2)
35
+ multi_json (1.15.0)
36
36
  parallel (1.17.0)
37
37
  pry (0.12.2)
38
38
  coderay (~> 1.1.0)
@@ -58,19 +58,19 @@ GEM
58
58
  rspec (>= 3.0)
59
59
  ruby-progressbar (1.10.1)
60
60
  thread_safe (0.3.6)
61
- tzinfo (1.2.7)
61
+ tzinfo (1.2.9)
62
62
  thread_safe (~> 0.1)
63
- zeitwerk (2.3.0)
63
+ zeitwerk (2.4.2)
64
64
 
65
65
  PLATFORMS
66
66
  ruby
67
67
 
68
68
  DEPENDENCIES
69
- bundler (~> 1.17)
69
+ bundler (~> 2.1.4)
70
70
  devkitkat!
71
71
  rake (~> 12.3.3)
72
72
  rspec (~> 3.0)
73
73
  rspec-temp_dir (~> 1.1.0)
74
74
 
75
75
  BUNDLED WITH
76
- 1.17.3
76
+ 2.1.4
data/README.md CHANGED
@@ -38,6 +38,7 @@ download/prepare services. These are available keys.
38
38
  |`services:` |Hash |Yes |-|The services to run the application|
39
39
  |`services:<name>` |Hash |Yes |-|The service name e.g. `rails`, `db`, `redis`|
40
40
  |`services:<name>:repo: <value>` |String |No |-|The git URL of the repository|
41
+ |`services:<name>:repo_ref: <value>` |String |No |-|The ref of the repository|
41
42
  |`services:<name>:<key>: <value>` |Hash |No |-|The key and value of the environment variable. e.g. `POSTGRES_PASSWORD: abcdef`. |
42
43
  |`image:` |String |No |-|The docker image. Only effective when `type` is `docker` or `cloud`|
43
44
  |`groups:` |Hash |No |-|The groups of the services|
data/devkitkat.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = "devkitkat"
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.17"
26
+ spec.add_development_dependency "bundler", "~> 2.1.4"
27
27
  spec.add_development_dependency "rake", "~> 12.3.3"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
  spec.add_development_dependency "rspec-temp_dir", "~> 1.1.0"
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency "parallel", "~> 1.17.0"
34
34
  spec.add_runtime_dependency "ruby-progressbar", "~> 1.10.1"
35
35
  spec.add_runtime_dependency "colorize", "~> 0.8.1"
36
- spec.add_runtime_dependency "docker-api", "~> 1.34.2"
36
+ spec.add_runtime_dependency "docker-api", "~> 2.0.0"
37
37
  spec.add_runtime_dependency "require_all", "~> 3.0.0"
38
38
  end
@@ -99,6 +99,7 @@ module Devkitkat
99
99
  opts.separator "poop - Poop"
100
100
  opts.separator "show-variables - Show all variables via 'export' command"
101
101
  opts.separator "remove-containers - Remove all related containers"
102
+ opts.separator "start-container - Start a container (dry-run)"
102
103
  end
103
104
  end
104
105
 
@@ -8,7 +8,7 @@ module Devkitkat
8
8
  attr_reader :name, :config, :command, :executor
9
9
 
10
10
  DIVISIONS = %w[src script data cache log example dockerfile].freeze
11
- SERVICE_PROPERTIES = %w[repo host port]
11
+ SERVICE_PROPERTIES = %w[repo repo_ref host port]
12
12
 
13
13
  def initialize(name, config, command)
14
14
  @name, @config, @command = name, config, command
@@ -145,6 +145,10 @@ module Devkitkat
145
145
  @group_id ||= `id -u`.delete("\n")
146
146
  end
147
147
 
148
+ def docker_group_id
149
+ @docker_group_id ||= `getent group docker | awk -F: '{ printf $3 }'`
150
+ end
151
+
148
152
  def user_id
149
153
  @user_id ||= `id -g`
150
154
  end
@@ -164,6 +168,7 @@ module Devkitkat
164
168
  prepare!(['chown', "#{user_name}:#{user_name}", ROOT_IN_CONTAINER])
165
169
  prepare!(['chown', '-R', "#{user_name}:#{user_name}", "#{ROOT_IN_CONTAINER}/services/#{service.name}"])
166
170
  prepare!(['usermod', '-aG', 'docker', user_name])
171
+ prepare!(['groupmod', '-g', docker_group_id, 'docker'])
167
172
  end
168
173
 
169
174
  def prepare!(cmds, params = {})
@@ -2,14 +2,20 @@ module Devkitkat
2
2
  class Service
3
3
  class PredefinedCommand
4
4
  class Pull < Base
5
+ DEFAULT_REPO_REF = 'master'.freeze
6
+
5
7
  def to_script
6
8
  <<~EOS
7
9
  cd #{service.src_dir}
8
- git checkout master
9
- git pull origin master
10
+ git checkout #{repo_ref}
11
+ git pull origin #{repo_ref}
10
12
  EOS
11
13
  end
12
14
 
15
+ def repo_ref
16
+ service.repo_ref || DEFAULT_REPO_REF
17
+ end
18
+
13
19
  def available?
14
20
  service.repo_defined?
15
21
  end
@@ -0,0 +1,21 @@
1
+ module Devkitkat
2
+ class Service
3
+ class PredefinedCommand
4
+ class StartContainer < Base
5
+ def to_script
6
+ <<~EOS
7
+ tail -f
8
+ EOS
9
+ end
10
+
11
+ def available?
12
+ true
13
+ end
14
+
15
+ def machine_driver
16
+ 'docker'
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Devkitkat
2
- VERSION = "0.1.30"
2
+ VERSION = "0.1.35"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devkitkat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinya Maeda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: 2.1.4
20
20
  type: :development
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: '1.17'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.34.2
159
+ version: 2.0.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.34.2
166
+ version: 2.0.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: require_all
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -230,6 +230,7 @@ files:
230
230
  - lib/devkitkat/service/predefined_command/reconfigure.rb
231
231
  - lib/devkitkat/service/predefined_command/remove_containers.rb
232
232
  - lib/devkitkat/service/predefined_command/show_variables.rb
233
+ - lib/devkitkat/service/predefined_command/start_container.rb
233
234
  - lib/devkitkat/version.rb
234
235
  homepage: https://gitlab.com/dosuken123/devkitkat
235
236
  licenses:
@@ -250,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
251
  - !ruby/object:Gem::Version
251
252
  version: '0'
252
253
  requirements: []
253
- rubygems_version: 3.0.3
254
+ rubygems_version: 3.1.4
254
255
  signing_key:
255
256
  specification_version: 4
256
257
  summary: Make micro services easy