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
@@ -1,31 +1,31 @@
1
- # octopus_deploy_project_group
2
-
3
- Describes an Octopus [Project Group](https://octopus.com/docs/deployment-process/projects#project-group) resource.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_project_group('Important Projects') do
9
- it { should have_description('These are my Very Important projects') }
10
- end
11
- ```
12
-
13
- #### Type
14
-
15
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
16
-
17
- Note: `*_projectgroup` (v.1.5.x) is deprecated in favour of `*_project_group`, but included for backwards compatibility
18
-
19
- ```ruby
20
- octopus_deploy project_group(server_url, api_key, 'Example Group') # url and apikey provided
21
- octopus_deploy_project_group('Example Group') # using env vars
22
- octopus_project_group(server_url, api_key, 'Example Group') # shorthand
23
- octopus_project_group('Example Group')
24
- ```
25
-
26
- #### Matchers
27
-
28
- | Matcher | Description |
29
- |:--------|:------------|
30
- | should exist | Tests for existence of a project group with the given name |
1
+ # octopus_deploy_project_group
2
+
3
+ Describes an Octopus [Project Group](https://octopus.com/docs/deployment-process/projects#project-group) resource.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_project_group('Important Projects') do
9
+ it { should have_description('These are my Very Important projects') }
10
+ end
11
+ ```
12
+
13
+ #### Type
14
+
15
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
16
+
17
+ Note: `*_projectgroup` (v.1.5.x) is deprecated in favour of `*_project_group`, but included for backwards compatibility
18
+
19
+ ```ruby
20
+ octopus_deploy project_group(server_url, api_key, 'Example Group') # url and apikey provided
21
+ octopus_deploy_project_group('Example Group') # using env vars
22
+ octopus_project_group(server_url, api_key, 'Example Group') # shorthand
23
+ octopus_project_group('Example Group')
24
+ ```
25
+
26
+ #### Matchers
27
+
28
+ | Matcher | Description |
29
+ |:--------|:------------|
30
+ | should exist | Tests for existence of a project group with the given name |
31
31
  | should have_description(description) | Tests if the Project group has a given description |
@@ -1,39 +1,39 @@
1
- # octopus_deploy_smtp_config
2
-
3
- Tests the server-wide SMTP configuration. This can be found in the Octopus Portal under Configuration -> SMTP
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_deploy_smtp_config do
9
- it { should be_configured }
10
- it { should have_from_address('hello@example.com') }
11
- it { should be_using_credentials('myusername') }
12
- it { should_not be_using_credentials('myspecialusername') }
13
- it { should be_on_port(25) }
14
- it { should be_on_host('smtp.example.com')}
15
- it { should be_using_ssl }
16
- end
17
- ```
18
-
19
- #### Type
20
-
21
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
22
-
23
- ```ruby
24
- octopus_deploy_smtp_config(server_url, api_key) # url and apikey provided
25
- octopus_deploy_smtp_config # using environment vars
26
- octopus_smtp_config(server_url, api_key) # shorthand
27
- octopus_smtp_config
28
- ```
29
-
30
- #### Matchers
31
-
32
- | Matcher | Description |
33
- |:--------|:------------|
34
- | should be_configured | Tests if the SMTP configuration has been set
35
- | should be_on_host(host) | Tests the "SMTP Host" field |
36
- | should be_on_port(port) | Tests the "SMTP Port" field |
37
- | should be_using_ssl | Tests the "Use SSL/TLS" field |
38
- | should have_from_address(address) | Tests the "From Address" field |
39
- | should be_using_credentials(username) | Tests the "Credentials" field (username only) |
1
+ # octopus_deploy_smtp_config
2
+
3
+ Tests the server-wide SMTP configuration. This can be found in the Octopus Portal under Configuration -> SMTP
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_deploy_smtp_config do
9
+ it { should be_configured }
10
+ it { should have_from_address('hello@example.com') }
11
+ it { should be_using_credentials('myusername') }
12
+ it { should_not be_using_credentials('myspecialusername') }
13
+ it { should be_on_port(25) }
14
+ it { should be_on_host('smtp.example.com')}
15
+ it { should be_using_ssl }
16
+ end
17
+ ```
18
+
19
+ #### Type
20
+
21
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
22
+
23
+ ```ruby
24
+ octopus_deploy_smtp_config(server_url, api_key) # url and apikey provided
25
+ octopus_deploy_smtp_config # using environment vars
26
+ octopus_smtp_config(server_url, api_key) # shorthand
27
+ octopus_smtp_config
28
+ ```
29
+
30
+ #### Matchers
31
+
32
+ | Matcher | Description |
33
+ |:--------|:------------|
34
+ | should be_configured | Tests if the SMTP configuration has been set
35
+ | should be_on_host(host) | Tests the "SMTP Host" field |
36
+ | should be_on_port(port) | Tests the "SMTP Port" field |
37
+ | should be_using_ssl | Tests the "Use SSL/TLS" field |
38
+ | should have_from_address(address) | Tests the "From Address" field |
39
+ | should be_using_credentials(username) | Tests the "Credentials" field (username only) |
@@ -1,32 +1,32 @@
1
- # octopus_deploy_space
2
-
3
- Describes an Octopus Deploy [Space](https://octopus.com/docs/administration/spaces) resource.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_deploy_space('Team Phoenix') do
9
- it { should exist }
10
- it { should have_running_task_queue }
11
- end
12
- ```
13
-
14
- #### Type
15
-
16
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
-
18
- ```ruby
19
- octopus_deploy_space(server_url, api_key, space_name) # url and apikey provided
20
- octopus_deploy_space(space_name) # using environment variables
21
- octopus_space(server_url, api_key, space_name)
22
- octopus_space(space_name) # shorthand
23
- ```
24
-
25
- #### Matchers
26
-
27
- | Matcher | Description |
28
- |:--------|:------------|
29
- | exist | test for existence of a given space |
30
- | be_default | Tests if this space is the default space |
31
- | have_running_task_queue | tests if the queue for this space is disabled |
32
- | have_description(description) | tests if the space has the specified description |
1
+ # octopus_deploy_space
2
+
3
+ Describes an Octopus Deploy [Space](https://octopus.com/docs/administration/spaces) resource.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_deploy_space('Team Phoenix') do
9
+ it { should exist }
10
+ it { should have_running_task_queue }
11
+ end
12
+ ```
13
+
14
+ #### Type
15
+
16
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
+
18
+ ```ruby
19
+ octopus_deploy_space(server_url, api_key, space_name) # url and apikey provided
20
+ octopus_deploy_space(space_name) # using environment variables
21
+ octopus_space(server_url, api_key, space_name)
22
+ octopus_space(space_name) # shorthand
23
+ ```
24
+
25
+ #### Matchers
26
+
27
+ | Matcher | Description |
28
+ |:--------|:------------|
29
+ | exist | test for existence of a given space |
30
+ | be_default | Tests if this space is the default space |
31
+ | have_running_task_queue | tests if the queue for this space is disabled |
32
+ | have_description(description) | tests if the space has the specified description |
@@ -1,26 +1,26 @@
1
- # octopus_deploy_team
2
-
3
- Describes an Octopus Deploy [Team](https://octopus.com/docs/administration/managing-users-and-teams) resource.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_team('Super Ninja Developer Squad') do
9
- it { should exist }
10
- end
11
-
12
- ```
13
- #### Type
14
-
15
- ```ruby
16
- octopus_deploy_team([url, api_key], team_name)
17
- octopus_team([url, api_key], team_name)
18
- octopus_team([url, api_key], team_name).in_space(space_name)
19
-
20
- ```
21
-
22
- #### Matchers
23
-
24
- | Matcher | Description |
25
- |:--------|:------------|
1
+ # octopus_deploy_team
2
+
3
+ Describes an Octopus Deploy [Team](https://octopus.com/docs/administration/managing-users-and-teams) resource.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_team('Super Ninja Developer Squad') do
9
+ it { should exist }
10
+ end
11
+
12
+ ```
13
+ #### Type
14
+
15
+ ```ruby
16
+ octopus_deploy_team([url, api_key], team_name)
17
+ octopus_team([url, api_key], team_name)
18
+ octopus_team([url, api_key], team_name).in_space(space_name)
19
+
20
+ ```
21
+
22
+ #### Matchers
23
+
24
+ | Matcher | Description |
25
+ |:--------|:------------|
26
26
  | should exist | Checks for existence of a team with the given name |
@@ -1,41 +1,41 @@
1
- # octopus_deploy_tentacle
2
-
3
- Describes an Octopus Deploy [Tentacle agent](https://octopus.com/docs/infrastructure/deployment-targets/windows-targets) resource.
4
-
5
- Must be run on the same machine as `tentacle.exe` at present. Cannot remotely test tentacles at the present time.
6
-
7
- ## Example
8
-
9
- ```ruby
10
- describe octopus_tentacle('MyTentacle') do
11
- it { should be_polling_tentacle }
12
- it { should have_policy('My tentacle policy')}
13
- end
14
- ```
15
-
16
- #### Type
17
-
18
- ```ruby
19
- octopus_deploy_tentacle([url, api_key], instance_name)
20
- octopus_tentacle([url, api_key], instance_name)
21
- octopus_tentacle([url, api_key], instance_name).in_space('Octopus')
22
-
23
- ```
24
-
25
- #### Matchers
26
-
27
- | Matcher | Description |
28
- |:--------|:------------|
29
- | should exist | Tests if tentacle.exe is present locally |
30
- | should be_registered_with_the_server | Checks if this tentacle instance is present in the target server |
31
- | should be_online | Tests if the tentacle has a status of online. If the machine is in a healthcheck, waits until healthcheck completes |
32
- | should be_in_environment(env_name) | Tests if the tentacle is registered to a given [Environment](octopus_deploy_environment.md) |
33
- | should be_in_space(space_name) | Tests if a tentacle appears in a given space. _deprecated_. |
34
- | should have_tenant(tenant_name) | Tests if a tentacle is registered to a given tenant |
35
- | should have_tenant_tag(tag_name) | Tests if a tentacle is registered to a given tenant tag |
36
- | should have_policy(policy_name) | Tests if a tentacle has a give policy applied |
37
- | should have_role(role_name) | Tests if a tentacle has a given role applied |
38
- | should have_display_name | Tests if a tentacle has a given display name |
39
- | should have_tenanted_deployment_participation(mode) | Tests if a tentacle can take part in tenanted deployments |
40
- | should be_polling_tentacle | Tests if a tentacle is in the 'polling' or 'Active' mode |
1
+ # octopus_deploy_tentacle
2
+
3
+ Describes an Octopus Deploy [Tentacle agent](https://octopus.com/docs/infrastructure/deployment-targets/windows-targets) resource.
4
+
5
+ Must be run on the same machine as `tentacle.exe` at present. Cannot remotely test tentacles at the present time.
6
+
7
+ ## Example
8
+
9
+ ```ruby
10
+ describe octopus_tentacle('MyTentacle') do
11
+ it { should be_polling_tentacle }
12
+ it { should have_policy('My tentacle policy')}
13
+ end
14
+ ```
15
+
16
+ #### Type
17
+
18
+ ```ruby
19
+ octopus_deploy_tentacle([url, api_key], instance_name)
20
+ octopus_tentacle([url, api_key], instance_name)
21
+ octopus_tentacle([url, api_key], instance_name).in_space('Octopus')
22
+
23
+ ```
24
+
25
+ #### Matchers
26
+
27
+ | Matcher | Description |
28
+ |:--------|:------------|
29
+ | should exist | Tests if tentacle.exe is present locally |
30
+ | should be_registered_with_the_server | Checks if this tentacle instance is present in the target server |
31
+ | should be_online | Tests if the tentacle has a status of online. If the machine is in a healthcheck, waits until healthcheck completes |
32
+ | should be_in_environment(env_name) | Tests if the tentacle is registered to a given [Environment](octopus_deploy_environment.md) |
33
+ | should be_in_space(space_name) | Tests if a tentacle appears in a given space. _deprecated_. |
34
+ | should have_tenant(tenant_name) | Tests if a tentacle is registered to a given tenant |
35
+ | should have_tenant_tag(tag_name) | Tests if a tentacle is registered to a given tenant tag |
36
+ | should have_policy(policy_name) | Tests if a tentacle has a give policy applied |
37
+ | should have_role(role_name) | Tests if a tentacle has a given role applied |
38
+ | should have_display_name | Tests if a tentacle has a given display name |
39
+ | should have_tenanted_deployment_participation(mode) | Tests if a tentacle can take part in tenanted deployments |
40
+ | should be_polling_tentacle | Tests if a tentacle is in the 'polling' or 'Active' mode |
41
41
  | should be_listening_tentacle | Tests if a tentacle is in the 'listening' or 'Passive' mode |
@@ -1,34 +1,34 @@
1
- # octopus_deploy_upgrade_config
2
-
3
- Tests the server-wide upgrade configuration. This can be found in the UI at Configuration->Settings->Updates & Usage Telemetry.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_deploy_upgrade_config do
9
- it { should include_statistics }
10
- it { should never_show_notifications }
11
- end
12
- ```
13
-
14
- #### Type
15
-
16
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
-
18
- ```ruby
19
- octopus_deploy_upgrade_config(server_url, api_key) # url and apikey provided
20
- octopus_deploy_upgrade_config # using environment vars
21
- octopus_upgrade_config(server_url, api_key) # shorthand
22
- octopus_upgrade_config # shorthand, using env vars
23
- ```
24
-
25
- #### Matchers
26
-
27
- | Matcher | Description |
28
- |:--------|:------------|
29
- | should have_notification_mode(mode) | Tests if the Notification mode is set to the given value. Possible values: ['AlwaysShow', 'ShowOnlyMajorMinor', 'NeverShow'] |
30
- | should never_show_notifications | equivalent to `should_have_notification_mode('NeverShow')` |
31
- | should always_show_notifications | equivalent to `should_have_notification_mode('AlwaysShow')` |
32
- | should show_major_minor_notifications | equivalent to `should_have_notification_mode('ShowOnlyMajorMinor')` |
33
- | should include_statistics | Tests if the IncludeStatistics setting is set to `true` |
1
+ # octopus_deploy_upgrade_config
2
+
3
+ Tests the server-wide upgrade configuration. This can be found in the UI at Configuration->Settings->Updates & Usage Telemetry.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_deploy_upgrade_config do
9
+ it { should include_statistics }
10
+ it { should never_show_notifications }
11
+ end
12
+ ```
13
+
14
+ #### Type
15
+
16
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
+
18
+ ```ruby
19
+ octopus_deploy_upgrade_config(server_url, api_key) # url and apikey provided
20
+ octopus_deploy_upgrade_config # using environment vars
21
+ octopus_upgrade_config(server_url, api_key) # shorthand
22
+ octopus_upgrade_config # shorthand, using env vars
23
+ ```
24
+
25
+ #### Matchers
26
+
27
+ | Matcher | Description |
28
+ |:--------|:------------|
29
+ | should have_notification_mode(mode) | Tests if the Notification mode is set to the given value. Possible values: ['AlwaysShow', 'ShowOnlyMajorMinor', 'NeverShow'] |
30
+ | should never_show_notifications | equivalent to `should_have_notification_mode('NeverShow')` |
31
+ | should always_show_notifications | equivalent to `should_have_notification_mode('AlwaysShow')` |
32
+ | should show_major_minor_notifications | equivalent to `should_have_notification_mode('ShowOnlyMajorMinor')` |
33
+ | should include_statistics | Tests if the IncludeStatistics setting is set to `true` |
34
34
  | should allow_checking | Tests if the AllowChecking setting is set to `true` |
@@ -1,34 +1,34 @@
1
- # octopus_deploy_user
2
-
3
- Describes an Octopus Deploy [User](https://octopus.com/docs/administration/managing-users-and-teams#Managingusersandteams-UserandServiceaccounts) resource.
4
-
5
- ## Example
6
-
7
- ```ruby
8
- describe octopus_deploy_user('bobthedeveloper') do
9
- it { should exist }
10
- it { should be_active }
11
- end
12
- ```
13
-
14
- #### Type
15
-
16
- This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
-
18
- ```ruby
19
- octopus_deploy_user(url, api_key, user_name) # url and apikey provided
20
- octopus_deploy_user(user_name) # using environment vars
21
- octopus_user(url, api_key, user_name) # shorthand
22
- octopus_user(user_name)
23
- ```
24
-
25
- #### Matchers
26
-
27
- | Matcher | Description |
28
- |:--------|:------------|
29
- | should exist | Tests for existence of a User account with the given name |
30
- | should be_active | Tests if the User is enabled/has the 'Is Active' checkbox checked |
31
- | should have_email(email) | Tests the email address associated with the User account |
32
- | should have_api_key(purpose) | Tests if the User has an API Key with the stated purpose field |
33
- | should have_display_name(name) | Tests the Display Name set for the User |
1
+ # octopus_deploy_user
2
+
3
+ Describes an Octopus Deploy [User](https://octopus.com/docs/administration/managing-users-and-teams#Managingusersandteams-UserandServiceaccounts) resource.
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ describe octopus_deploy_user('bobthedeveloper') do
9
+ it { should exist }
10
+ it { should be_active }
11
+ end
12
+ ```
13
+
14
+ #### Type
15
+
16
+ This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).
17
+
18
+ ```ruby
19
+ octopus_deploy_user(url, api_key, user_name) # url and apikey provided
20
+ octopus_deploy_user(user_name) # using environment vars
21
+ octopus_user(url, api_key, user_name) # shorthand
22
+ octopus_user(user_name)
23
+ ```
24
+
25
+ #### Matchers
26
+
27
+ | Matcher | Description |
28
+ |:--------|:------------|
29
+ | should exist | Tests for existence of a User account with the given name |
30
+ | should be_active | Tests if the User is enabled/has the 'Is Active' checkbox checked |
31
+ | should have_email(email) | Tests the email address associated with the User account |
32
+ | should have_api_key(purpose) | Tests if the User has an API Key with the stated purpose field |
33
+ | should have_display_name(name) | Tests the Display Name set for the User |
34
34
  | should be_service_account | Tests if the User is a service account |