getv 1.3.1 → 1.4.0

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: 76b665201a4d7f1ecdaa9047121a3b4fece0805d5de821b9acf636cc9f82a506
4
- data.tar.gz: 620003975f2b25a1d6df14edfda536e7710cfbcbd6ab4f329c710c4ee820a281
3
+ metadata.gz: 03d655407021c76e4df2c9ece13fb42e6447f597f9492d240901e49442144e43
4
+ data.tar.gz: 6f48191ff06387bfea424457ee41fd5f514cda257c1341ecba87eb82c7237279
5
5
  SHA512:
6
- metadata.gz: 61f05289eca59aab2435330d79d849876cf2e3d160d214899a4644c11cba109a4337a5b9bac8c905a54e020b06362201befe63302a5d513efe4f07e82c2fc6fb
7
- data.tar.gz: 56c9e45f319a0bd94bd27b15053f782731b0f08d6b94c55fbfc8d449b80a3fb8deb96af6fd7e51403305b4875f0231986bb114834b069e243027df56a4f671aa
6
+ metadata.gz: 56d72bdde2f6f8aceb8d0844e30fda53e428efebe748ea8bb98848943f5bad319ff566f2d8d6fde7b71812dbf40bb13b29094d00f6296fb6d88e7910e37b7bd5
7
+ data.tar.gz: ecd3ee651658cf63c659a4195dc5f0e7e5d113d963d82f68f1ead2f9ad74cdb76c75f65f6b7c3578da40e96bae39fc296f6db9b6953650044d4ea8b15d86c719
data/exe/getv CHANGED
@@ -35,7 +35,7 @@ class App # rubocop:disable Metrics/ClassLength
35
35
  switch %i[l latest], desc: 'Latest version', negatable: false
36
36
  switch %i[j json], desc: 'Output in json', negatable: false
37
37
 
38
- desc 'Get package versions from a Docker or OCI container image registry'
38
+ desc 'Get package versions from a Docker or OCI container image registry. Set environment variables $DOCKER_PROXY, $DOCKER_USER and $DOCKER_PASSWORD if required.' # rubocop:disable Layout/LineLength
39
39
  arg_name 'package_name'
40
40
  command :docker do |c|
41
41
  defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
data/lib/getv/package.rb CHANGED
@@ -89,9 +89,15 @@ module Getv
89
89
 
90
90
  private
91
91
 
92
- def versions_using_docker
92
+ def versions_using_docker # rubocop:disable Metrics/AbcSize
93
93
  require 'docker_registry2'
94
- docker = DockerRegistry2.connect(opts[:url])
94
+ docker_opts = {}
95
+ docker_opts[:http_options] = { proxy: ENV['DOCKER_PROXY'] } if ENV['DOCKER_PROXY']
96
+ if ENV['DOCKER_USER'] && ENV['DOCKER_PASSWORD']
97
+ docker_opts[:user] = ENV['DOCKER_USER']
98
+ docker_opts[:password] = ENV['DOCKER_PASSWORD']
99
+ end
100
+ docker = DockerRegistry2.connect(opts[:url], docker_opts)
95
101
  docker.tags("#{opts[:owner]}/#{opts[:repo]}")['tags']
96
102
  end
97
103
 
data/lib/getv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Getv
4
- VERSION = '1.3.1'
4
+ VERSION = '1.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - harbottle