nexus_cli_nx 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.travis.yml +6 -0
  4. data/CHANGELOG.md +23 -0
  5. data/Gemfile +41 -0
  6. data/Guardfile +27 -0
  7. data/LICENSE +15 -0
  8. data/README.md +123 -0
  9. data/Rakefile +1 -0
  10. data/Thorfile +66 -0
  11. data/VERSION +1 -0
  12. data/bin/nexus-cli +10 -0
  13. data/data/pom.xml.erb +13 -0
  14. data/features/nexus_oss.feature +259 -0
  15. data/features/pro/nexus_custom_metadata.feature +116 -0
  16. data/features/pro/nexus_pro.feature +101 -0
  17. data/features/step_definitions/cli_steps.rb +105 -0
  18. data/features/support/env.rb +64 -0
  19. data/lib/nexus_cli.rb +44 -0
  20. data/lib/nexus_cli/artifact.rb +44 -0
  21. data/lib/nexus_cli/base_remote.rb +16 -0
  22. data/lib/nexus_cli/cli.rb +7 -0
  23. data/lib/nexus_cli/configuration.rb +101 -0
  24. data/lib/nexus_cli/connection.rb +84 -0
  25. data/lib/nexus_cli/errors.rb +259 -0
  26. data/lib/nexus_cli/mixins/artifact_actions.rb +239 -0
  27. data/lib/nexus_cli/mixins/global_settings_actions.rb +64 -0
  28. data/lib/nexus_cli/mixins/logging_actions.rb +45 -0
  29. data/lib/nexus_cli/mixins/pro/custom_metadata_actions.rb +176 -0
  30. data/lib/nexus_cli/mixins/pro/smart_proxy_actions.rb +219 -0
  31. data/lib/nexus_cli/mixins/repository_actions.rb +245 -0
  32. data/lib/nexus_cli/mixins/user_actions.rb +125 -0
  33. data/lib/nexus_cli/n3_metadata.rb +77 -0
  34. data/lib/nexus_cli/remote/oss_remote.rb +11 -0
  35. data/lib/nexus_cli/remote/pro_remote.rb +59 -0
  36. data/lib/nexus_cli/remote_factory.rb +30 -0
  37. data/lib/nexus_cli/tasks.rb +507 -0
  38. data/lib/nexus_cli/version.rb +6 -0
  39. data/nexus_cli_nx.gemspec +32 -0
  40. data/spec/fixtures/metadata_search.xml +10 -0
  41. data/spec/fixtures/nexus.config +4 -0
  42. data/spec/spec_helper.rb +22 -0
  43. data/spec/unit/nexus_cli/artifact_spec.rb +82 -0
  44. data/spec/unit/nexus_cli/configuration_spec.rb +159 -0
  45. data/spec/unit/nexus_cli/mixins/pro/custom_metadata_actions_spec.rb +21 -0
  46. data/spec/unit/nexus_cli/oss_remote_spec.rb +83 -0
  47. data/spec/unit/nexus_cli/pro_remote_spec.rb +110 -0
  48. data/spec/unit/nexus_cli/remote_factory_spec.rb +42 -0
  49. metadata +263 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7346dbfd11153f92f60e317773c355eea0a829f37d1c566375de5feb9cb13ce7
4
+ data.tar.gz: e0e7589a81334d0a736478cf8a21df8496c600cda5b7e546d3b5a9861b13b358
5
+ SHA512:
6
+ metadata.gz: 66d2697eed3ab7291a3bf67b635bba4fa7b5c069f6f6932bf53e338e8adadde4348618c1fb5a3a674e35261a7c58909f96548c91bf9cfe91266e99175a627297
7
+ data.tar.gz: 6110e0d5bc74fc415b7a6dffdf7ae4906c3a8697d257833af5ba2f58931b901076a6c25fe645cba6190b78d6f01910d7f47c66717bd0b34d8776587572f89f89
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ .idea
2
+ .DS_Store
3
+ .rake_tasks~
4
+ .project
5
+ .buildpath
6
+ tmp/
7
+ pkg/
8
+ *.gem
9
+ global_settings.json
10
+ Gemfile.lock
11
+ doc/
12
+ .yardoc/
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ script:
6
+ - rspec --color --format=documentation spec
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # 4.1.0
2
+
3
+ * [#92](https://github.com/RiotGames/nexus_cli/pull/92) Added a new task for gettting an artifact's download URL
4
+ * Add License to Gemspec
5
+
6
+ # 4.0.3
7
+
8
+ * Support old-style overriding of config file.
9
+
10
+ # 4.0.2
11
+
12
+ * #89 - Restrict activesupport gem to 3.2.0 .
13
+
14
+ # 4.0.1
15
+
16
+ * Actually support anonymous browsing
17
+
18
+ # 4.0.0
19
+
20
+ * Major Change - GAV ordering that used to be G:A:V:E has changed to G:A:E:C:V
21
+ * Support for an anonymous connection to the Nexus server
22
+ * Added support for Maven classifiers
23
+ * In general, references to an 'artifact' (GAV identifier) have been renamed to 'coordinates'
data/Gemfile ADDED
@@ -0,0 +1,41 @@
1
+ source 'https://rubygems.org'
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 'fuubar'
41
+ 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,123 @@
1
+ # Nexus CLI No-eXtlib
2
+
3
+ A CLI wrapper around Sonatype Nexus REST calls.
4
+
5
+ This is a fork of [nexus_cli](https://github.com/RiotGamesMinions/nexus_cli) without chozo/extlib dependencies.
6
+ The original author is Kyle Allan of RiotGames.
7
+
8
+ # Requirements
9
+
10
+ * Ruby
11
+
12
+ # Installation
13
+
14
+ 1. Install the Gem - `gem install nexus_cli`
15
+ 2. Create a file in your user's home directory named `.nexus_cli`
16
+ 3. Give the file the following information:
17
+
18
+ ```
19
+ url: "http://my-nexus-server/nexus/"
20
+ repository: "my-repository-id"
21
+ username: "username"
22
+ password: "password"
23
+ ```
24
+
25
+ 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.
26
+
27
+ # Usage
28
+
29
+ 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`
30
+
31
+ One can also search for artifacts and get back raw xml containing matches.
32
+
33
+ ## Listing of Available Commands
34
+
35
+ ```
36
+ nexus-cli add_to_group_repository group_id repository_to_add_id # Adds a repository with the given id into the group repository.
37
+ nexus-cli add_trusted_key --certificate=CERTIFICATE --description=DESCRIPTION # Adds a new trusted key to the Smart Proxy configuration.
38
+ nexus-cli change_password user_id # Changes the given user's passwords to a new one.
39
+ nexus-cli clear_artifact_custom_info coordinates # Clears the artifact custom metadata.
40
+ nexus-cli create_group_repository name # Creates a new repository group with the given name.
41
+ nexus-cli create_repository name # Creates a new Repository with the provided name.
42
+ nexus-cli create_user # Creates a new user
43
+ nexus-cli delete_group_repository group_id # Deletes a group repository based on the given id.
44
+ nexus-cli delete_repository name # Deletes a Repository with the provided name.
45
+ nexus-cli delete_trusted_key key_id # Deletes a trusted key using the given key_id.
46
+ nexus-cli delete_user user_id # Deletes the user with the given id.
47
+ nexus-cli disable_artifact_publish repository_id # Sets a repository to disable the publishing of updates about its artifacts.
48
+ nexus-cli disable_artifact_subscribe repository_id # Sets a repository to stop subscribing to updates about artifacts.
49
+ nexus-cli disable_smart_proxy # Disables Smart Proxy on the server.
50
+ nexus-cli enable_artifact_publish repository_id # Sets a repository to enable the publishing of updates about its artifacts.
51
+ nexus-cli enable_artifact_subscribe repository_id # Sets a repository to subscribe to updates about artifacts.
52
+ nexus-cli enable_smart_proxy # Enables Smart Proxy on the server.
53
+ nexus-cli get_artifact_custom_info coordinates # Gets and returns the custom metadata in XML format about a particular artifact.
54
+ nexus-cli get_artifact_info coordinates # Gets and returns the metadata in XML format about a particular artifact.
55
+ nexus-cli get_global_settings # Prints out your Nexus' current setttings and saves them to a file.
56
+ nexus-cli get_group_repository group_id # Gets information about the given group repository.
57
+ nexus-cli get_license_info # Returns the license information of the server.
58
+ nexus-cli get_logging_info # Gets the log4j Settings of the Nexus server.
59
+ nexus-cli get_nexus_configuration # Prints out configuration from the .nexus_cli file that helps inform where artifacts will be uploaded.
60
+ nexus-cli get_nexus_status # Prints out information about the Nexus instance.
61
+ nexus-cli get_pub_sub repository_id # Returns the publish/subscribe status of the given repository.
62
+ nexus-cli get_repository_info name # Finds and returns information about the provided Repository.
63
+ nexus-cli get_smart_proxy_settings # Returns the Smart Proxy settings of the server.
64
+ nexus-cli get_trusted_keys # Returns the trusted keys of the server.
65
+ nexus-cli get_users # Returns XML representing the users in Nexus.
66
+ nexus-cli help [COMMAND] # Describe available commands or one specific command
67
+ nexus-cli install_license license_file # Installs a license file into the server.
68
+ nexus-cli pull_artifact coordinates # Pulls an artifact from Nexus and places it on your machine.
69
+ nexus-cli push_artifact coordinates file # Pushes an artifact from your machine onto the Nexus.
70
+ nexus-cli remove_from_group_repository group_id repository_to_remove_id # Remove a repository with the given id from the group repository.
71
+ nexus-cli reset_global_settings # Resets your Nexus global_settings to their out-of-the-box defaults.
72
+ 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.
73
+ nexus-cli search_for_artifacts # Searches for all the versions of a particular artifact and prints it to the screen.
74
+ nexus-cli set_logger_level level # Updates the log4j logging level to a new value.
75
+ nexus-cli transfer_artifact coordinates from_repository to_repository # Transfers a given artifact from one repository to another.
76
+ nexus-cli update_artifact_custom_info coordinates param1 param2 ... # Updates the artifact custom metadata with the given key-value pairs.
77
+ nexus-cli update_user user_id # Updates a user's details. Leave fields blank for them to remain their current values.
78
+ nexus-cli upload_global_settings # Uploads a global_settings.json file to your Nexus to update its settings.
79
+ ```
80
+
81
+ Each command can be prefaced with `help` to get more information about the command. For example - `nexus-cli help get_users`
82
+
83
+ There are also two global config options, `--overrides` which overrides the configruation in `~/.nexus_cli` and `--ssl-verify false` which turns off SSL verification.
84
+
85
+ ## Pull Artifact Example
86
+
87
+ ```
88
+ nexus-cli pull_artifact com.mycompany.artifacts:myartifact:tgz:1.0.0
89
+ ```
90
+
91
+ ## Push Artifact Example
92
+
93
+ ```
94
+ nexus-cli push_artifact com.mycompany.artifacts:myartifact:tgz:1.0.0 ~/path/to/file/to/push/myartifact.tgz
95
+ ```
96
+
97
+ ## Search Example
98
+
99
+ ```
100
+ nexus-cli search_for_artifacts com.mycompany.artifacts:myartifact
101
+
102
+ or more generic if you wish:
103
+
104
+ nexus-cli search_for_artifacts com.mycompany.artifacts
105
+ ```
106
+
107
+ # License and Author
108
+
109
+ Author:: Kyle Allan (<kallan@riotgames.com>)
110
+
111
+ Copyright:: 2013 Riot Games Inc.
112
+
113
+ Licensed under the Apache License, Version 2.0 (the "License");
114
+ you may not use this file except in compliance with the License.
115
+ You may obtain a copy of the License at
116
+
117
+ http://www.apache.org/licenses/LICENSE-2.0
118
+
119
+ Unless required by applicable law or agreed to in writing, software
120
+ distributed under the License is distributed on an "AS IS" BASIS,
121
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122
+ See the License for the specific language governing permissions and
123
+ 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_nx-#{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.1.2
data/bin/nexus-cli ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ $:.push File.expand_path("../../lib", __FILE__)
3
+ require 'nexus_cli'
4
+
5
+ begin
6
+ NexusCli::Cli.start
7
+ rescue NexusCli::NexusCliError => e
8
+ NexusCli.ui.say e.message, :red
9
+ exit e.status_code
10
+ end
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,259 @@
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
+ Scenario: Get an artifact's download URL
58
+ When I call the nexus "get_artifact_download_url com.test:mytest" command
59
+ Then the output should contain:
60
+ """
61
+ com/test/mytest/1.0.0/mytest-1.0.0.tgz
62
+ """
63
+ And the exit status should be 0
64
+
65
+ @transfer
66
+ Scenario: Transfer an artifact between repositories
67
+ When I call the nexus "transfer com.test:mytest:tgz:1.0.0 releases thirdparty" command
68
+ Then the output should contain:
69
+ """
70
+ The artifact com.test:mytest:tgz:1.0.0 has been transferred from releases to thirdparty.
71
+ """
72
+ And the exit status should be 0
73
+
74
+ @delete
75
+ Scenario: Attempt to delete an artifact
76
+ When I delete an artifact with the GAV of "com.test:mytest:tgz:1.0.0"
77
+ And I call the nexus "info com.test:mytest:tgz:1.0.0" command
78
+ Then the output should contain:
79
+ """
80
+ The artifact you requested information for could not be found. Please ensure it exists inside the Nexus.
81
+ """
82
+ And the exit status should be 101
83
+
84
+ @delete
85
+ Scenario: Attempt to delete another artifact
86
+ When I delete an artifact with the GAV of "com.test:mytest:tgz:1.0.0" from the "thirdparty" repository
87
+ And I call the nexus "info com.test:mytest:tgz:1.0.0" command overriding "repository:thirdparty"
88
+ Then the output should contain:
89
+ """
90
+ The artifact you requested information for could not be found. Please ensure it exists inside the Nexus.
91
+ """
92
+ And the exit status should be 101
93
+
94
+
95
+ Scenario: Get the current global settings of Nexus
96
+ When I call the nexus "get_global_settings" command
97
+ Then the output should contain:
98
+ """
99
+ Your current Nexus global settings have been written to the file: ~/.nexus/global_settings.json
100
+ """
101
+ And a file named "global_settings.json" should exist in my nexus folder
102
+ And the exit status should be 0
103
+
104
+ Scenario: Update the global settings of Nexus
105
+ When I call the nexus "get_global_settings" command
106
+ And I edit the "global_settings.json" files "forceBaseUrl" field to true
107
+ And I call the nexus "upload_global_settings" command
108
+ Then the output should contain:
109
+ """
110
+ Your global_settings.json file has been uploaded to Nexus
111
+ """
112
+ When I call the nexus "get_global_settings" command
113
+ Then the file "global_settings.json" in my nexus folder should contain:
114
+ """
115
+ "forceBaseUrl": true
116
+ """
117
+ And the exit status should be 0
118
+
119
+ Scenario: Update the global settings of Nexus with a string
120
+ When I update global settings uiTimeout to 61 and upload the json string
121
+ And I call the nexus "get_global_settings" command
122
+ Then the file "global_settings.json" in my nexus folder should contain:
123
+ """
124
+ "uiTimeout": 61
125
+ """
126
+ And the exit status should be 0
127
+
128
+ Scenario: Reset the global settings of Nexus
129
+ When I call the nexus "reset_global_settings" command
130
+ Then the output should contain:
131
+ """
132
+ Your Nexus global settings have been reset to their default values
133
+ """
134
+ When I call the nexus "get_global_settings" command
135
+ Then the file "global_settings.json" in my nexus folder should contain:
136
+ """
137
+ "forceBaseUrl": false
138
+ """
139
+ And the exit status should be 0
140
+
141
+ Scenario: Create a new repository in Nexus
142
+ When I call the nexus "create_repository Artifacts" command
143
+ Then the output should contain:
144
+ """
145
+ A new Repository named Artifacts has been created.
146
+ """
147
+ And the exit status should be 0
148
+
149
+ Scenario: Delete a repository in Nexus
150
+ When I call the nexus "delete_repository Artifacts" command
151
+ And I call the nexus "get_repository_info Artifacts" command
152
+ Then the output should contain:
153
+ """
154
+ The repository you provided could not be found. Please ensure the repository exists.
155
+ """
156
+ And the exit status should be 114
157
+
158
+ Scenario: Create a new user
159
+ 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
160
+ And I call the nexus "get_users" command
161
+ Then the output should contain:
162
+ """
163
+ <userId>cucumber</userId>
164
+ """
165
+ And the exit status should be 0
166
+
167
+ Scenario: Change a users information
168
+ When I call the nexus "update_user cucumber --first_name=Mike --last_name=Ditka --email= --enabled --roles=" command
169
+ And I call the nexus "get_users" command
170
+ Then the output should contain:
171
+ """
172
+ <lastName>Ditka</lastName>
173
+ """
174
+ And the exit status should be 0
175
+
176
+ Scenario: Change a users password
177
+ When I call the nexus "change_password cucumber --oldPassword=pass --newPassword=foo" command
178
+ And I call the nexus "get_users" command as the "cucumber" user with password "wrongPassword"
179
+ Then the output should contain:
180
+ """
181
+ Your request was denied by the Nexus server due to a permissions error
182
+ """
183
+ And the exit status should be 106
184
+
185
+ Scenario: Delete a user
186
+ When I call the nexus "delete_user cucumber" command
187
+ And I call the nexus "get_users" command
188
+ Then the output should not contain:
189
+ """
190
+ <userId>cucumber</userId>
191
+ """
192
+ And the exit status should be 0
193
+
194
+ Scenario: Get Logging Info
195
+ When I call the nexus "get_logging_info" command
196
+ Then the output should contain:
197
+ """
198
+ \"rootLoggerLevel\":\"INFO\"
199
+ """
200
+ And the exit status should be 0
201
+
202
+ Scenario: Change the logging level to DEBUG
203
+ When I call the nexus "set_logger_level debug" command
204
+ And I call the nexus "get_logging_info" command
205
+ Then the output should contain:
206
+ """
207
+ \"rootLoggerLevel\":\"DEBUG\"
208
+ """
209
+ And the exit status should be 0
210
+
211
+ Scenario: Change the logging level back to INFO
212
+ When I call the nexus "set_logger_level info" command
213
+ Then the output should contain:
214
+ """
215
+ The logging level of Nexus has been set to INFO
216
+ """
217
+ And the exit status should be 0
218
+
219
+ Scenario: Create a Nexus Group Repository
220
+ When I call the nexus "create_group_repository cucumber_group" command
221
+ Then the output should contain:
222
+ """
223
+ A new group repository named cucumber_group has been created.
224
+ """
225
+ And the exit status should be 0
226
+
227
+ Scenario: Get information about a Nexus Group Repository
228
+ When I call the nexus "get_group_repository cucumber_group" command
229
+ Then the output should contain:
230
+ """
231
+ \"id\":\"cucumber_group\"
232
+ """
233
+ And the exit status should be 0
234
+
235
+ Scenario: Add a repository to the Nexus Group Repository
236
+ When I call the nexus "add_to_group_repository cucumber_group releases" command
237
+ Then the output should contain:
238
+ """
239
+ The repository releases has been added to the repository group cucumber_group
240
+ """
241
+ And the exit status should be 0
242
+
243
+ Scenario: Remove a repository from a Nexus Group Repository
244
+ When I call the nexus "remove_from_group_repository cucumber_group releases" command
245
+ And I call the nexus "get_group_repository cucumber_group" command
246
+ Then the output should not contain:
247
+ """
248
+ \"id\"=>\"releases\"
249
+ """
250
+ And the exit status should be 0
251
+
252
+ Scenario: Delete a Nexus Group Repository
253
+ When I call the nexus "delete_group_repository cucumber_group" command
254
+ And I call the nexus "get_group_repository cucumber_group" command
255
+ Then the output should not contain:
256
+ """
257
+ \"id\":\"cucumber_group\"
258
+ """
259
+ And the exit status should be 114