octopus-serverspec-extensions 0.17.1 → 0.19.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +14 -14
  3. data/.rspec +2 -2
  4. data/.travis.yml +5 -5
  5. data/Gemfile +4 -4
  6. data/LICENSE.txt +12 -12
  7. data/README.md +39 -39
  8. data/Rakefile +6 -6
  9. data/bin/console +14 -14
  10. data/bin/setup +8 -8
  11. data/docs/authentication.md +45 -45
  12. data/docs/octopus_deploy_account.md +37 -37
  13. data/docs/octopus_deploy_doc_template.md +16 -16
  14. data/docs/octopus_deploy_environment.md +32 -32
  15. data/docs/octopus_deploy_project_group.md +30 -30
  16. data/docs/octopus_deploy_smtp_config.md +39 -39
  17. data/docs/octopus_deploy_space.md +32 -32
  18. data/docs/octopus_deploy_team.md +25 -25
  19. data/docs/octopus_deploy_tentacle.md +40 -40
  20. data/docs/octopus_deploy_upgrade_config.md +33 -33
  21. data/docs/octopus_deploy_user.md +33 -33
  22. data/docs/octopus_deploy_worker.md +38 -38
  23. data/docs/octopus_deploy_worker_pool.md +25 -25
  24. data/lib/octopus_serverspec_extensions.rb +85 -85
  25. data/lib/octopus_serverspec_extensions/matcher/allow_dynamic_infrastructure.rb +12 -12
  26. data/lib/octopus_serverspec_extensions/matcher/have_linux_line_endings.rb +13 -13
  27. data/lib/octopus_serverspec_extensions/matcher/have_version.rb +36 -36
  28. data/lib/octopus_serverspec_extensions/matcher/have_windows_line_endings.rb +13 -13
  29. data/lib/octopus_serverspec_extensions/matcher/run_under_account.rb +17 -17
  30. data/lib/octopus_serverspec_extensions/matcher/use_guided_failure.rb +12 -12
  31. data/lib/octopus_serverspec_extensions/type/chocolatey_package.rb +33 -33
  32. data/lib/octopus_serverspec_extensions/type/java_property_file.rb +28 -28
  33. data/lib/octopus_serverspec_extensions/type/npm_package.rb +36 -36
  34. data/lib/octopus_serverspec_extensions/type/octopus_deploy_account.rb +176 -176
  35. data/lib/octopus_serverspec_extensions/type/octopus_deploy_environment.rb +117 -117
  36. data/lib/octopus_serverspec_extensions/type/octopus_deploy_project_group.rb +127 -127
  37. data/lib/octopus_serverspec_extensions/type/octopus_deploy_smtp_config.rb +109 -109
  38. data/lib/octopus_serverspec_extensions/type/octopus_deploy_space.rb +92 -92
  39. data/lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb +81 -81
  40. data/lib/octopus_serverspec_extensions/type/octopus_deploy_tentacle.rb +208 -208
  41. data/lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb +112 -112
  42. data/lib/octopus_serverspec_extensions/type/octopus_deploy_user.rb +110 -110
  43. data/lib/octopus_serverspec_extensions/type/octopus_deploy_worker.rb +173 -173
  44. data/lib/octopus_serverspec_extensions/type/octopus_deploy_worker_pool.rb +88 -88
  45. data/lib/octopus_serverspec_extensions/type/windows_dsc.rb +37 -32
  46. data/lib/octopus_serverspec_extensions/type/windows_firewall.rb +32 -32
  47. data/lib/octopus_serverspec_extensions/type/windows_scheduled_task.rb +33 -33
  48. data/lib/octopus_serverspec_extensions/version.rb +3 -3
  49. data/octopus-serverspec-extensions.gemspec +34 -34
  50. metadata +17 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5633418a1e8ae85805eeabef99aac9421b8fac79aa712af8561b269a2255dc8b
4
- data.tar.gz: e03edfa9c91ca5e619942596655ce0c59b23b9f9175e7bd00b936458374982ed
3
+ metadata.gz: 158a488c7284b8d249affc20bcb90eee1e26a6700b66bbc3da3469c143d0352b
4
+ data.tar.gz: e9a8c680b4c4606672565c12663d5ad4f9051f59617c0d69aa73338f3afa42ec
5
5
  SHA512:
6
- metadata.gz: 8cb9a7fa6a56d69103d8c458f1b890410754a72b558f665cdca0edf57c889b85ed4caa72f84ed6216dc81a8416aa577d2fb1c99d11dc075103e9ed676614c8dc
7
- data.tar.gz: 81a37c15a7386cdf2cb43b40ab1ec3920b210be2b72a9d41b33322c308ea84028cef64f5b0821edd22944cbe075ca0bf0461f012639491c8bb3109320eac74a7
6
+ metadata.gz: efdeb27913b617b7e1e7bddc7f22893eeeed3f743fd02fba39c0c1a16cb94627a45256c687ec9f63aa30a6f7b9b0812ddf0384d9e8bbc668c7e4c18a517d38ee
7
+ data.tar.gz: c4efe6b587317aec62c5447761af436f4dd482edbab5b9160902fdc236fa1df4527a8392c6219079c5ddc98a04dff43006c0f80f91f3155bdea12b8bfe0199f7
data/.gitignore CHANGED
@@ -1,14 +1,14 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- octopus-serverspec-extensions-*.gem
11
- vendor/
12
- /.idea/
13
- publish.ps1
14
- /.scratch/
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ octopus-serverspec-extensions-*.gem
11
+ vendor/
12
+ /.idea/
13
+ publish.ps1
14
+ /.scratch/
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --format documentation
2
- --color
1
+ --format documentation
2
+ --color
@@ -1,5 +1,5 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.13.6
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.13.6
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in octopus-serverspec-extensions.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in octopus-serverspec-extensions.gemspec
4
+ gemspec
@@ -1,12 +1,12 @@
1
- Copyright (c) Octopus Deploy and contributors. All rights reserved.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- these files except in compliance with the License. You may obtain a copy of the
5
- License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software distributed
10
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
12
- specific language governing permissions and limitations under the License.
1
+ Copyright (c) Octopus Deploy and contributors. All rights reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ these files except in compliance with the License. You may obtain a copy of the
5
+ License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software distributed
10
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
12
+ specific language governing permissions and limitations under the License.
data/README.md CHANGED
@@ -1,39 +1,39 @@
1
- # Octopus::Serverspec::Extensions
2
-
3
- SeverSpec extensions for Windows, adding support for chocolatey packages, npm packages, service accounts and more.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'octopus-serverspec-extensions'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install octopus-serverspec-extensions
20
-
21
- ## Usage
22
-
23
- TODO: Write usage instructions here
24
-
25
- ## Development
26
-
27
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
-
29
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
-
31
- ## Contributing
32
-
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/octopus-deploy/octopus-serverspec-extensions.
34
-
35
-
36
- ## License
37
-
38
- The gem is available as open source under the terms of the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
39
-
1
+ # Octopus::Serverspec::Extensions
2
+
3
+ SeverSpec extensions for Windows, adding support for chocolatey packages, npm packages, service accounts and more.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'octopus-serverspec-extensions'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install octopus-serverspec-extensions
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/octopus-deploy/octopus-serverspec-extensions.
34
+
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
39
+
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "octopus/serverspec/extensions"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "octopus/serverspec/extensions"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,45 +1,45 @@
1
- # Authenticating to your Octopus Server
2
-
3
- There are two main ways of authenticating to your Octopus Server from your ServerSpec tests.
4
-
5
- #### 1. Using Automatic Environment Variables
6
-
7
- If you do not provide a URL and API key in your type call, the type will try to fall back to environment variables.
8
-
9
- This option is much cleaner to read, and helps to protect you from leaked credentials, but can be less explicit if you're testing against multiple Octopus Instances.
10
-
11
- | Variable | Description |
12
- |:----------------------|:----------------------------------------------------------------------------------------|
13
- | OCTOPUS_CLI_SERVER | The http or https URL of your Octopus Deploy server: e.g. https://octopus.example.com/ |
14
- | OCTOPUS_CLI_API_KEY | A valid API key, with rights to view the resources you're testing |
15
-
16
- The following example will attempt to use the Environment variables. If they are not present, it will raise an exception:
17
-
18
- ```ruby
19
- describe octopus_deploy_account('myawsaccount').in_space('Octopus') do
20
- it { should exist }
21
- end
22
- ```
23
-
24
- #### 2. Provide creds with each type
25
-
26
- This method makes sense if you're testing multiple Octopus Servers in the same ruby script, and need a visual cue to which servers you're testing in a specific block.
27
-
28
- Simply provide the URL and API key of your Octopus server as the first two parameters in your type
29
-
30
- The following example will connect to a specific server using a specific API key:
31
-
32
- ```ruby
33
- describe octopus_deploy_account('https://octopus.example.com/', 'API-1234ABCDE5678FGHI', 'myawsaccount').in_space('Octopus') do
34
- it { should exist }
35
- end
36
- ```
37
-
38
- #### 3. Using your own Environment Variables
39
- You can provide the types with a different environment variable by using Ruby's `ENV[]` hash.
40
-
41
- ```ruby
42
- describe octopus_deploy_smtp_config(ENV['MY_OCTOPUS_URL'], ENV['MY_OCTOPUS_API_KEY']) do
43
- it { should be_configured }
44
- end
45
- ```
1
+ # Authenticating to your Octopus Server
2
+
3
+ There are two main ways of authenticating to your Octopus Server from your ServerSpec tests.
4
+
5
+ #### 1. Using Automatic Environment Variables
6
+
7
+ If you do not provide a URL and API key in your type call, the type will try to fall back to environment variables.
8
+
9
+ This option is much cleaner to read, and helps to protect you from leaked credentials, but can be less explicit if you're testing against multiple Octopus Instances.
10
+
11
+ | Variable | Description |
12
+ |:----------------------|:----------------------------------------------------------------------------------------|
13
+ | OCTOPUS_CLI_SERVER | The http or https URL of your Octopus Deploy server: e.g. https://octopus.example.com/ |
14
+ | OCTOPUS_CLI_API_KEY | A valid API key, with rights to view the resources you're testing |
15
+
16
+ The following example will attempt to use the Environment variables. If they are not present, it will raise an exception:
17
+
18
+ ```ruby
19
+ describe octopus_deploy_account('myawsaccount').in_space('Octopus') do
20
+ it { should exist }
21
+ end
22
+ ```
23
+
24
+ #### 2. Provide creds with each type
25
+
26
+ This method makes sense if you're testing multiple Octopus Servers in the same ruby script, and need a visual cue to which servers you're testing in a specific block.
27
+
28
+ Simply provide the URL and API key of your Octopus server as the first two parameters in your type
29
+
30
+ The following example will connect to a specific server using a specific API key:
31
+
32
+ ```ruby
33
+ describe octopus_deploy_account('https://octopus.example.com/', 'API-1234ABCDE5678FGHI', 'myawsaccount').in_space('Octopus') do
34
+ it { should exist }
35
+ end
36
+ ```
37
+
38
+ #### 3. Using your own Environment Variables
39
+ You can provide the types with a different environment variable by using Ruby's `ENV[]` hash.
40
+
41
+ ```ruby
42
+ describe octopus_deploy_smtp_config(ENV['MY_OCTOPUS_URL'], ENV['MY_OCTOPUS_API_KEY']) do
43
+ it { should be_configured }
44
+ end
45
+ ```
@@ -1,37 +1,37 @@
1
- # octopus_deploy_account
2
-
3
- Describes an [Octopus Infrastructure Account](https://octopus.com/docs/infrastructure/accounts).
4
-
5
- A number of properties of Accounts (such as passwords & secret keys) are [sensitive]() values, therefore we can't directly test them.
6
-
7
- ## Example
8
-
9
- ```ruby
10
-
11
- describe octopus_deploy_account("myawsaccount").in_space("Octopus") do
12
- it { should exist }
13
- it { should be_aws_account }
14
- it { should_not be_azure_account }
15
- it { should have_description('My main AWS account') }
16
- end
17
-
18
- ```
19
-
20
- #### Type
21
-
22
- ```ruby
23
- octopus_deploy_account([server_url, api_key], account_name)
24
- octopus_account([server_url, api_key], account_name)
25
- ```
26
-
27
- #### Matchers
28
-
29
- | Matcher | Description |
30
- |:--------|:------------|
31
- | should exist | Tests if an account of the name exists |
32
- | should be_aws_account | Amazon Web Services account |
33
- | should be_azure_account | Microsoft Azure account |
34
- | should be_ssh_key_pair | SSH keypair |
35
- | should be_token | A token for use with services such as Kubernetes|
36
- | should be_username_password | A username and password for use with services supporting user/pass |
37
-
1
+ # octopus_deploy_account
2
+
3
+ Describes an [Octopus Infrastructure Account](https://octopus.com/docs/infrastructure/accounts).
4
+
5
+ A number of properties of Accounts (such as passwords & secret keys) are [sensitive]() values, therefore we can't directly test them.
6
+
7
+ ## Example
8
+
9
+ ```ruby
10
+
11
+ describe octopus_deploy_account("myawsaccount").in_space("Octopus") do
12
+ it { should exist }
13
+ it { should be_aws_account }
14
+ it { should_not be_azure_account }
15
+ it { should have_description('My main AWS account') }
16
+ end
17
+
18
+ ```
19
+
20
+ #### Type
21
+
22
+ ```ruby
23
+ octopus_deploy_account([server_url, api_key], account_name)
24
+ octopus_account([server_url, api_key], account_name)
25
+ ```
26
+
27
+ #### Matchers
28
+
29
+ | Matcher | Description |
30
+ |:--------|:------------|
31
+ | should exist | Tests if an account of the name exists |
32
+ | should be_aws_account | Amazon Web Services account |
33
+ | should be_azure_account | Microsoft Azure account |
34
+ | should be_ssh_key_pair | SSH keypair |
35
+ | should be_token | A token for use with services such as Kubernetes|
36
+ | should be_username_password | A username and password for use with services supporting user/pass |
37
+
@@ -1,17 +1,17 @@
1
- # octopus_deploy_user
2
-
3
-
4
-
5
- ## Example
6
-
7
-
8
- #### Type
9
-
10
- ```ruby
11
-
12
- ```
13
-
14
- #### Matchers
15
-
16
- | Matcher | Description |
1
+ # octopus_deploy_user
2
+
3
+
4
+
5
+ ## Example
6
+
7
+
8
+ #### Type
9
+
10
+ ```ruby
11
+
12
+ ```
13
+
14
+ #### Matchers
15
+
16
+ | Matcher | Description |
17
17
  |:--------|:------------|
@@ -1,33 +1,33 @@
1
- # octopus_deploy_environment
2
-
3
- Tests an Octopus Deploy [Environment](https://octopus.com/docs/infrastructure/environments) resource.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_deploy_environment('Production').in_space('Team Octopus') do
9
- it { should exist }
10
- end
11
- ```
12
-
13
- #### Type
14
-
15
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md), and whether your target environment is in a [Space](https://octopus.com/blog/spaces-introduction).
16
-
17
- ```ruby
18
- octopus_deploy_environment(url, api_key, environment_name) # url and apikey provided
19
- octopus_deploy_environment(environment_name) # using environment vars
20
- octopus_environment(environment_name).in_space(space_name) # using environment vars, in a [space](https://octopus.com/blog/spaces-introduction)
21
- octopus_environment(url, api_key, environment_name)
22
- octopus_environment(environment_name)
23
- octopus_environment(url, api_key, environment_name).in_space(space_name)
24
- ```
25
-
26
- #### Matchers
27
-
28
- | Matcher | Description |
29
- |:--------|:------------|
30
- | should exist | Tests for the existence of a given Environment |
31
- | should use_guided_failure | Tests if the Environment has the Use Guided Failure default applied |
32
- | should allow_dynamic_infrastructure | Tests if the checkbox for [Allow Dynamic Infrastructure](https://octopus.com/docs/infrastructure/environments#enabling-dynamic-infrastructure) is checked |
1
+ # octopus_deploy_environment
2
+
3
+ Tests an Octopus Deploy [Environment](https://octopus.com/docs/infrastructure/environments) resource.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_deploy_environment('Production').in_space('Team Octopus') do
9
+ it { should exist }
10
+ end
11
+ ```
12
+
13
+ #### Type
14
+
15
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md), and whether your target environment is in a [Space](https://octopus.com/blog/spaces-introduction).
16
+
17
+ ```ruby
18
+ octopus_deploy_environment(url, api_key, environment_name) # url and apikey provided
19
+ octopus_deploy_environment(environment_name) # using environment vars
20
+ octopus_environment(environment_name).in_space(space_name) # using environment vars, in a [space](https://octopus.com/blog/spaces-introduction)
21
+ octopus_environment(url, api_key, environment_name)
22
+ octopus_environment(environment_name)
23
+ octopus_environment(url, api_key, environment_name).in_space(space_name)
24
+ ```
25
+
26
+ #### Matchers
27
+
28
+ | Matcher | Description |
29
+ |:--------|:------------|
30
+ | should exist | Tests for the existence of a given Environment |
31
+ | should use_guided_failure | Tests if the Environment has the Use Guided Failure default applied |
32
+ | should allow_dynamic_infrastructure | Tests if the checkbox for [Allow Dynamic Infrastructure](https://octopus.com/docs/infrastructure/environments#enabling-dynamic-infrastructure) is checked |
33
33