kpm 0.9.0 → 0.10.0
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 +4 -4
- data/.gitignore +1 -0
- data/README.adoc +23 -3
- data/kpm.gemspec +1 -0
- data/lib/kpm/nexus_helper/actions.rb +8 -1
- data/lib/kpm/nexus_helper/cloudsmith_api_calls.rb +83 -0
- data/lib/kpm/plugins_directory.yml +5 -1
- data/lib/kpm/tasks.rb +20 -4
- data/lib/kpm/version.rb +1 -1
- data/pom.xml +211 -40
- data/spec/kpm/remote/cloudsmith_api_calls_spec.rb +40 -0
- metadata +18 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ee0a0c6bd9401fa083710541772db690618749d31ea65a6531aee02bfcbc075b
         | 
| 4 | 
            +
              data.tar.gz: b46b7a3777be07cd3b6ca5be05ef5c76504e4c8ca7e54938487c42b017b251c7
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f1d274c79ad9762432a649c144d32f4365cc93ab57f841a58293c666d432895056872882b1edee2b1e6493e83a5f27d719825f490f8ca594188c906665253cf4
         | 
| 7 | 
            +
              data.tar.gz: 9fbe10b774582a2bf60f534b134d1180109efcd18ff8dc6cc901de74a4e9ee1ee8e11416c5848cee4a7658b3703c67d2c93c590804ec9a25500e9902a7f6189d
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/README.adoc
    CHANGED
    
    | @@ -14,8 +14,9 @@ toc::[] | |
| 14 14 |  | 
| 15 15 | 
             
            [[pre-built-binaries-recommended]]
         | 
| 16 16 | 
             
            === Pre-built binaries (recommended)
         | 
| 17 | 
            +
            image:https://img.shields.io/maven-central/v/org.kill-bill.billing.installer/kpm?color=blue&label=kpm[kpm]
         | 
| 17 18 |  | 
| 18 | 
            -
            KPM self-contained builds are available on http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.installer%22%20AND%20a%3A%22kpm%22[Maven Central] with coordinates `org.kill-bill.billing.installer:kpm`.
         | 
| 19 | 
            +
            On Linux and MacOS, you can use the pre-built binaries. KPM self-contained builds are available on http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.installer%22%20AND%20a%3A%22kpm%22[Maven Central] with coordinates `org.kill-bill.billing.installer:kpm`.
         | 
| 19 20 |  | 
| 20 21 | 
             
            Download the `.tar.gz` package matching your architecture (Linux and MacOS only).
         | 
| 21 22 |  | 
| @@ -23,8 +24,13 @@ Note that this installation method assumes `/bin/bash` to be available on your s | |
| 23 24 |  | 
| 24 25 | 
             
            [[through-rubygems]]
         | 
| 25 26 | 
             
            === Through Rubygems
         | 
| 27 | 
            +
            image:https://img.shields.io/gem/v/kpm?color=blue&label=kpm[kpm]
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            On Windows, you can install KPM via https://rubygems.org/gems/kpm[RubyGems.org]. For this, you need to first install Ruby. Ruby can be installed via https://rubyinstaller.org/[RubyInstaller]. Once installed, you can run the following command to install KPM:
         | 
| 30 | 
            +
            [source,bash]
         | 
| 31 | 
            +
            gem install kpm 
         | 
| 32 | 
            +
             | 
| 26 33 |  | 
| 27 | 
            -
            KPM is also available on https://rubygems.org/gems/kpm[RubyGems.org].
         | 
| 28 34 |  | 
| 29 35 | 
             
            [[kpm-commands]]
         | 
| 30 36 | 
             
            == KPM Commands
         | 
| @@ -249,7 +255,7 @@ Notes: | |
| 249 255 | 
             
            [[gh-packages]]
         | 
| 250 256 | 
             
            ### GitHub Packages
         | 
| 251 257 |  | 
| 252 | 
            -
             | 
| 258 | 
            +
            Starting with version 0.9.0, experimental support for GitHub packages has been added:
         | 
| 253 259 |  | 
| 254 260 | 
             
            ....
         | 
| 255 261 | 
             
            kpm install_java_plugin acme:plugin \
         | 
| @@ -260,3 +266,17 @@ kpm install_java_plugin acme:plugin \ | |
| 260 266 | 
             
            ....
         | 
| 261 267 |  | 
| 262 268 | 
             
            Replace `TOKEN` with a GitHub personal access token.
         | 
| 269 | 
            +
             | 
| 270 | 
            +
            [[cloudsmith]]
         | 
| 271 | 
            +
            ### Cloudsmith
         | 
| 272 | 
            +
             | 
| 273 | 
            +
            Starting with version 0.10.0, experimental support for Cloudsmith has been added:
         | 
| 274 | 
            +
             | 
| 275 | 
            +
            ....
         | 
| 276 | 
            +
            kpm pull_kb_server_war 0.22.21-SNAPSHOT \
         | 
| 277 | 
            +
                    --overrides url:https://dl.cloudsmith.io/<TOKEN>/<ORG>/<REPO>/maven \
         | 
| 278 | 
            +
                    --group-id org.kill-bill.billing \
         | 
| 279 | 
            +
                    --artifact-id killbill-profiles-killbill
         | 
| 280 | 
            +
            ....
         | 
| 281 | 
            +
             | 
| 282 | 
            +
            Replace `TOKEN` with a Cloudsmith entitlement token, and specify the right `ORG` and `REPO`.
         | 
    
        data/kpm.gemspec
    CHANGED
    
    | @@ -46,6 +46,7 @@ Gem::Specification.new do |s| | |
| 46 46 | 
             
              s.add_dependency 'rubyzip', '~>1.2.0'
         | 
| 47 47 | 
             
              s.add_dependency 'thor', '~> 0.19.1'
         | 
| 48 48 |  | 
| 49 | 
            +
              s.add_development_dependency 'gem-release', '~> 2.2'
         | 
| 49 50 | 
             
              s.add_development_dependency 'rake', '~> 13.0'
         | 
| 50 51 | 
             
              s.add_development_dependency 'rspec', '~> 3.9'
         | 
| 51 52 | 
             
              s.add_development_dependency 'rubocop', '~> 0.88.0' if RUBY_VERSION >= '2.4'
         | 
| @@ -2,6 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            require_relative 'nexus_api_calls_v2'
         | 
| 4 4 | 
             
            require_relative 'github_api_calls'
         | 
| 5 | 
            +
            require_relative 'cloudsmith_api_calls'
         | 
| 5 6 |  | 
| 6 7 | 
             
            module KPM
         | 
| 7 8 | 
             
              module NexusFacade
         | 
| @@ -29,7 +30,13 @@ module KPM | |
| 29 30 |  | 
| 30 31 | 
             
                    @logger = logger
         | 
| 31 32 |  | 
| 32 | 
            -
                    @nexus_api_call = overrides[:url].start_with?('https://maven.pkg.github.com') | 
| 33 | 
            +
                    @nexus_api_call = if overrides[:url].start_with?('https://maven.pkg.github.com')
         | 
| 34 | 
            +
                                        GithubApiCalls.new(overrides, ssl_verify, logger)
         | 
| 35 | 
            +
                                      elsif overrides[:url].start_with?('https://dl.cloudsmith.io')
         | 
| 36 | 
            +
                                        CloudsmithApiCalls.new(overrides, ssl_verify, logger)
         | 
| 37 | 
            +
                                      else
         | 
| 38 | 
            +
                                        NexusApiCallsV2.new(overrides, ssl_verify, logger)
         | 
| 39 | 
            +
                                      end
         | 
| 33 40 | 
             
                  end
         | 
| 34 41 |  | 
| 35 42 | 
             
                  def pull_artifact(coordinates, destination = nil)
         | 
| @@ -0,0 +1,83 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'net/http'
         | 
| 4 | 
            +
            require 'uri'
         | 
| 5 | 
            +
            require 'rexml/document'
         | 
| 6 | 
            +
            require 'openssl'
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            module KPM
         | 
| 9 | 
            +
              module NexusFacade
         | 
| 10 | 
            +
                class CloudsmithApiCalls < NexusApiCallsV2
         | 
| 11 | 
            +
                  def pull_artifact_endpoint(coordinates)
         | 
| 12 | 
            +
                    version_artifact_details = parent_get_artifact_info(coordinates)
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    # For SNAPSHOTs, we need to figure out the version used as part of the filename
         | 
| 15 | 
            +
                    filename_version = begin
         | 
| 16 | 
            +
                                         REXML::Document.new(version_artifact_details).elements['//versioning/snapshotVersions/snapshotVersion[1]/value'].text
         | 
| 17 | 
            +
                                       rescue StandardError
         | 
| 18 | 
            +
                                         nil
         | 
| 19 | 
            +
                                       end
         | 
| 20 | 
            +
                    coords = parse_coordinates(coordinates)
         | 
| 21 | 
            +
                    coords[:version] = filename_version unless filename_version.nil?
         | 
| 22 | 
            +
                    new_coordinates = coords.values.compact.join(':')
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                    base_path, versioned_artifact, = build_base_path_and_coords(new_coordinates)
         | 
| 25 | 
            +
                    "#{base_path}/#{versioned_artifact}"
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                  alias parent_get_artifact_info get_artifact_info
         | 
| 29 | 
            +
                  def get_artifact_info(coordinates)
         | 
| 30 | 
            +
                    super
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                    _, versioned_artifact, coords = build_base_path_and_coords(coordinates)
         | 
| 33 | 
            +
                    sha1 = get_sha1(coordinates)
         | 
| 34 | 
            +
                    "<artifact-resolution>
         | 
| 35 | 
            +
              <data>
         | 
| 36 | 
            +
                <presentLocally>true</presentLocally>
         | 
| 37 | 
            +
                <groupId>#{coords[:group_id]}</groupId>
         | 
| 38 | 
            +
                <artifactId>#{coords[:artifact_id]}</artifactId>
         | 
| 39 | 
            +
                <version>#{coords[:version]}</version>
         | 
| 40 | 
            +
                <extension>#{coords[:packaging]}</extension>
         | 
| 41 | 
            +
                <snapshot>#{!(coords[:version] =~ /-SNAPSHOT$/).nil?}</snapshot>
         | 
| 42 | 
            +
                <sha1>#{sha1}</sha1>
         | 
| 43 | 
            +
                <repositoryPath>/#{coords[:group_id].gsub('.', '/')}/#{versioned_artifact}</repositoryPath>
         | 
| 44 | 
            +
              </data>
         | 
| 45 | 
            +
            </artifact-resolution>"
         | 
| 46 | 
            +
                  end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                  def get_artifact_info_endpoint(coordinates)
         | 
| 49 | 
            +
                    base_path, _, coords = build_base_path_and_coords(coordinates)
         | 
| 50 | 
            +
                    # Note: we must retrieve the XML for the version, to support SNAPSHOTs
         | 
| 51 | 
            +
                    "#{base_path}/#{coords[:version]}/maven-metadata.xml"
         | 
| 52 | 
            +
                  end
         | 
| 53 | 
            +
             | 
| 54 | 
            +
                  def search_for_artifact_endpoint(_coordinates)
         | 
| 55 | 
            +
                    raise NoMethodError, 'Cloudsmith has no search support'
         | 
| 56 | 
            +
                  end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                  def build_query_params(_coordinates, _what_parameters = nil)
         | 
| 59 | 
            +
                    ''
         | 
| 60 | 
            +
                  end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                  private
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                  def get_sha1(coordinates)
         | 
| 65 | 
            +
                    base_path, versioned_artifact, = build_base_path_and_coords(coordinates)
         | 
| 66 | 
            +
                    endpoint = "#{base_path}/#{versioned_artifact}.sha1"
         | 
| 67 | 
            +
                    get_response_with_retries(coordinates, endpoint, nil)
         | 
| 68 | 
            +
                  end
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                  def build_base_path_and_coords(coordinates)
         | 
| 71 | 
            +
                    coords = parse_coordinates(coordinates)
         | 
| 72 | 
            +
             | 
| 73 | 
            +
                    token_org_and_repo = URI.parse(configuration[:url]).path
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                    [
         | 
| 76 | 
            +
                      "#{token_org_and_repo}/#{coords[:group_id].gsub('.', '/')}/#{coords[:artifact_id]}",
         | 
| 77 | 
            +
                      "#{coords[:version]}/#{coords[:artifact_id]}-#{coords[:version]}.#{coords[:extension]}",
         | 
| 78 | 
            +
                      coords
         | 
| 79 | 
            +
                    ]
         | 
| 80 | 
            +
                  end
         | 
| 81 | 
            +
                end
         | 
| 82 | 
            +
              end
         | 
| 83 | 
            +
            end
         | 
    
        data/lib/kpm/tasks.rb
    CHANGED
    
    | @@ -72,6 +72,22 @@ module KPM | |
| 72 72 | 
             
                      Uninstaller.new(options[:destination]).uninstall_non_default_plugins(options[:dry_run])
         | 
| 73 73 | 
             
                    end
         | 
| 74 74 |  | 
| 75 | 
            +
                    method_option :group_id,
         | 
| 76 | 
            +
                                  type: :string,
         | 
| 77 | 
            +
                                  default: KillbillServerArtifact::KILLBILL_GROUP_ID,
         | 
| 78 | 
            +
                                  desc: 'The Kill Bill war artifact group-id'
         | 
| 79 | 
            +
                    method_option :artifact_id,
         | 
| 80 | 
            +
                                  type: :string,
         | 
| 81 | 
            +
                                  default: KillbillServerArtifact::KILLBILL_ARTIFACT_ID,
         | 
| 82 | 
            +
                                  desc: 'The Kill Bill war artifact id'
         | 
| 83 | 
            +
                    method_option :packaging,
         | 
| 84 | 
            +
                                  type: :string,
         | 
| 85 | 
            +
                                  default: KillbillServerArtifact::KILLBILL_PACKAGING,
         | 
| 86 | 
            +
                                  desc: 'The Kill Bill war packaging'
         | 
| 87 | 
            +
                    method_option :classifier,
         | 
| 88 | 
            +
                                  type: :string,
         | 
| 89 | 
            +
                                  default: KillbillServerArtifact::KILLBILL_CLASSIFIER,
         | 
| 90 | 
            +
                                  desc: 'The Kill Bill war classifier'
         | 
| 75 91 | 
             
                    method_option :destination,
         | 
| 76 92 | 
             
                                  type: :string,
         | 
| 77 93 | 
             
                                  default: nil,
         | 
| @@ -93,10 +109,10 @@ module KPM | |
| 93 109 | 
             
                      installer = BaseInstaller.new(logger,
         | 
| 94 110 | 
             
                                                    options[:overrides],
         | 
| 95 111 | 
             
                                                    options[:ssl_verify])
         | 
| 96 | 
            -
                      response = installer.install_killbill_server( | 
| 97 | 
            -
                                                                    | 
| 98 | 
            -
                                                                    | 
| 99 | 
            -
                                                                    | 
| 112 | 
            +
                      response = installer.install_killbill_server(options[:group_id],
         | 
| 113 | 
            +
                                                                   options[:artifact_id],
         | 
| 114 | 
            +
                                                                   options[:packaging],
         | 
| 115 | 
            +
                                                                   options[:classifier],
         | 
| 100 116 | 
             
                                                                   version,
         | 
| 101 117 | 
             
                                                                   options[:destination],
         | 
| 102 118 | 
             
                                                                   options[:bundles_dir],
         | 
    
        data/lib/kpm/version.rb
    CHANGED
    
    
    
        data/pom.xml
    CHANGED
    
    | @@ -1,45 +1,216 @@ | |
| 1 1 | 
             
            <?xml version="1.0" encoding="UTF-8"?>
         | 
| 2 2 | 
             
            <!--
         | 
| 3 | 
            -
            ~ Copyright 2014 | 
| 4 | 
            -
            ~
         | 
| 5 | 
            -
            ~ | 
| 6 | 
            -
            ~ | 
| 7 | 
            -
            ~ | 
| 8 | 
            -
            ~
         | 
| 9 | 
            -
            ~ | 
| 10 | 
            -
            ~
         | 
| 11 | 
            -
            ~ | 
| 12 | 
            -
            ~ | 
| 13 | 
            -
            ~ | 
| 14 | 
            -
            ~ | 
| 15 | 
            -
            ~ | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 3 | 
            +
              ~ Copyright 2010-2014 Ning, Inc.
         | 
| 4 | 
            +
              ~ Copyright 2014-2020 Groupon, Inc
         | 
| 5 | 
            +
              ~ Copyright 2020-2020 Equinix, Inc
         | 
| 6 | 
            +
              ~ Copyright 2014-2020 The Billing Project, LLC
         | 
| 7 | 
            +
              ~
         | 
| 8 | 
            +
              ~ The Billing Project licenses this file to you under the Apache License, version 2.0
         | 
| 9 | 
            +
              ~ (the "License"); you may not use this file except in compliance with the
         | 
| 10 | 
            +
              ~ License.  You may obtain a copy of the License at:
         | 
| 11 | 
            +
              ~
         | 
| 12 | 
            +
              ~    http://www.apache.org/licenses/LICENSE-2.0
         | 
| 13 | 
            +
              ~
         | 
| 14 | 
            +
              ~ Unless required by applicable law or agreed to in writing, software
         | 
| 15 | 
            +
              ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
         | 
| 16 | 
            +
              ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
         | 
| 17 | 
            +
              ~ License for the specific language governing permissions and limitations
         | 
| 18 | 
            +
              ~ under the License.
         | 
| 19 | 
            +
              -->
         | 
| 18 20 | 
             
            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         | 
| 19 21 | 
             
                     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
         | 
| 20 | 
            -
             | 
| 21 | 
            -
                <groupId>org. | 
| 22 | 
            -
                <artifactId> | 
| 23 | 
            -
                <version> | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 22 | 
            +
                <modelVersion>4.0.0</modelVersion>
         | 
| 23 | 
            +
                <groupId>org.kill-bill.billing.installer</groupId>
         | 
| 24 | 
            +
                <artifactId>kpm</artifactId>
         | 
| 25 | 
            +
                <version>0.10.0</version>
         | 
| 26 | 
            +
                <packaging>pom</packaging>
         | 
| 27 | 
            +
                <name>KPM</name>
         | 
| 28 | 
            +
                <description>KPM: the Kill Bill Package Manager</description>
         | 
| 29 | 
            +
                <url>http://github.com/killbill/killbill-cloud</url>
         | 
| 30 | 
            +
                <inceptionYear>2010</inceptionYear>
         | 
| 31 | 
            +
                <licenses>
         | 
| 32 | 
            +
                    <license>
         | 
| 33 | 
            +
                        <name>Apache License 2.0</name>
         | 
| 34 | 
            +
                        <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
         | 
| 35 | 
            +
                        <distribution>repo</distribution>
         | 
| 36 | 
            +
                    </license>
         | 
| 37 | 
            +
                </licenses>
         | 
| 38 | 
            +
                <developers>
         | 
| 39 | 
            +
                    <developer>
         | 
| 40 | 
            +
                        <id>pierre</id>
         | 
| 41 | 
            +
                        <name>Pierre-Alexandre Meyer</name>
         | 
| 42 | 
            +
                        <email>pierre@mouraf.org</email>
         | 
| 43 | 
            +
                    </developer>
         | 
| 44 | 
            +
                    <developer>
         | 
| 45 | 
            +
                        <id>stephane</id>
         | 
| 46 | 
            +
                        <name>Stephane Brossier</name>
         | 
| 47 | 
            +
                    </developer>
         | 
| 48 | 
            +
                </developers>
         | 
| 49 | 
            +
                <mailingLists>
         | 
| 50 | 
            +
                    <mailingList>
         | 
| 51 | 
            +
                        <name>Kill Bill users</name>
         | 
| 52 | 
            +
                        <subscribe>killbilling-users+subscribe@googlegroups.com</subscribe>
         | 
| 53 | 
            +
                        <unsubscribe>killbilling-users+unsubscribe@googlegroups.com</unsubscribe>
         | 
| 54 | 
            +
                        <post>killbilling-users@googlegroups.com</post>
         | 
| 55 | 
            +
                        <archive>http://groups.google.com/group/killbilling-users</archive>
         | 
| 56 | 
            +
                    </mailingList>
         | 
| 57 | 
            +
                </mailingLists>
         | 
| 58 | 
            +
                <scm>
         | 
| 59 | 
            +
                    <connection>scm:git:git://github.com/killbill/killbill-cloud.git</connection>
         | 
| 60 | 
            +
                    <url>https://github.com/killbill/killbill-cloud/</url>
         | 
| 61 | 
            +
                    <developerConnection>scm:git:git@github.com:killbill/killbill-cloud.git</developerConnection>
         | 
| 62 | 
            +
                </scm>
         | 
| 63 | 
            +
                <issueManagement>
         | 
| 64 | 
            +
                    <system>Github</system>
         | 
| 65 | 
            +
                    <url>https://github.com/killbill/killbill-cloud/issues</url>
         | 
| 66 | 
            +
                </issueManagement>
         | 
| 67 | 
            +
                <distributionManagement>
         | 
| 68 | 
            +
                    <repository>
         | 
| 69 | 
            +
                        <id>${repository.release.id}</id>
         | 
| 70 | 
            +
                        <name>${repository.release.name}</name>
         | 
| 71 | 
            +
                        <url>${repository.release.url}</url>
         | 
| 72 | 
            +
                    </repository>
         | 
| 73 | 
            +
                    <snapshotRepository>
         | 
| 74 | 
            +
                        <id>${repository.snapshot.id}</id>
         | 
| 75 | 
            +
                        <name>${repository.snapshot.name}</name>
         | 
| 76 | 
            +
                        <url>${repository.snapshot.url}</url>
         | 
| 77 | 
            +
                    </snapshotRepository>
         | 
| 78 | 
            +
                </distributionManagement>
         | 
| 79 | 
            +
                <properties>
         | 
| 80 | 
            +
                    <repository.release.id>sonatype-nexus-staging</repository.release.id>
         | 
| 81 | 
            +
                    <repository.release.name>Nexus Release Repository</repository.release.name>
         | 
| 82 | 
            +
                    <repository.release.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</repository.release.url>
         | 
| 83 | 
            +
                    <repository.snapshot.id>sonatype-nexus-snapshots</repository.snapshot.id>
         | 
| 84 | 
            +
                    <repository.snapshot.name>Sonatype Nexus Snapshots</repository.snapshot.name>
         | 
| 85 | 
            +
                    <repository.snapshot.url>https://oss.sonatype.org/content/repositories/snapshots/</repository.snapshot.url>
         | 
| 86 | 
            +
                </properties>
         | 
| 87 | 
            +
                <build>
         | 
| 88 | 
            +
                    <pluginManagement>
         | 
| 89 | 
            +
                        <plugins>
         | 
| 90 | 
            +
                            <plugin>
         | 
| 91 | 
            +
                                <artifactId>maven-compiler-plugin</artifactId>
         | 
| 92 | 
            +
                                <executions>
         | 
| 93 | 
            +
                                    <execution>
         | 
| 94 | 
            +
                                        <id>default-compile</id>
         | 
| 95 | 
            +
                                        <phase>none</phase>
         | 
| 96 | 
            +
                                    </execution>
         | 
| 97 | 
            +
                                    <execution>
         | 
| 98 | 
            +
                                        <id>default-testCompile</id>
         | 
| 99 | 
            +
                                        <phase>none</phase>
         | 
| 100 | 
            +
                                    </execution>
         | 
| 101 | 
            +
                                </executions>
         | 
| 102 | 
            +
                            </plugin>
         | 
| 103 | 
            +
                            <plugin>
         | 
| 104 | 
            +
                                <artifactId>maven-install-plugin</artifactId>
         | 
| 105 | 
            +
                                <executions>
         | 
| 106 | 
            +
                                    <execution>
         | 
| 107 | 
            +
                                        <id>default-install</id>
         | 
| 108 | 
            +
                                        <phase>none</phase>
         | 
| 109 | 
            +
                                    </execution>
         | 
| 110 | 
            +
                                </executions>
         | 
| 111 | 
            +
                            </plugin>
         | 
| 112 | 
            +
                            <plugin>
         | 
| 113 | 
            +
                                <artifactId>maven-resources-plugin</artifactId>
         | 
| 114 | 
            +
                                <executions>
         | 
| 115 | 
            +
                                    <execution>
         | 
| 116 | 
            +
                                        <id>default-resources</id>
         | 
| 117 | 
            +
                                        <phase>none</phase>
         | 
| 118 | 
            +
                                    </execution>
         | 
| 119 | 
            +
                                    <execution>
         | 
| 120 | 
            +
                                        <id>default-testResources</id>
         | 
| 121 | 
            +
                                        <phase>none</phase>
         | 
| 122 | 
            +
                                    </execution>
         | 
| 123 | 
            +
                                </executions>
         | 
| 124 | 
            +
                            </plugin>
         | 
| 125 | 
            +
                            <plugin>
         | 
| 126 | 
            +
                                <artifactId>maven-surefire-plugin</artifactId>
         | 
| 127 | 
            +
                                <executions>
         | 
| 128 | 
            +
                                    <execution>
         | 
| 129 | 
            +
                                        <id>default-test</id>
         | 
| 130 | 
            +
                                        <phase>none</phase>
         | 
| 131 | 
            +
                                    </execution>
         | 
| 132 | 
            +
                                </executions>
         | 
| 133 | 
            +
                            </plugin>
         | 
| 134 | 
            +
                        </plugins>
         | 
| 135 | 
            +
                    </pluginManagement>
         | 
| 136 | 
            +
                    <plugins>
         | 
| 137 | 
            +
                        <plugin>
         | 
| 138 | 
            +
                            <groupId>org.codehaus.mojo</groupId>
         | 
| 139 | 
            +
                            <artifactId>build-helper-maven-plugin</artifactId>
         | 
| 140 | 
            +
                            <version>3.2.0</version>
         | 
| 141 | 
            +
                            <executions>
         | 
| 142 | 
            +
                                <execution>
         | 
| 143 | 
            +
                                    <id>attach-artifacts</id>
         | 
| 144 | 
            +
                                    <phase>package</phase>
         | 
| 145 | 
            +
                                    <goals>
         | 
| 146 | 
            +
                                        <goal>attach-artifact</goal>
         | 
| 147 | 
            +
                                    </goals>
         | 
| 148 | 
            +
                                    <configuration>
         | 
| 149 | 
            +
                                        <artifacts>
         | 
| 150 | 
            +
                                            <artifact>
         | 
| 151 | 
            +
                                                <file>kpm-${project.version}-linux-x86.tar.gz</file>
         | 
| 152 | 
            +
                                                <type>tar.gz</type>
         | 
| 153 | 
            +
                                                <classifier>linux-x86</classifier>
         | 
| 154 | 
            +
                                            </artifact>
         | 
| 155 | 
            +
                                            <artifact>
         | 
| 156 | 
            +
                                                <file>kpm-${project.version}-linux-x86_64.tar.gz</file>
         | 
| 157 | 
            +
                                                <type>tar.gz</type>
         | 
| 158 | 
            +
                                                <classifier>linux-x86_64</classifier>
         | 
| 159 | 
            +
                                            </artifact>
         | 
| 160 | 
            +
                                            <artifact>
         | 
| 161 | 
            +
                                                <file>kpm-${project.version}-osx.tar.gz</file>
         | 
| 162 | 
            +
                                                <type>tar.gz</type>
         | 
| 163 | 
            +
                                                <classifier>osx</classifier>
         | 
| 164 | 
            +
                                            </artifact>
         | 
| 165 | 
            +
                                        </artifacts>
         | 
| 166 | 
            +
                                    </configuration>
         | 
| 167 | 
            +
                                </execution>
         | 
| 168 | 
            +
                            </executions>
         | 
| 169 | 
            +
                        </plugin>
         | 
| 170 | 
            +
                    </plugins>
         | 
| 171 | 
            +
                </build>
         | 
| 172 | 
            +
                <profiles>
         | 
| 173 | 
            +
                    <profile>
         | 
| 174 | 
            +
                        <id>sonatype-oss-release</id>
         | 
| 175 | 
            +
                        <build>
         | 
| 176 | 
            +
                            <plugins>
         | 
| 177 | 
            +
                                <plugin>
         | 
| 178 | 
            +
                                    <groupId>org.apache.maven.plugins</groupId>
         | 
| 179 | 
            +
                                    <artifactId>maven-gpg-plugin</artifactId>
         | 
| 180 | 
            +
                                    <version>1.6</version>
         | 
| 181 | 
            +
                                    <executions>
         | 
| 182 | 
            +
                                        <execution>
         | 
| 183 | 
            +
                                            <id>sign-artifacts</id>
         | 
| 184 | 
            +
                                            <phase>verify</phase>
         | 
| 185 | 
            +
                                            <goals>
         | 
| 186 | 
            +
                                                <goal>sign</goal>
         | 
| 187 | 
            +
                                            </goals>
         | 
| 188 | 
            +
                                            <configuration>
         | 
| 189 | 
            +
                                                <!-- Prevent `gpg` from using pinentry programs -->
         | 
| 190 | 
            +
                                                <gpgArguments>
         | 
| 191 | 
            +
                                                    <arg>--pinentry-mode</arg>
         | 
| 192 | 
            +
                                                    <arg>loopback</arg>
         | 
| 193 | 
            +
                                                </gpgArguments>
         | 
| 194 | 
            +
                                            </configuration>
         | 
| 195 | 
            +
                                        </execution>
         | 
| 196 | 
            +
                                    </executions>
         | 
| 197 | 
            +
                                </plugin>
         | 
| 198 | 
            +
                                <plugin>
         | 
| 199 | 
            +
                                    <groupId>org.sonatype.plugins</groupId>
         | 
| 200 | 
            +
                                    <artifactId>nexus-staging-maven-plugin</artifactId>
         | 
| 201 | 
            +
                                    <version>1.6.8</version>
         | 
| 202 | 
            +
                                    <extensions>true</extensions>
         | 
| 203 | 
            +
                                    <configuration>
         | 
| 204 | 
            +
                                        <serverId>ossrh-releases</serverId>
         | 
| 205 | 
            +
                                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
         | 
| 206 | 
            +
                                        <keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
         | 
| 207 | 
            +
                                        <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
         | 
| 208 | 
            +
                                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
         | 
| 209 | 
            +
                                        <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
         | 
| 210 | 
            +
                                    </configuration>
         | 
| 211 | 
            +
                                </plugin>
         | 
| 212 | 
            +
                            </plugins>
         | 
| 213 | 
            +
                        </build>
         | 
| 214 | 
            +
                    </profile>
         | 
| 215 | 
            +
                </profiles>
         | 
| 45 216 | 
             
            </project>
         | 
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'spec_helper'
         | 
| 4 | 
            +
            require 'rexml/document'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            describe KPM::NexusFacade, skip_me_if_nil: ENV['CLOUDSMITH_TOKEN'].nil? do
         | 
| 7 | 
            +
              let(:logger) do
         | 
| 8 | 
            +
                logger = ::Logger.new(STDOUT)
         | 
| 9 | 
            +
                logger.level = Logger::INFO
         | 
| 10 | 
            +
                logger
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
              let(:coordinates_map) do
         | 
| 13 | 
            +
                { version: '0.22.21-20210319.010242-1',
         | 
| 14 | 
            +
                  group_id: 'org.kill-bill.billing',
         | 
| 15 | 
            +
                  artifact_id: 'killbill',
         | 
| 16 | 
            +
                  packaging: 'pom',
         | 
| 17 | 
            +
                  classifier: nil }
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
              let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
         | 
| 20 | 
            +
              let(:nexus_remote) { described_class::CloudsmithApiCalls.new({ :url => "https://dl.cloudsmith.io/#{ENV['CLOUDSMITH_TOKEN']}/#{ENV['CLOUDSMITH_ORG']}/#{ENV['CLOUDSMITH_REPO']}/maven" }, true, logger) }
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              it {
         | 
| 23 | 
            +
                # Not implemented
         | 
| 24 | 
            +
                expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'Cloudsmith has no search support')
         | 
| 25 | 
            +
              }
         | 
| 26 | 
            +
             | 
| 27 | 
            +
              it {
         | 
| 28 | 
            +
                response = nil
         | 
| 29 | 
            +
                expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
         | 
| 30 | 
            +
                expect(REXML::Document.new(response).elements['//version'].text).to eq(coordinates_map[:version])
         | 
| 31 | 
            +
              }
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              it {
         | 
| 34 | 
            +
                response = nil
         | 
| 35 | 
            +
                destination = Dir.mktmpdir('artifact')
         | 
| 36 | 
            +
                expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
         | 
| 37 | 
            +
                destination = File.join(File.expand_path(destination), response[:file_name])
         | 
| 38 | 
            +
                expect(File.read(destination)).to match(/org.kill-bill.billing/)
         | 
| 39 | 
            +
              }
         | 
| 40 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: kpm
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.10.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Kill Bill core team
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-03-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: highline
         | 
| @@ -66,6 +66,20 @@ dependencies: | |
| 66 66 | 
             
                - - "~>"
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: 0.19.1
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: gem-release
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '2.2'
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - "~>"
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '2.2'
         | 
| 69 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 84 | 
             
              name: rake
         | 
| 71 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -127,6 +141,7 @@ files: | |
| 127 141 | 
             
            - lib/kpm/killbill_server_artifact.rb
         | 
| 128 142 | 
             
            - lib/kpm/migrations.rb
         | 
| 129 143 | 
             
            - lib/kpm/nexus_helper/actions.rb
         | 
| 144 | 
            +
            - lib/kpm/nexus_helper/cloudsmith_api_calls.rb
         | 
| 130 145 | 
             
            - lib/kpm/nexus_helper/github_api_calls.rb
         | 
| 131 146 | 
             
            - lib/kpm/nexus_helper/nexus_api_calls_v2.rb
         | 
| 132 147 | 
             
            - lib/kpm/nexus_helper/nexus_facade.rb
         | 
| @@ -155,6 +170,7 @@ files: | |
| 155 170 | 
             
            - release.sh
         | 
| 156 171 | 
             
            - spec/kpm/remote/base_artifact_spec.rb
         | 
| 157 172 | 
             
            - spec/kpm/remote/base_installer_spec.rb
         | 
| 173 | 
            +
            - spec/kpm/remote/cloudsmith_api_calls_spec.rb
         | 
| 158 174 | 
             
            - spec/kpm/remote/github_api_calls_spec.rb
         | 
| 159 175 | 
             
            - spec/kpm/remote/installer_spec.rb
         | 
| 160 176 | 
             
            - spec/kpm/remote/kaui_artifact_spec.rb
         |