pinject 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/pinject/docker.rb +8 -7
- data/lib/pinject/version.rb +1 -1
- data/pinject.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6271c0367bf816f2f1729deca146efbc20a80fc2d2e2850fb55f13d15aaf3a1a
|
4
|
+
data.tar.gz: f8dda7a4f39e9a70fbaef42e2a4d02418cea19dcea8efaf56e0c90576cb3516d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107296960c0fa9b257c205011218f12f35c00e837749877474481e7a8da2eccb7fe6707df8c503ccad24ac17c13a932014eb99e48dc88cd16107fe2b3ad52619
|
7
|
+
data.tar.gz: 83bed08e3402fb1779e4878ed59fd35951df4dfdc88fe6eba1ea5241c69401ba7439d70ae4bd3d7f4b4d9152c195d35bb3bb072d7a7baa5a8fcd1545a7918c23
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2021-12-
|
3
|
+
# on 2021-12-27 07:20:52 UTC using RuboCop version 1.23.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -23,17 +23,17 @@ Lint/AssignmentInCondition:
|
|
23
23
|
# Offense count: 3
|
24
24
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
25
25
|
Metrics/AbcSize:
|
26
|
-
Max:
|
26
|
+
Max: 19
|
27
27
|
|
28
28
|
# Offense count: 1
|
29
29
|
# Configuration parameters: CountComments, CountAsOne.
|
30
30
|
Metrics/ClassLength:
|
31
|
-
Max:
|
31
|
+
Max: 122
|
32
32
|
|
33
33
|
# Offense count: 4
|
34
34
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
35
35
|
Metrics/MethodLength:
|
36
|
-
Max:
|
36
|
+
Max: 20
|
37
37
|
|
38
38
|
# Offense count: 2
|
39
39
|
# Configuration parameters: ForbiddenDelimiters.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
you can inject os update command to some docker images.
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
image = Pinject.new("ubuntu:latest")
|
26
|
+
image = Pinject::Docker.new("ubuntu:latest")
|
27
27
|
inject_image = image.inject_build("pyama:ubuntu_inject") # run apt-get upgrade
|
28
28
|
inject_image.push
|
29
29
|
```
|
data/lib/pinject/docker.rb
CHANGED
@@ -7,11 +7,13 @@ module Pinject
|
|
7
7
|
class Docker
|
8
8
|
attr_reader :log
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if %w[DOCKER_USER DOCKER_PASSWORD DOCKER_REGISTRY].all? { |a| ENV[a] }
|
11
|
+
::Docker.authenticate!(
|
12
|
+
'username' => ENV['DOCKER_USER'],
|
13
|
+
'password' => ENV['DOCKER_PASSWORD'],
|
14
|
+
'serveraddress' => ENV['DOCKER_REGISTRY']
|
15
|
+
)
|
16
|
+
end
|
15
17
|
|
16
18
|
def initialize(image_name, log: false)
|
17
19
|
@image_name = image_name
|
@@ -51,9 +53,8 @@ module Pinject
|
|
51
53
|
})
|
52
54
|
|
53
55
|
result = nil
|
54
|
-
t = Thread.new { container.attach { |stream, chunk| result = chunk.chomp if stream == :stdout } }
|
55
56
|
container.start
|
56
|
-
|
57
|
+
container.streaming_logs(stdout: true) { |stream, chunk| result = chunk.chomp if stream == :stdout }
|
57
58
|
|
58
59
|
if result
|
59
60
|
dist, version, user = result.split(%r{:|/})
|
data/lib/pinject/version.rb
CHANGED
data/pinject.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.metadata['source_code_uri'] = 'https://github.com/pyama86/pinject'
|
19
19
|
spec.metadata['changelog_uri'] = 'https://github.com/pyama86/pinject/CHANGELOG.md'
|
20
20
|
|
21
|
-
spec.files
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
22
|
spec.bindir = 'exe'
|
23
23
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pyama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|