Class: Terraspace::Terraform::Tfc::Runs::Base
- Inherits:
-
Object
- Object
- Terraspace::Terraform::Tfc::Runs::Base
- Extended by:
- Memoist
- Includes:
- Api::Client, Util::Logging, Util::Sure
- Defined in:
- lib/terraspace/terraform/tfc/runs/base.rb
Instance Method Summary collapse
- #build_project ⇒ Object
-
#initialize(mod, options = {}) ⇒ Base
constructor
Api::Client requires @mod to be set.
- #runs ⇒ Object
Methods included from Api::Client
#api, #backend, #build, #remote, #workspace_name
Methods included from Util::Sure
Methods included from Util::Logging
Constructor Details
#initialize(mod, options = {}) ⇒ Base
Api::Client requires @mod to be set
9 10 11 |
# File 'lib/terraspace/terraform/tfc/runs/base.rb', line 9 def initialize(mod, ={}) @mod, @options = mod, end |
Instance Method Details
#build_project ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/terraspace/terraform/tfc/runs/base.rb', line 24 def build_project Terraspace::Builder.new(@options).run unless remote && remote['organization'] logger.info "ERROR: There was no organization found. Are you sure you configured backend.tf with it?".color(:red) exit 1 end end |
#runs ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/terraspace/terraform/tfc/runs/base.rb', line 13 def runs runs = api.runs.list runs.select! do |item| @options[:status].nil? || @options[:status].include?("all") || @options[:status].include?(item['attributes']['status']) end runs end |