Class: Serverspec::Type::OctopusDeployTeam
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::OctopusDeployTeam
- Defined in:
- lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #in_space(space_name) ⇒ Object
-
#initialize(*url_and_api_key, team_name) ⇒ OctopusDeployTeam
constructor
A new instance of OctopusDeployTeam.
- #load_resource_if_nil ⇒ Object
Constructor Details
#initialize(*url_and_api_key, team_name) ⇒ OctopusDeployTeam
Returns a new instance of OctopusDeployTeam.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb', line 14 def initialize(*url_and_api_key, team_name) serverUrl,apiKey = get_octopus_creds(url_and_api_key) @team_name = team_name @name = "Octopus Deploy User Account #{serverUrl}" @runner = Specinfra::Runner @serverUrl = serverUrl @apiKey = apiKey if team_name.nil? raise "'team_name' was not provided" end end |
Instance Method Details
#exists? ⇒ Boolean
29 30 31 32 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb', line 29 def exists? load_resource_if_nil @team != nil? end |
#in_space(space_name) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb', line 34 def in_space(space_name) # allows us to tag .in_space() onto the end of the resource. as in # describe octopus_account("account name").in_space("MyNewSpace") do @spaceId = get_space_id?(space_name) if @team_name.nil? raise "'team_name' was not provided. Unable to connect to Octopus server to validate configuration." end self end |
#load_resource_if_nil ⇒ Object
44 45 46 47 48 |
# File 'lib/octopus_serverspec_extensions/type/octopus_deploy_team.rb', line 44 def load_resource_if_nil if @team.nil? @team = get_team_via_api(@serverUrl, @apiKey, @team_name) end end |