dockerapi 0.18.0 → 0.20.0.pre.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4117775ffcd9a7ba657bbea943fd20e52de1907fcf3174850a48b8ede27a7acf
4
- data.tar.gz: 6d7a725d087401b8d1a2806e6deee5066ed6ad3bc8f195ffcda1321b3fc2252b
3
+ metadata.gz: ec38ed78e97d2efa65198915b8e5880daad75e3f01e88636ee3350fbf428e815
4
+ data.tar.gz: 4ba1e53f3da7a273c46dd2c72ee22f0ad0902800ab39deaa0aea22e284dfdf1f
5
5
  SHA512:
6
- metadata.gz: 158707ec44efb0d7ac3123e988c670af94cd9ad054bf47dfbf6d75c2ffd516f87f85296f9732a98213913e1b827dc3de582fff7fabc25f4c359c50f704b6f1ea
7
- data.tar.gz: 62b262e3d7fcffaaa1cec28f6dd9246619abfecfcd88b85fd90e2f18fc46806135fc17c149dc26e5a5687b4e426b5a98ad60e87b8763af4949f096280d3b229c
6
+ metadata.gz: 25ebe5a684d88813f59ce85a6ff64cd03e9b9c3ffc2ffba43f23fe4a40f6c58770a4a8e836dbac04fd212ff5d3261709726722dbc4369328130a753bdf9cf665
7
+ data.tar.gz: edd39fdc14951da6affc693dbcca46e4f488e54ad7fdb47ea2d3e08f9d1df1f87982174b4834867d915701bd55f813fa1e85c89f950a389c34c684baf4efc409
@@ -5,21 +5,18 @@
5
5
  # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
6
  # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
7
 
8
- name: Ruby
8
+ name: CD
9
9
 
10
10
  on:
11
11
  push:
12
12
  branches: [ master ]
13
- pull_request:
14
- branches: [ master ]
15
13
 
16
14
  jobs:
17
- test:
18
-
15
+ release:
19
16
  runs-on: ubuntu-latest
20
17
 
21
18
  steps:
22
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v3
23
20
  - name: Set up Ruby
24
21
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
22
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
@@ -27,9 +24,9 @@ jobs:
27
24
  uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
28
25
  with:
29
26
  ruby-version: 2.6
30
- - name: Install Docker
31
- run: curl https://get.docker.com | sh
32
- - name: Install dependencies
33
- run: bin/setup && sudo bin/setup
34
- - name: Run tests
35
- run: rake spec
27
+ - name: Release
28
+ run: |
29
+ TAG=$(rake version | tr -d '"')
30
+ git tag $TAG
31
+ git push --tags
32
+ gh release create $TAG --generate-notes
@@ -0,0 +1,65 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ pull_request:
12
+ branches: [ master ]
13
+
14
+ jobs:
15
+ test:
16
+
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - name: Set up Ruby
22
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
23
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
24
+ # uses: ruby/setup-ruby@v1
25
+ uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
26
+ with:
27
+ ruby-version: 2.6
28
+ - name: Install Docker
29
+ run: curl https://get.docker.com | sh
30
+ - name: Install dependencies
31
+ run: |
32
+ bin/setup
33
+ sudo bin/setup
34
+ - name: Test misc
35
+ run: rspec spec/misc/*.rb
36
+ - name: Test Image
37
+ run: rspec spec/endpoints/image_spec.rb:1
38
+ - name: Test Image authentication
39
+ run: rspec spec/endpoints/image_spec.rb:196
40
+ continue-on-error: true
41
+ - name: Test Container
42
+ run: rspec spec/endpoints/container_spec.rb
43
+ - name: Test Volume
44
+ run: rspec spec/endpoints/volume_spec.rb
45
+ - name: Test Network
46
+ run: rspec spec/endpoints/network_spec.rb
47
+ - name: Test System
48
+ run: rspec spec/endpoints/system_spec.rb
49
+ - name: Test Exec
50
+ run: rspec spec/endpoints/exec_spec.rb
51
+ - name: Test Swarm
52
+ run: rspec spec/endpoints/swarm_spec.rb
53
+ - name: Test Node
54
+ run: rspec spec/endpoints/node_spec.rb
55
+ - name: Test Service
56
+ run: rspec spec/endpoints/service_spec.rb
57
+ - name: Test Task
58
+ run: rspec spec/endpoints/task_spec.rb
59
+ - name: Test Secret
60
+ run: rspec spec/endpoints/secret_spec.rb
61
+ - name: Test Config
62
+ run: rspec spec/endpoints/config_spec.rb
63
+ - name: Test Plugin
64
+ run: rspec spec/endpoints/plugin_spec.rb
65
+
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dockerapi (0.18.0)
5
- excon (~> 0.76)
4
+ dockerapi (0.19.0)
5
+ excon (~> 0.79)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  diff-lcs (1.3)
11
- excon (0.76.0)
11
+ excon (0.79.0)
12
12
  rake (12.3.3)
13
13
  rspec (3.9.0)
14
14
  rspec-core (~> 3.9.0)
data/README.md CHANGED
@@ -567,7 +567,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
567
567
 
568
568
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
569
569
 
570
- ### Release nre version
570
+ ### Release new version
571
571
 
572
572
  * Update CHANGELOG.
573
573
  * Update README as needed.
data/Rakefile CHANGED
@@ -4,3 +4,7 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ task :version do
9
+ p "v#{Docker::API::GEM_VERSION}"
10
+ end
data/bin/setup CHANGED
@@ -20,7 +20,7 @@ else
20
20
  bundle install
21
21
 
22
22
  echo "Creating self-signed certificate to use in tests"
23
- openssl req -newkey rsa:2048 -nodes -keyout resources/registry_authentication/registry_auth.key -x509 -days 365 -out resources/registry_authentication/registry_auth.crt -subj "/C=CL/ST=Santiago/L=Santiago/O=dockerapi/OU=dockerapi/CN=dockerapi"
23
+ openssl req -newkey rsa:2048 -nodes -keyout resources/registry_authentication/registry_auth.key -x509 -days 365 -out resources/registry_authentication/registry_auth.crt -subj "/C=CL/ST=Santiago/L=Santiago/O=dockerapi/OU=dockerapi/CN=localhost"
24
24
 
25
25
  echo "Creating htpasswd file to use in tests"
26
26
  docker run --rm --entrypoint htpasswd registry:2.7.0 -Bbn janedoe password > resources/registry_authentication/htpasswd
data/dockerapi.gemspec CHANGED
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency("excon", "~> 0.76")
29
+ spec.add_dependency("excon", "~> 0.79")
30
30
  end
@@ -10,7 +10,9 @@ class Docker::API::Connection
10
10
  #
11
11
  # @param params [Hash]: Request parameters.
12
12
  def request params
13
- Docker::API::Response.new(@connection.request(params).data)
13
+ response = Docker::API::Response.new(@connection.request(params).data)
14
+ p response if Docker::API::PRINT_RESPONSE_TO_STDOUT
15
+ response
14
16
  end
15
17
 
16
18
  ##
@@ -58,8 +58,8 @@ class Docker::API::System < Docker::API::Base
58
58
  #
59
59
  # Docker API: GET /system/df
60
60
  # @see https://docs.docker.com/engine/api/v1.40/#operation/SystemDataUsage
61
- def df
62
- @connection.get("/system/df")
61
+ def df params = {}
62
+ @connection.get(build_path("/system/df", params))
63
63
  end
64
64
 
65
65
  end
@@ -1,8 +1,8 @@
1
1
  module Docker
2
2
  module API
3
- GEM_VERSION = "0.18.0"
3
+ GEM_VERSION = "0.20.0-rc2"
4
4
 
5
- API_VERSION = "1.40"
5
+ API_VERSION = "1.43"
6
6
 
7
7
  VERSION = "Gem: #{Docker::API::GEM_VERSION} | API: #{Docker::API::API_VERSION}"
8
8
  end
data/lib/dockerapi.rb CHANGED
@@ -29,20 +29,24 @@ module Docker
29
29
  # This variable controls output verbosity.
30
30
  PRINT_TO_STDOUT = true
31
31
 
32
+ ##
33
+ # This variable controls output verbosity.
34
+ PRINT_RESPONSE_TO_STDOUT = false
35
+
32
36
  ##
33
37
  # Valid values for parameter validations.
34
38
  VALID_PARAMS = {
35
39
  "Docker::API::Image" => {
36
40
  "build" => [:dockerfile, :t, :extrahosts, :remote, :q, :nocache, :cachefrom, :pull, :rm, :forcerm, :memory, :memswap, :cpushares, :cpusetcpus, :cpuperiod, :cpuquota, :buildargs, :shmsize, :squash, :labels, :networkmode, :platform, :target, :outputs],
37
41
  "prune" => [:filters],
38
- "list" => [:all, :filters, :digests],
42
+ "list" => [:all, :filters, "shared-size", :digests],
39
43
  "search" => [:term, :limit, :filters],
40
44
  "tag" => [:repo, :tag],
41
45
  "remove" => [:force, :noprune],
42
46
  "import" => [:quiet],
43
47
  "push" => [:tag],
44
48
  "commit" => [:container, :repo, :tag, :comment, :author, :pause, :changes],
45
- "create" => [:fromImage, :fromSrc, :repo, :tag, :message, :platform],
49
+ "create" => [:fromImage, :fromSrc, :repo, :tag, :message, :changes, :platform],
46
50
  "delete_cache" => [:all, "keep-storage", :filters]
47
51
  },
48
52
  "Docker::API::Container" => {
@@ -50,8 +54,8 @@ module Docker
50
54
  "details" => [:size],
51
55
  "top" => [:ps_args],
52
56
  "start" => [:detachKeys],
53
- "stop" => [:t],
54
- "restart" => [:t],
57
+ "stop" => [:signal, :t],
58
+ "restart" => [:signal, :t],
55
59
  "kill" => [:signal],
56
60
  "wait" => [:condition],
57
61
  "rename" => [:name],
@@ -60,10 +64,10 @@ module Docker
60
64
  "remove" => [:v, :force, :link],
61
65
  "logs" => [:follow, :stdout, :stderr, :since, :until, :timestamps, :tail],
62
66
  "attach" => [:detachKeys, :logs, :stream, :stdin, :stdout, :stderr],
63
- "stats" => [:stream],
67
+ "stats" => [:stream, "one-shot"],
64
68
  "get_archive" => [:path],
65
69
  "put_archive" => [:path, :noOverwriteDirNonDir, :copyUIDGID],
66
- "create" => [:name]
70
+ "create" => [:name, :platform]
67
71
  },
68
72
  "Docker::API::Volume" => {
69
73
  "list" => [:filters],
@@ -76,7 +80,8 @@ module Docker
76
80
  "prune" => [:filters]
77
81
  },
78
82
  "Docker::API::System" => {
79
- "events" => [:since, :until, :filters]
83
+ "events" => [:since, :until, :filters],
84
+ "df" => [:type]
80
85
  },
81
86
  "Docker::API::Exec" => {
82
87
  "resize" => [:w, :h]
@@ -91,7 +96,7 @@ module Docker
91
96
  "delete" => [:force]
92
97
  },
93
98
  "Docker::API::Service" => {
94
- "list" => [:filters],
99
+ "list" => [:filters, :status],
95
100
  "update" => [:version, :registryAuthFrom, :rollback],
96
101
  "details" => [:insertDefaults],
97
102
  "logs" => [:details, :follow, :stdout, :stderr, :since, :timestamps, :tail]
@@ -126,10 +131,10 @@ module Docker
126
131
  },
127
132
  "Docker::API::Container" => {
128
133
  "create" => [:Hostname,:Domainname,:User,:AttachStdin,:AttachStdout,:AttachStderr,:ExposedPorts,:Tty,:OpenStdin,:StdinOnce,:Env,:Cmd,:HealthCheck,:ArgsEscaped,:Image,:Volumes,:WorkingDir,:Entrypoint,:NetworkDisabled,:MacAddress,:OnBuild,:Labels,:StopSignal,:StopTimeout,:Shell,:HostConfig,:NetworkingConfig],
129
- "update" => [:CpuShares, :Memory, :CgroupParent, :BlkioWeight, :BlkioWeightDevice, :BlkioWeightReadBps, :BlkioWeightWriteBps, :BlkioWeightReadOps, :BlkioWeightWriteOps, :CpuPeriod, :CpuQuota, :CpuRealtimePeriod, :CpuRealtimeRuntime, :CpusetCpus, :CpusetMems, :Devices, :DeviceCgroupRules, :DeviceRequest, :Kernel, :Memory, :KernelMemoryTCP, :MemoryReservation, :MemorySwap, :MemorySwappiness, :NanoCPUs, :OomKillDisable, :Init, :PidsLimit, :ULimits, :CpuCount, :CpuPercent, :IOMaximumIOps, :IOMaximumBandwidth, :RestartPolicy]
134
+ "update" => [:CpuShares, :Memory, :CgroupParent, :BlkioWeight, :BlkioWeightDevice, :BlkioDeviceReadBps, :BlkioDeviceWriteBps, :BlkioDeviceReadIOps, :BlkioDeviceWriteIOps, :CpuPeriod, :CpuQuota, :CpuRealtimePeriod, :CpuRealtimeRuntime, :CpusetCpus, :CpusetMems, :Devices, :DeviceCgroupRules, :DeviceRequest, :Memory, :KernelMemoryTCP, :MemoryReservation, :MemorySwap, :MemorySwappiness, :NanoCPUs, :OomKillDisable, :Init, :PidsLimit, :ULimits, :CpuCount, :CpuPercent, :IOMaximumIOps, :IOMaximumBandwidth, :RestartPolicy]
130
135
  },
131
136
  "Docker::API::Volume" => {
132
- "create" => [:Name, :Driver, :DriverOpts, :Labels]
137
+ "create" => [:Name, :Driver, :DriverOpts, :Labels, :ClusterVolumeSpec]
133
138
  },
134
139
  "Docker::API::Network" => {
135
140
  "create" => [:Name, :CheckDuplicate, :Driver, :Internal, :Attachable, :Ingress, :IPAM, :EnableIPv6, :Options, :Labels],
@@ -140,8 +145,8 @@ module Docker
140
145
  "auth" => [:username, :password, :email, :serveraddress, :identitytoken]
141
146
  },
142
147
  "Docker::API::Exec" => {
143
- "create" => [:AttachStdin, :AttachStdout, :AttachStderr, :DetachKeys, :Tty, :Env, :Cmd, :Privileged, :User, :WorkingDir],
144
- "start" => [:Detach, :Tty]
148
+ "create" => [:AttachStdin, :AttachStdout, :AttachStderr, :ConsoleSize, :DetachKeys, :Tty, :Env, :Cmd, :Privileged, :User, :WorkingDir],
149
+ "start" => [:Detach, :Tty, :ConsoleSize]
145
150
  },
146
151
  "Docker::API::Swarm" => {
147
152
  "init" => [:ListenAddr, :AdvertiseAddr, :DataPathAddr, :DataPathPort, :DefaultAddrPool, :ForceNewCluster, :SubnetSize, :Spec],
@@ -162,7 +167,7 @@ module Docker
162
167
  },
163
168
  "Docker::API::Config" => {
164
169
  "create" => [:Name, :Labels, :Data, :Templating],
165
- "update" => [:Name, :Labels, :Data, :Driver, :Templating]
170
+ "update" => [:Name, :Labels, :Data, :Templating]
166
171
  }
167
172
  }
168
173
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.20.0.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alysson A. Costa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-09 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.76'
19
+ version: '0.79'
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.76'
26
+ version: '0.79'
27
27
  description: Interact with Docker API directly from Ruby code. Comprehensive implementation
28
28
  (all available endpoints), no local Docker installation required, easily manipulated
29
29
  http responses.
@@ -33,7 +33,8 @@ executables: []
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
- - ".github/workflows/ruby.yml"
36
+ - ".github/workflows/cd.yml"
37
+ - ".github/workflows/ci.yml"
37
38
  - ".gitignore"
38
39
  - ".rspec"
39
40
  - CHANGELOG.md
@@ -83,11 +84,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
84
  version: 2.3.0
84
85
  required_rubygems_version: !ruby/object:Gem::Requirement
85
86
  requirements:
86
- - - ">="
87
+ - - ">"
87
88
  - !ruby/object:Gem::Version
88
- version: '0'
89
+ version: 1.3.1
89
90
  requirements: []
90
- rubygems_version: 3.1.2
91
+ rubygems_version: 3.3.5
91
92
  signing_key:
92
93
  specification_version: 4
93
94
  summary: Interact with Docker API from Ruby code.