nexus_cli_sb 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile +42 -0
- data/Guardfile +27 -0
- data/LICENSE +15 -0
- data/README.md +121 -0
- data/Rakefile +1 -0
- data/Thorfile +66 -0
- data/VERSION +1 -0
- data/bin/nexus-cli +10 -0
- data/data/pom.xml.erb +13 -0
- data/features/nexus_oss.feature +251 -0
- data/features/pro/nexus_custom_metadata.feature +116 -0
- data/features/pro/nexus_pro.feature +101 -0
- data/features/step_definitions/cli_steps.rb +105 -0
- data/features/support/env.rb +64 -0
- data/lib/nexus_cli/artifact.rb +44 -0
- data/lib/nexus_cli/base_remote.rb +16 -0
- data/lib/nexus_cli/cli.rb +7 -0
- data/lib/nexus_cli/configuration.rb +102 -0
- data/lib/nexus_cli/connection.rb +84 -0
- data/lib/nexus_cli/errors.rb +259 -0
- data/lib/nexus_cli/mixins/artifact_actions.rb +194 -0
- data/lib/nexus_cli/mixins/global_settings_actions.rb +64 -0
- data/lib/nexus_cli/mixins/logging_actions.rb +45 -0
- data/lib/nexus_cli/mixins/pro/custom_metadata_actions.rb +176 -0
- data/lib/nexus_cli/mixins/pro/smart_proxy_actions.rb +219 -0
- data/lib/nexus_cli/mixins/repository_actions.rb +245 -0
- data/lib/nexus_cli/mixins/user_actions.rb +125 -0
- data/lib/nexus_cli/n3_metadata.rb +77 -0
- data/lib/nexus_cli/remote/oss_remote.rb +11 -0
- data/lib/nexus_cli/remote/pro_remote.rb +59 -0
- data/lib/nexus_cli/remote_factory.rb +30 -0
- data/lib/nexus_cli/tasks.rb +496 -0
- data/lib/nexus_cli/version.rb +6 -0
- data/lib/nexus_cli.rb +44 -0
- data/nexus_cli.gemspec +31 -0
- data/spec/fixtures/metadata_search.xml +10 -0
- data/spec/fixtures/nexus.config +4 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/unit/nexus_cli/artifact_spec.rb +82 -0
- data/spec/unit/nexus_cli/configuration_spec.rb +137 -0
- data/spec/unit/nexus_cli/mixins/pro/custom_metadata_actions_spec.rb +21 -0
- data/spec/unit/nexus_cli/oss_remote_spec.rb +78 -0
- data/spec/unit/nexus_cli/pro_remote_spec.rb +110 -0
- data/spec/unit/nexus_cli/remote_factory_spec.rb +42 -0
- metadata +259 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2aa1f8f45f2b8691544415d9a715ddd5b33012622f43582b74ba697947ab7e68
|
4
|
+
data.tar.gz: f21e8e247895f7b6378bf4b1c806585152c99b046f065491063eb9736551abb2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 534415196c92c2cbf8b8661e35bcf08d129d29acb335d221150bd297128d32792b8febf2b0390ba461aacdcbb5af18b9bfffa604784b3a5ea6cbf24fe10e4929
|
7
|
+
data.tar.gz: 8423021f4e48b8752f217489bfe9c0c8f65ce32d0a737b55718e18c688d2926562d016b939273b6e283839f8c026d2f175ea4534b86b3bb5646b2062bc20f342
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# 4.0.2
|
2
|
+
|
3
|
+
* #89 - Restrict activesupport gem to 3.2.0 .
|
4
|
+
|
5
|
+
# 4.0.1
|
6
|
+
|
7
|
+
* Actually support anonymous browsing
|
8
|
+
|
9
|
+
# 4.0.0
|
10
|
+
|
11
|
+
* Major Change - GAV ordering that used to be G:A:V:E has changed to G:A:E:C:V
|
12
|
+
* Support for an anonymous connection to the Nexus server
|
13
|
+
* Added support for Maven classifiers
|
14
|
+
* In general, references to an 'artifact' (GAV identifier) have been renamed to 'coordinates'
|
data/Gemfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem 'yard'
|
7
|
+
gem 'spork'
|
8
|
+
gem 'guard'
|
9
|
+
gem 'guard-cucumber'
|
10
|
+
gem 'guard-yard'
|
11
|
+
gem 'guard-rspec'
|
12
|
+
gem 'guard-spork', platforms: :ruby
|
13
|
+
gem 'coolline'
|
14
|
+
gem 'redcarpet'
|
15
|
+
|
16
|
+
require 'rbconfig'
|
17
|
+
|
18
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin/i
|
19
|
+
gem 'growl', require: false
|
20
|
+
gem 'rb-fsevent', require: false
|
21
|
+
|
22
|
+
if `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip >= '10.8'
|
23
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
24
|
+
end rescue Errno::ENOENT
|
25
|
+
|
26
|
+
elsif RbConfig::CONFIG['target_os'] =~ /linux/i
|
27
|
+
gem 'libnotify', '~> 0.8.0', require: false
|
28
|
+
gem 'rb-inotify', require: false
|
29
|
+
|
30
|
+
elsif RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
31
|
+
gem 'win32console', require: false
|
32
|
+
gem 'rb-notifu', '>= 0.0.4', require: false
|
33
|
+
gem 'wdm', require: false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
group :test do
|
38
|
+
gem 'thor'
|
39
|
+
gem 'rake', '>= 0.9.2.2'
|
40
|
+
gem 'rspec'
|
41
|
+
gem 'fuubar'
|
42
|
+
end
|
data/Guardfile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
notification :off
|
2
|
+
|
3
|
+
guard 'spork' do
|
4
|
+
watch('Gemfile')
|
5
|
+
watch('spec/spec_helper.rb') { :rspec }
|
6
|
+
watch(%r{^spec/support/.+\.rb$}) { :rspec }
|
7
|
+
end
|
8
|
+
|
9
|
+
guard 'yard', stdout: '/dev/null', stderr: '/dev/null' do
|
10
|
+
watch(%r{app/.+\.rb})
|
11
|
+
watch(%r{lib/.+\.rb})
|
12
|
+
watch(%r{ext/.+\.c})
|
13
|
+
end
|
14
|
+
|
15
|
+
guard 'rspec', cli: "--color --drb --format Fuubar", all_on_start: false, all_after_pass: false do
|
16
|
+
watch(%r{^spec/unit/.+_spec\.rb$})
|
17
|
+
|
18
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
19
|
+
watch('spec/spec_helper.rb') { "spec" }
|
20
|
+
watch(%r{^spec/support/.+\.rb$}) { "spec" }
|
21
|
+
end
|
22
|
+
|
23
|
+
guard 'cucumber', cli: "--drb --format pretty --tags ~@no_run --tags ~@wip", all_on_start: false, all_after_pass: false do
|
24
|
+
watch(%r{^features/.+\.feature$})
|
25
|
+
watch(%r{^features/support/.+$}) { 'features' }
|
26
|
+
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
27
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Author:: Kyle Allan (<kallan@riotgames.com>)
|
2
|
+
|
3
|
+
Copyright 2011, 2012 Riot Games
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
# Nexus CLI
|
2
|
+
[![Build Status](https://travis-ci.org/RiotGames/nexus_cli.png)](https://travis-ci.org/RiotGames/nexus_cli)
|
3
|
+
|
4
|
+
A CLI wrapper around Sonatype Nexus REST calls.
|
5
|
+
|
6
|
+
# Requirements
|
7
|
+
|
8
|
+
* Ruby
|
9
|
+
|
10
|
+
# Installation
|
11
|
+
|
12
|
+
1. Install the Gem - `gem install nexus_cli`
|
13
|
+
2. Create a file in your user's home directory named `.nexus_cli`
|
14
|
+
3. Give the file the following information:
|
15
|
+
|
16
|
+
```
|
17
|
+
url: "http://my-nexus-server/nexus/"
|
18
|
+
repository: "my-repository-id"
|
19
|
+
username: "username"
|
20
|
+
password: "password"
|
21
|
+
```
|
22
|
+
|
23
|
+
You can also omit the username and password to create an anonymous session with the Nexus server. Keep in mind that an anonymous session may have different permissions than an authenticated one, depending on your Nexus server configuration.
|
24
|
+
|
25
|
+
# Usage
|
26
|
+
|
27
|
+
There are a few calls that can be made. The most important are push\_artifact and pull\_artifact. Both calls will push or pull artifacts from Nexus using the Maven Co-ordinates syntax: `groupId:artifactId:version` (default extension is jar) or `groupId:artifactId:extension:version` or `groupId:artifactId:extension:classifier:version`
|
28
|
+
|
29
|
+
One can also search for artifacts and get back raw xml containing matches.
|
30
|
+
|
31
|
+
## Listing of Available Commands
|
32
|
+
|
33
|
+
```
|
34
|
+
nexus-cli add_to_group_repository group_id repository_to_add_id # Adds a repository with the given id into the group repository.
|
35
|
+
nexus-cli add_trusted_key --certificate=CERTIFICATE --description=DESCRIPTION # Adds a new trusted key to the Smart Proxy configuration.
|
36
|
+
nexus-cli change_password user_id # Changes the given user's passwords to a new one.
|
37
|
+
nexus-cli clear_artifact_custom_info coordinates # Clears the artifact custom metadata.
|
38
|
+
nexus-cli create_group_repository name # Creates a new repository group with the given name.
|
39
|
+
nexus-cli create_repository name # Creates a new Repository with the provided name.
|
40
|
+
nexus-cli create_user # Creates a new user
|
41
|
+
nexus-cli delete_group_repository group_id # Deletes a group repository based on the given id.
|
42
|
+
nexus-cli delete_repository name # Deletes a Repository with the provided name.
|
43
|
+
nexus-cli delete_trusted_key key_id # Deletes a trusted key using the given key_id.
|
44
|
+
nexus-cli delete_user user_id # Deletes the user with the given id.
|
45
|
+
nexus-cli disable_artifact_publish repository_id # Sets a repository to disable the publishing of updates about its artifacts.
|
46
|
+
nexus-cli disable_artifact_subscribe repository_id # Sets a repository to stop subscribing to updates about artifacts.
|
47
|
+
nexus-cli disable_smart_proxy # Disables Smart Proxy on the server.
|
48
|
+
nexus-cli enable_artifact_publish repository_id # Sets a repository to enable the publishing of updates about its artifacts.
|
49
|
+
nexus-cli enable_artifact_subscribe repository_id # Sets a repository to subscribe to updates about artifacts.
|
50
|
+
nexus-cli enable_smart_proxy # Enables Smart Proxy on the server.
|
51
|
+
nexus-cli get_artifact_custom_info coordinates # Gets and returns the custom metadata in XML format about a particular artifact.
|
52
|
+
nexus-cli get_artifact_info coordinates # Gets and returns the metadata in XML format about a particular artifact.
|
53
|
+
nexus-cli get_global_settings # Prints out your Nexus' current setttings and saves them to a file.
|
54
|
+
nexus-cli get_group_repository group_id # Gets information about the given group repository.
|
55
|
+
nexus-cli get_license_info # Returns the license information of the server.
|
56
|
+
nexus-cli get_logging_info # Gets the log4j Settings of the Nexus server.
|
57
|
+
nexus-cli get_nexus_configuration # Prints out configuration from the .nexus_cli file that helps inform where artifacts will be uploaded.
|
58
|
+
nexus-cli get_nexus_status # Prints out information about the Nexus instance.
|
59
|
+
nexus-cli get_pub_sub repository_id # Returns the publish/subscribe status of the given repository.
|
60
|
+
nexus-cli get_repository_info name # Finds and returns information about the provided Repository.
|
61
|
+
nexus-cli get_smart_proxy_settings # Returns the Smart Proxy settings of the server.
|
62
|
+
nexus-cli get_trusted_keys # Returns the trusted keys of the server.
|
63
|
+
nexus-cli get_users # Returns XML representing the users in Nexus.
|
64
|
+
nexus-cli help [COMMAND] # Describe available commands or one specific command
|
65
|
+
nexus-cli install_license license_file # Installs a license file into the server.
|
66
|
+
nexus-cli pull_artifact coordinates # Pulls an artifact from Nexus and places it on your machine.
|
67
|
+
nexus-cli push_artifact coordinates file # Pushes an artifact from your machine onto the Nexus.
|
68
|
+
nexus-cli remove_from_group_repository group_id repository_to_remove_id # Remove a repository with the given id from the group repository.
|
69
|
+
nexus-cli reset_global_settings # Resets your Nexus global_settings to their out-of-the-box defaults.
|
70
|
+
nexus-cli search_artifacts_custom param1 param2 ... # Searches for artifacts using artifact metadata and returns the result as a list with items in XML format.
|
71
|
+
nexus-cli search_for_artifacts # Searches for all the versions of a particular artifact and prints it to the screen.
|
72
|
+
nexus-cli set_logger_level level # Updates the log4j logging level to a new value.
|
73
|
+
nexus-cli transfer_artifact coordinates from_repository to_repository # Transfers a given artifact from one repository to another.
|
74
|
+
nexus-cli update_artifact_custom_info coordinates param1 param2 ... # Updates the artifact custom metadata with the given key-value pairs.
|
75
|
+
nexus-cli update_user user_id # Updates a user's details. Leave fields blank for them to remain their current values.
|
76
|
+
nexus-cli upload_global_settings # Uploads a global_settings.json file to your Nexus to update its settings.
|
77
|
+
```
|
78
|
+
|
79
|
+
Each command can be prefaced with `help` to get more information about the command. For example - `nexus-cli help get_users`
|
80
|
+
|
81
|
+
There are also two global config options, `--overrides` which overrides the configruation in `~/.nexus_cli` and `--ssl-verify false` which turns off SSL verification.
|
82
|
+
|
83
|
+
## Pull Artifact Example
|
84
|
+
|
85
|
+
```
|
86
|
+
nexus-cli pull_artifact com.mycompany.artifacts:myartifact:1.0.0:tgz
|
87
|
+
```
|
88
|
+
|
89
|
+
## Push Artifact Example
|
90
|
+
|
91
|
+
```
|
92
|
+
nexus-cli push_artifact com.mycompany.artifacts:myartifact:1.0.0:tgz ~/path/to/file/to/push/myartifact.tgz
|
93
|
+
```
|
94
|
+
|
95
|
+
## Search Example
|
96
|
+
|
97
|
+
```
|
98
|
+
nexus-cli search_for_artifacts com.mycompany.artifacts:myartifact
|
99
|
+
|
100
|
+
or more generic if you wish:
|
101
|
+
|
102
|
+
nexus-cli search_for_artifacts com.mycompany.artifacts
|
103
|
+
```
|
104
|
+
|
105
|
+
# License and Author
|
106
|
+
|
107
|
+
Author:: Kyle Allan (<kallan@riotgames.com>)
|
108
|
+
|
109
|
+
Copyright:: 2013 Riot Games Inc.
|
110
|
+
|
111
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
112
|
+
you may not use this file except in compliance with the License.
|
113
|
+
You may obtain a copy of the License at
|
114
|
+
|
115
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
116
|
+
|
117
|
+
Unless required by applicable law or agreed to in writing, software
|
118
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
119
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
120
|
+
See the License for the specific language governing permissions and
|
121
|
+
limitations under the License.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/Thorfile
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
require 'bundler'
|
5
|
+
require 'bundler/setup'
|
6
|
+
|
7
|
+
require 'thor/rake_compat'
|
8
|
+
require 'nexus_cli'
|
9
|
+
|
10
|
+
class Default < Thor
|
11
|
+
include Thor::RakeCompat
|
12
|
+
Bundler::GemHelper.install_tasks
|
13
|
+
|
14
|
+
desc "build", "Build nexus-cli-#{NexusCli.version}.gem into the pkg directory"
|
15
|
+
def build
|
16
|
+
Rake::Task["build"].execute
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "install", "Build and install nexus-cli-#{NexusCli.version}.gem into system gems"
|
20
|
+
def install
|
21
|
+
Rake::Task["install"].execute
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "release", "Create tag v#{NexusCli.version} and build and push nexus-cli-#{NexusCli.version}.gem to Rubygems"
|
25
|
+
def release
|
26
|
+
Rake::Task["release"].execute
|
27
|
+
end
|
28
|
+
|
29
|
+
class Spec < Thor
|
30
|
+
include Thor::Actions
|
31
|
+
|
32
|
+
namespace :spec
|
33
|
+
default_task :all
|
34
|
+
|
35
|
+
desc "all", "run all tests"
|
36
|
+
def all
|
37
|
+
unless run_unit && run_acceptance
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "unit", "run only unit tests"
|
43
|
+
def unit
|
44
|
+
unless run_unit
|
45
|
+
exit 1
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "acceptance", "Run acceptance tests"
|
50
|
+
def acceptance
|
51
|
+
unless run_acceptance
|
52
|
+
exit 1
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
no_tasks do
|
57
|
+
def run_unit
|
58
|
+
run "rspec --color --format=documentation spec"
|
59
|
+
end
|
60
|
+
|
61
|
+
def run_acceptance
|
62
|
+
run "cucumber --color --format pretty"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
4.0.2
|
data/bin/nexus-cli
ADDED
data/data/pom.xml.erb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
4
|
+
<modelVersion>4.0.0</modelVersion>
|
5
|
+
<groupId><%= artifact.group_id %></groupId>
|
6
|
+
<artifactId><%= artifact.artifact_id %></artifactId>
|
7
|
+
<version><%= artifact.version %></version>
|
8
|
+
<% unless artifact.classifier.nil? %>
|
9
|
+
<classifier><%= artifact.classifier %></classifier>
|
10
|
+
<% end %>
|
11
|
+
<packaging><%= artifact.extension %></packaging>
|
12
|
+
<description>POM was created by Sonatype Nexus</description>
|
13
|
+
</project>
|
@@ -0,0 +1,251 @@
|
|
1
|
+
Feature: Use the Nexus CLI
|
2
|
+
As a CLI user
|
3
|
+
I need commands to get Nexus status, push, pull
|
4
|
+
|
5
|
+
Scenario: Get Nexus Status
|
6
|
+
When I call the nexus "status" command
|
7
|
+
Then the output should contain:
|
8
|
+
"""
|
9
|
+
Application Name: Sonatype Nexus
|
10
|
+
"""
|
11
|
+
And the exit status should be 0
|
12
|
+
|
13
|
+
@push
|
14
|
+
Scenario: Push an Artifact
|
15
|
+
When I push an artifact with the GAV of "com.test:mytest:tgz:1.0.0"
|
16
|
+
Then the output should contain:
|
17
|
+
"""
|
18
|
+
Artifact com.test:mytest:tgz:1.0.0 has been successfully pushed to Nexus.
|
19
|
+
"""
|
20
|
+
And the exit status should be 0
|
21
|
+
|
22
|
+
@pull
|
23
|
+
Scenario: Pull an artifact
|
24
|
+
When I call the nexus "pull com.test:mytest:tgz:1.0.0" command
|
25
|
+
Then the output should contain:
|
26
|
+
"""
|
27
|
+
Artifact has been retrieved and can be found at path:
|
28
|
+
"""
|
29
|
+
And the exit status should be 0
|
30
|
+
|
31
|
+
Scenario: Pull the LATEST of an artifact
|
32
|
+
When I pull an artifact with the GAV of "com.test:mytest:tgz:latest" to a temp directory
|
33
|
+
Then I should have a copy of the "mytest-1.0.0.tgz" artifact in a temp directory
|
34
|
+
And the exit status should be 0
|
35
|
+
|
36
|
+
Scenario: Pull an artifact to a specific place
|
37
|
+
When I pull an artifact with the GAV of "com.test:mytest:tgz:1.0.0" to a temp directory
|
38
|
+
Then I should have a copy of the "mytest-1.0.0.tgz" artifact in a temp directory
|
39
|
+
And the exit status should be 0
|
40
|
+
|
41
|
+
Scenario: Get an artifact's info
|
42
|
+
When I call the nexus "info com.test:mytest:tgz:1.0.0" command
|
43
|
+
Then the output should contain:
|
44
|
+
"""
|
45
|
+
<groupId>com.test</groupId>
|
46
|
+
"""
|
47
|
+
And the exit status should be 0
|
48
|
+
|
49
|
+
Scenario: Search for artifacts
|
50
|
+
When I call the nexus "search_for_artifacts com.test:mytest" command
|
51
|
+
Then the output should contain:
|
52
|
+
"""
|
53
|
+
<search-results>
|
54
|
+
"""
|
55
|
+
And the exit status should be 0
|
56
|
+
|
57
|
+
@transfer
|
58
|
+
Scenario: Transfer an artifact between repositories
|
59
|
+
When I call the nexus "transfer com.test:mytest:tgz:1.0.0 releases thirdparty" command
|
60
|
+
Then the output should contain:
|
61
|
+
"""
|
62
|
+
The artifact com.test:mytest:tgz:1.0.0 has been transferred from releases to thirdparty.
|
63
|
+
"""
|
64
|
+
And the exit status should be 0
|
65
|
+
|
66
|
+
@delete
|
67
|
+
Scenario: Attempt to delete an artifact
|
68
|
+
When I delete an artifact with the GAV of "com.test:mytest:tgz:1.0.0"
|
69
|
+
And I call the nexus "info com.test:mytest:tgz:1.0.0" command
|
70
|
+
Then the output should contain:
|
71
|
+
"""
|
72
|
+
The artifact you requested information for could not be found. Please ensure it exists inside the Nexus.
|
73
|
+
"""
|
74
|
+
And the exit status should be 101
|
75
|
+
|
76
|
+
@delete
|
77
|
+
Scenario: Attempt to delete another artifact
|
78
|
+
When I delete an artifact with the GAV of "com.test:mytest:tgz:1.0.0" from the "thirdparty" repository
|
79
|
+
And I call the nexus "info com.test:mytest:tgz:1.0.0" command overriding "repository:thirdparty"
|
80
|
+
Then the output should contain:
|
81
|
+
"""
|
82
|
+
The artifact you requested information for could not be found. Please ensure it exists inside the Nexus.
|
83
|
+
"""
|
84
|
+
And the exit status should be 101
|
85
|
+
|
86
|
+
|
87
|
+
Scenario: Get the current global settings of Nexus
|
88
|
+
When I call the nexus "get_global_settings" command
|
89
|
+
Then the output should contain:
|
90
|
+
"""
|
91
|
+
Your current Nexus global settings have been written to the file: ~/.nexus/global_settings.json
|
92
|
+
"""
|
93
|
+
And a file named "global_settings.json" should exist in my nexus folder
|
94
|
+
And the exit status should be 0
|
95
|
+
|
96
|
+
Scenario: Update the global settings of Nexus
|
97
|
+
When I call the nexus "get_global_settings" command
|
98
|
+
And I edit the "global_settings.json" files "forceBaseUrl" field to true
|
99
|
+
And I call the nexus "upload_global_settings" command
|
100
|
+
Then the output should contain:
|
101
|
+
"""
|
102
|
+
Your global_settings.json file has been uploaded to Nexus
|
103
|
+
"""
|
104
|
+
When I call the nexus "get_global_settings" command
|
105
|
+
Then the file "global_settings.json" in my nexus folder should contain:
|
106
|
+
"""
|
107
|
+
"forceBaseUrl": true
|
108
|
+
"""
|
109
|
+
And the exit status should be 0
|
110
|
+
|
111
|
+
Scenario: Update the global settings of Nexus with a string
|
112
|
+
When I update global settings uiTimeout to 61 and upload the json string
|
113
|
+
And I call the nexus "get_global_settings" command
|
114
|
+
Then the file "global_settings.json" in my nexus folder should contain:
|
115
|
+
"""
|
116
|
+
"uiTimeout": 61
|
117
|
+
"""
|
118
|
+
And the exit status should be 0
|
119
|
+
|
120
|
+
Scenario: Reset the global settings of Nexus
|
121
|
+
When I call the nexus "reset_global_settings" command
|
122
|
+
Then the output should contain:
|
123
|
+
"""
|
124
|
+
Your Nexus global settings have been reset to their default values
|
125
|
+
"""
|
126
|
+
When I call the nexus "get_global_settings" command
|
127
|
+
Then the file "global_settings.json" in my nexus folder should contain:
|
128
|
+
"""
|
129
|
+
"forceBaseUrl": false
|
130
|
+
"""
|
131
|
+
And the exit status should be 0
|
132
|
+
|
133
|
+
Scenario: Create a new repository in Nexus
|
134
|
+
When I call the nexus "create_repository Artifacts" command
|
135
|
+
Then the output should contain:
|
136
|
+
"""
|
137
|
+
A new Repository named Artifacts has been created.
|
138
|
+
"""
|
139
|
+
And the exit status should be 0
|
140
|
+
|
141
|
+
Scenario: Delete a repository in Nexus
|
142
|
+
When I call the nexus "delete_repository Artifacts" command
|
143
|
+
And I call the nexus "get_repository_info Artifacts" command
|
144
|
+
Then the output should contain:
|
145
|
+
"""
|
146
|
+
The repository you provided could not be found. Please ensure the repository exists.
|
147
|
+
"""
|
148
|
+
And the exit status should be 114
|
149
|
+
|
150
|
+
Scenario: Create a new user
|
151
|
+
When I call the nexus "create_user --username=cucumber --first_name=John --last_name=Smith --email=jsmith@nexus-cli.com --enabled --roles=nx-admin --password=pass" command
|
152
|
+
And I call the nexus "get_users" command
|
153
|
+
Then the output should contain:
|
154
|
+
"""
|
155
|
+
<userId>cucumber</userId>
|
156
|
+
"""
|
157
|
+
And the exit status should be 0
|
158
|
+
|
159
|
+
Scenario: Change a users information
|
160
|
+
When I call the nexus "update_user cucumber --first_name=Mike --last_name=Ditka --email= --enabled --roles=" command
|
161
|
+
And I call the nexus "get_users" command
|
162
|
+
Then the output should contain:
|
163
|
+
"""
|
164
|
+
<lastName>Ditka</lastName>
|
165
|
+
"""
|
166
|
+
And the exit status should be 0
|
167
|
+
|
168
|
+
Scenario: Change a users password
|
169
|
+
When I call the nexus "change_password cucumber --oldPassword=pass --newPassword=foo" command
|
170
|
+
And I call the nexus "get_users" command as the "cucumber" user with password "wrongPassword"
|
171
|
+
Then the output should contain:
|
172
|
+
"""
|
173
|
+
Your request was denied by the Nexus server due to a permissions error
|
174
|
+
"""
|
175
|
+
And the exit status should be 106
|
176
|
+
|
177
|
+
Scenario: Delete a user
|
178
|
+
When I call the nexus "delete_user cucumber" command
|
179
|
+
And I call the nexus "get_users" command
|
180
|
+
Then the output should not contain:
|
181
|
+
"""
|
182
|
+
<userId>cucumber</userId>
|
183
|
+
"""
|
184
|
+
And the exit status should be 0
|
185
|
+
|
186
|
+
Scenario: Get Logging Info
|
187
|
+
When I call the nexus "get_logging_info" command
|
188
|
+
Then the output should contain:
|
189
|
+
"""
|
190
|
+
\"rootLoggerLevel\":\"INFO\"
|
191
|
+
"""
|
192
|
+
And the exit status should be 0
|
193
|
+
|
194
|
+
Scenario: Change the logging level to DEBUG
|
195
|
+
When I call the nexus "set_logger_level debug" command
|
196
|
+
And I call the nexus "get_logging_info" command
|
197
|
+
Then the output should contain:
|
198
|
+
"""
|
199
|
+
\"rootLoggerLevel\":\"DEBUG\"
|
200
|
+
"""
|
201
|
+
And the exit status should be 0
|
202
|
+
|
203
|
+
Scenario: Change the logging level back to INFO
|
204
|
+
When I call the nexus "set_logger_level info" command
|
205
|
+
Then the output should contain:
|
206
|
+
"""
|
207
|
+
The logging level of Nexus has been set to INFO
|
208
|
+
"""
|
209
|
+
And the exit status should be 0
|
210
|
+
|
211
|
+
Scenario: Create a Nexus Group Repository
|
212
|
+
When I call the nexus "create_group_repository cucumber_group" command
|
213
|
+
Then the output should contain:
|
214
|
+
"""
|
215
|
+
A new group repository named cucumber_group has been created.
|
216
|
+
"""
|
217
|
+
And the exit status should be 0
|
218
|
+
|
219
|
+
Scenario: Get information about a Nexus Group Repository
|
220
|
+
When I call the nexus "get_group_repository cucumber_group" command
|
221
|
+
Then the output should contain:
|
222
|
+
"""
|
223
|
+
\"id\":\"cucumber_group\"
|
224
|
+
"""
|
225
|
+
And the exit status should be 0
|
226
|
+
|
227
|
+
Scenario: Add a repository to the Nexus Group Repository
|
228
|
+
When I call the nexus "add_to_group_repository cucumber_group releases" command
|
229
|
+
Then the output should contain:
|
230
|
+
"""
|
231
|
+
The repository releases has been added to the repository group cucumber_group
|
232
|
+
"""
|
233
|
+
And the exit status should be 0
|
234
|
+
|
235
|
+
Scenario: Remove a repository from a Nexus Group Repository
|
236
|
+
When I call the nexus "remove_from_group_repository cucumber_group releases" command
|
237
|
+
And I call the nexus "get_group_repository cucumber_group" command
|
238
|
+
Then the output should not contain:
|
239
|
+
"""
|
240
|
+
\"id\"=>\"releases\"
|
241
|
+
"""
|
242
|
+
And the exit status should be 0
|
243
|
+
|
244
|
+
Scenario: Delete a Nexus Group Repository
|
245
|
+
When I call the nexus "delete_group_repository cucumber_group" command
|
246
|
+
And I call the nexus "get_group_repository cucumber_group" command
|
247
|
+
Then the output should not contain:
|
248
|
+
"""
|
249
|
+
\"id\":\"cucumber_group\"
|
250
|
+
"""
|
251
|
+
And the exit status should be 114
|