Module: Uffizzi::ConnectHelper

Defined in:
lib/uffizzi/helpers/connect_helper.rb

Class Method Summary collapse

Class Method Details

.get_acr_data(options) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/uffizzi/helpers/connect_helper.rb', line 21

def get_acr_data(options)
  registry_url = options[:registry] || ENV['ACR_REGISTRY_URL'] || Uffizzi.ui.ask('Registry Domain:')
  username = options[:username] || ENV['ACR_USERNAME'] || Uffizzi.ui.ask('Docker ID:')
  password = options[:password] || ENV['ACR_PASSWORD'] || Uffizzi.ui.ask('Password/Access Token:', echo: false)

  [registry_url, username, password]
end

.get_docker_hub_data(options) ⇒ Object



14
15
16
17
18
19
# File 'lib/uffizzi/helpers/connect_helper.rb', line 14

def get_docker_hub_data(options)
  username = options[:username] || ENV['DOCKERHUB_USERNAME'] || Uffizzi.ui.ask('Username:')
  password = options[:password] || ENV['DOCKERHUB_PASSWORD'] || Uffizzi.ui.ask('Password:', echo: false)

  [username, password]
end

.get_docker_registry_data(options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/uffizzi/helpers/connect_helper.rb', line 6

def get_docker_registry_data(options)
  registry_url = options[:registry] || ENV['DOCKER_REGISTRY_URL'] || Uffizzi.ui.ask('Registry Domain:')
  username = options[:username] || ENV['DOCKER_REGISTRY_USERNAME'] || Uffizzi.ui.ask('Username:')
  password = options[:password] || ENV['DOCKER_REGISTRY_PASSWORD'] || Uffizzi.ui.ask('Password:', echo: false)

  [registry_url, username, password]
end

.get_ecr_data(options) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/uffizzi/helpers/connect_helper.rb', line 29

def get_ecr_data(options)
  registry_url = options[:registry] || ENV['AWS_REGISTRY_URL'] || Uffizzi.ui.ask('Registry Domain:')
  access_key_id = options[:id] || ENV['AWS_ACCESS_KEY_ID'] || Uffizzi.ui.ask('Access key ID:')
  secret_access_key = options[:secret] || ENV['AWS_SECRET_ACCESS_KEY'] || Uffizzi.ui.ask('Secret access key:', echo: false)

  [registry_url, access_key_id, secret_access_key]
end

.get_ghcr_data(options) ⇒ Object



37
38
39
40
41
42
# File 'lib/uffizzi/helpers/connect_helper.rb', line 37

def get_ghcr_data(options)
  username = options[:username] || ENV['GITHUB_USERNAME'] || Uffizzi.ui.ask('Github Username:')
  password = options[:token] || ENV['GITHUB_ACCESS_TOKEN'] || Uffizzi.ui.ask('Access Token:', echo: false)

  [username, password]
end