class Abt::Providers::Devops::Commands::WriteConfig

Public Class Methods

description() click to toggle source
# File lib/abt/providers/devops/commands/write_config.rb, line 12
def self.description
  "Write DevOps settings to .abt.yml"
end
flags() click to toggle source
# File lib/abt/providers/devops/commands/write_config.rb, line 16
def self.flags
  [
    ["-c", "--clean", "Don't reuse configuration"]
  ]
end
usage() click to toggle source
# File lib/abt/providers/devops/commands/write_config.rb, line 8
def self.usage
  "abt write-config devops[:<organization-name>/<project-name>/<board-id>]"
end

Public Instance Methods

perform() click to toggle source
# File lib/abt/providers/devops/commands/write_config.rb, line 22
def perform
  prompt_board! if board_name.nil? || flags[:clean]

  update_directory_config!

  warn("DevOps configuration written to #{Abt::DirectoryConfig::FILE_NAME}")
end

Private Instance Methods

update_directory_config!() click to toggle source
# File lib/abt/providers/devops/commands/write_config.rb, line 32
def update_directory_config!
  cli.directory_config["devops"] = {
    "path" => Path.from_ids(
      organization_name: organization_name,
      project_name: project_name,
      team_name: team_name,
      board_name: board_name
    ).to_s
  }
  cli.directory_config.save!
end