Class: Serverspec::Type::OctopusDeployUpgradeConfig
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::OctopusDeployUpgradeConfig
- Defined in:
- lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb
Instance Method Summary collapse
- #allow_checking? ⇒ Boolean
- #always_show_notifications? ⇒ Boolean
- #has_notification_mode?(mode) ⇒ Boolean
- #include_statistics? ⇒ Boolean
-
#initialize(*url_and_api_key) ⇒ OctopusDeployUpgradeConfig
constructor
A new instance of OctopusDeployUpgradeConfig.
- #never_show_notifications? ⇒ Boolean
- #show_major_minor_notifications? ⇒ Boolean
Constructor Details
#initialize(*url_and_api_key) ⇒ OctopusDeployUpgradeConfig
Returns a new instance of OctopusDeployUpgradeConfig.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 13 def initialize(*url_and_api_key) serverUrl, apiKey = get_octopus_creds(url_and_api_key) @name = "Octopus Deploy Upgrade Config #{serverUrl}" @runner = Specinfra::Runner @serverUrl = serverUrl @apiKey = apiKey # is it still nil? if serverUrl.nil? raise "'serverUrl' was not provided. Unable to connect to Octopus server to validate configuration." end if apiKey.nil? raise "'apiKey' was not provided. Unable to connect to Octopus server to validate configuration." end @upgradeConfig = get_upgrade_config_via_api(serverUrl, apiKey) end |
Instance Method Details
#allow_checking? ⇒ Boolean
57 58 59 60 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 57 def allow_checking? false if @upgradeConfig.nil? @upgradeConfig['AllowChecking'] == true end |
#always_show_notifications? ⇒ Boolean
42 43 44 45 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 42 def always_show_notifications? false if @upgradeConfig.nil? has_notification_mode?('AlwaysShow') end |
#has_notification_mode?(mode) ⇒ Boolean
32 33 34 35 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 32 def has_notification_mode?(mode) false if @upgradeConfig.nil? @upgradeConfig['NotificationMode'] == mode end |
#include_statistics? ⇒ Boolean
52 53 54 55 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 52 def include_statistics? false if @upgradeConfig.nil? @upgradeConfig['IncludeStatistics'] == true end |
#never_show_notifications? ⇒ Boolean
37 38 39 40 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 37 def never_show_notifications? false if @upgradeConfig.nil? has_notification_mode?('NeverShow') end |
#show_major_minor_notifications? ⇒ Boolean
47 48 49 50 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_upgrade_config.rb', line 47 def show_major_minor_notifications? false if @upgradeConfig.nil? has_notification_mode?('ShowOnlyMajorMinor') end |