Class: Dod::Runner
- Inherits:
-
CLAide::Command
- Object
- CLAide::Command
- Dod::Runner
- Defined in:
- lib/dod/commands/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 16 17 |
# File 'lib/dod/commands/runner.rb', line 11 def initialize(argv) donefile = argv.option("donefile", "Donefile") @donefile_path = donefile if File.exist?(donefile) @repository = Repository.new @donefile = Donefile.new super end |
Class Method Details
.options ⇒ Object
26 27 28 29 30 |
# File 'lib/dod/commands/runner.rb', line 26 def self. [ ["--donefile=<path/to/donefile>", "Path to the Donefile where all tasks for Definition of Done are defined."] ] end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dod/commands/runner.rb', line 32 def run tasks = @donefile.parse_tasks(@donefile_path) project_name = @repository.project_name(ENV) repo_name = @repository.repo_name(ENV) current_branch = environment["bamboo_repository_git_branch"] unless project_name && repo_name && current_branch puts "Lack of definition of one of the environment variable (bamboo_repository_git_branch, bamboo_planRepository_repositoryUrl or bamboo_planRepository_repositoryUrl).".red return end bitbucket = BitbucketServerAPI.new(ENV, project_name, repo_name, current_branch) bitbucket.create_definition_of_done(tasks) end |
#validate! ⇒ Object
19 20 21 22 23 24 |
# File 'lib/dod/commands/runner.rb', line 19 def validate! super if self.class == Runner && !@donefile_path help!("Could not find a Donefile.") end end |