nexus_api 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54540d2831ebe3afc8edbb9dbb5e32f68100d3f4618306d0818edb00ed74a3c8
4
- data.tar.gz: d950c2e81a149d411b3d13fb6635488ff79f794d0d7a585069b8a2b39915ebc6
3
+ metadata.gz: 885db3d6a8d7a3b381b8a9a889ef2bbbbe5d746b14e430872815db135f25c879
4
+ data.tar.gz: 2408b1085fa8d62f5d506d113aad8d269b74e0a66564e1c9720ba6aaa2e4ccff
5
5
  SHA512:
6
- metadata.gz: 2a24f487215f4994725270ac80c522257622113f86019f0f99af7d02d8abad5564bfbb6a353ffb12b851b0b69f3af8b2571e31a313b13bdf7ea63fe3d5000953
7
- data.tar.gz: 7e9a259841115128402c789caf2b72e84160c50949f08367c38acb9199c6136e8fe0f5620e0eda9fa2c33cb6b40fb1943a8bf8e14f559b4cd7a428837213a8a4
6
+ metadata.gz: 001d8efa8dbe403928908e11a88746a5cb5f6650120031b9992888bde1a8224d3c33812df0b59c5ccb229492329049dcdda1aa2829f7ec550488ce3c77cce3a6
7
+ data.tar.gz: ebd5b6c64759c57137c74a86584c4c51d15467ad8cea81154e72bb91a59fa30dc4f24a18729d444a7ac999d6b6dadcd944eed8a164cdbc120874539b0d489a4a
data/CHANGELOG.md CHANGED
@@ -5,7 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
 
8
- ## [1.1.0](https://github.com/Cisco-AMP/nexus_api/compare/v1.0.4...v1.1.0) - 2020-04-20
8
+ ## [1.2.0](https://github.com/Cisco-AMP/nexus_api/compare/v1.1.0...v1.2.0) - 2020-04-24
9
+ ### Added
10
+ - `move_components_to` method for moving all components that match a given tag into a new destination
11
+ - `bin/nexus_api move` to the CLI for moving components
12
+
13
+
14
+ ## [1.1.0](https://github.com/Cisco-AMP/nexus_api/compare/v1.0.4...v1.1.0) - 2020-04-17
9
15
  ### Changed
10
16
  - `list_repositories` to use the new `beta` API version which returns richer content than the old `v1` version
11
17
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexus_api (1.1.0)
4
+ nexus_api (1.2.0)
5
5
  bundler (~> 2)
6
6
  docker-api (~> 1.34.2)
7
7
  dotenv (~> 2.7.5)
data/README.md CHANGED
@@ -5,10 +5,10 @@ A ruby gem that wraps the [Sonatype Nexus Repository Manager 3](https://help.son
5
5
  ## Latest Version Tested
6
6
  Title | Value
7
7
  ---|---
8
- **Version** | `3.18.1-01`
8
+ **Version** | `3.22.0-02`
9
9
  **Edition** | `PRO`
10
- **Build Revision** | `72e5414c4f3fb232e32cbfc9fca740111c94d07f`
11
- **Build Timestamp** | `2019-08-06-1749-11540`
10
+ **Build Revision** | `140e045ce3cdd3f35e6f9d13127d7299d21f7251`
11
+ **Build Timestamp** | `2020-03-27-1616-27700`
12
12
 
13
13
 
14
14
  ## Installation
@@ -45,7 +45,7 @@ bin/nexus_api
45
45
 
46
46
 
47
47
  ### Using the Class
48
- Documentation is never perfect. Use this section as a reference, but [lib/nexus_api.rb](lib/nexus_api.rb) should be regarded as the source of truth.
48
+ Documentation is never perfect. Use this section as a reference, but [lib/nexus_api.rb](lib/nexus_api.rb) and [lib/endpoints](lib/endpoints) should be regarded as the source of truth.
49
49
 
50
50
 
51
51
  ```ruby
@@ -98,6 +98,9 @@ set = Array.new.tap do |set|
98
98
  end
99
99
  end
100
100
 
101
+ # You can move all components that are tagged to a new destination
102
+ api.move_components_to(destination: DESTINATION, tag: TAG)
103
+
101
104
  # You can download an asset by using its asset_id
102
105
  # Optionally, you can rename the file on download
103
106
  api.download(
@@ -156,12 +159,6 @@ api.associate_tag(name: TAG, sha1: SHA1_SUM, repository: REPOSITORY_NAME)
156
159
  api.delete_associated_tag(name: TAG, sha1: SHA1_SUM, repository: REPOSITORY_NAME)
157
160
  api.delete_tag(name: TAG)
158
161
 
159
- # You can upload, list, run, and delete custom Nexus scripts
160
- api.upload_script(filename: LOCAL_FILENAME)
161
- api.list_scripts
162
- api.run_script(name: SCRIPT_NAME)
163
- api.delete_script(name: SCRIPT_NAME)
164
-
165
162
  # You can query the Nexus status
166
163
  api.status
167
164
  api.status_writable
@@ -2,5 +2,8 @@ module NexusAPI
2
2
  class API
3
3
  # POST /service/rest/v1/staging/delete
4
4
  # POST /service/rest/v1/staging/move/{destination}
5
+ def move_components_to(destination:, tag:)
6
+ @connection.post(endpoint: "staging/move/#{destination}?tag=#{tag}")
7
+ end
5
8
  end
6
9
  end
data/lib/nexus_api/cli.rb CHANGED
@@ -15,6 +15,9 @@ module NexusAPI
15
15
  desc 'list TYPE', 'Print a list of every item in Nexus that matches TYPE'
16
16
  subcommand 'list', List
17
17
 
18
+ desc 'move TYPE', 'Move items to new location in Nexus'
19
+ subcommand 'move', Move
20
+
18
21
  desc 'script COMMAND', 'Manipulate scripts in Nexus'
19
22
  subcommand 'script', Script
20
23
 
@@ -32,5 +35,9 @@ module NexusAPI
32
35
  def version
33
36
  puts NexusAPI::VERSION
34
37
  end
38
+
39
+ def self.exit_on_failure?
40
+ true
41
+ end
35
42
  end
36
43
  end
@@ -1,5 +1,6 @@
1
1
  require 'nexus_api/cli_commands/download.rb'
2
2
  require 'nexus_api/cli_commands/list.rb'
3
+ require 'nexus_api/cli_commands/move.rb'
3
4
  require 'nexus_api/cli_commands/script.rb'
4
5
  require 'nexus_api/cli_commands/search.rb'
5
6
  require 'nexus_api/cli_commands/tag.rb'
@@ -0,0 +1,15 @@
1
+ module NexusAPI
2
+ class Move < ::Thor
3
+ attr_accessor :api
4
+
5
+ include NexusAPI::CLIUtils
6
+
7
+ desc 'components', 'Moves components with the provided tag to the provided destination'
8
+ option :destination, :aliases => '-d', :desc => 'Destination to move components to', :required => true
9
+ option :tag, :aliases => '-t', :desc => 'Tag to match', :required => true
10
+ def components
11
+ setup
12
+ @api.move_components_to(destination: options[:destination], tag: options[:tag])
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
1
  module NexusAPI
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Levesque
@@ -211,6 +211,7 @@ files:
211
211
  - lib/nexus_api/cli_commands/commands.rb
212
212
  - lib/nexus_api/cli_commands/download.rb
213
213
  - lib/nexus_api/cli_commands/list.rb
214
+ - lib/nexus_api/cli_commands/move.rb
214
215
  - lib/nexus_api/cli_commands/script.rb
215
216
  - lib/nexus_api/cli_commands/search.rb
216
217
  - lib/nexus_api/cli_commands/tag.rb