class NexusAPI::Upload

Attributes

api[RW]

Public Instance Methods

docker() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 10
def docker
  setup
  if_file_exists?(file: options[:image].to_s + ':' + options[:docker_tag].to_s, repository: ENV['DOCKER_PUSH_HOSTNAME']) do
    @api.upload_docker_component(
      image: options[:image],
      tag: options[:docker_tag]
    )
  end
end
maven() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 27
def maven
  return false unless repository_set?
  set(repository: :maven_repository)
  if_file_exists? do
    @api.upload_maven_component(
      filename: options[:filename],
      group_id: options[:group_id],
      artifact_id: options[:artifact_id],
      version: options[:version],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end
npm() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 46
def npm
  return false unless repository_set?
  set(repository: :npm_repository)
  if_file_exists? do
    @api.upload_npm_component(
      filename: options[:filename],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end
pypi() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 62
def pypi
  return false unless repository_set?
  set(repository: :pypi_repository)
  if_file_exists? do
    @api.upload_pypi_component(
      filename: options[:filename],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end
raw() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 79
def raw
  return false unless repository_set?
  set(repository: :raw_repository)
  if_file_exists? do
    @api.upload_raw_component(
      filename: options[:filename],
      directory: options[:directory],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end
rubygems() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 96
def rubygems
  return false unless repository_set?
  set(repository: :rubygems_repository)
  if_file_exists? do
    @api.upload_rubygems_component(
      filename: options[:filename],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end
yum() click to toggle source
# File lib/nexus_api/cli_commands/upload.rb, line 113
def yum
  return false unless repository_set?
  set(repository: :yum_repository)
  if_file_exists? do
    @api.upload_yum_component(
      filename: options[:filename],
      directory: options[:directory],
      repository: options[:repository],
      tag: options[:tag],
    )
  end
end