bin/nixenvironment in nixenvironment-0.0.77 vs bin/nixenvironment in nixenvironment-0.0.79

- old
+ new

@@ -267,25 +267,37 @@ c.syntax = 'nixenvironment master' c.description = 'Jenkins master' c.option '--init', 'Init Jenkins master' c.option '--start', 'Start Jenkins master' c.option '--deinit', 'Deinit Jenkins master' + c.option '--start_pu', 'Start Provisioning updater' + c.option '--stop', 'Stop Jenkins master' c.action do |_args, options| - if options.init - MasterInitializer.new.start - elsif options.deinit - MasterDeinitializer.new.start + begin + if options.init + MasterInitializer.new.start + elsif options.deinit + MasterDeinitializer.new.start + end + rescue AlreadyInitialized + puts("Skip by reason: Already initialized") end + if options.stop + MasterStarter.new.stop + end + if options.start - starter = MastertStarter.new + starter = MasterStarter.new begin starter.start rescue SystemExit, Interrupt starter.stop end + elsif options.start_pu + MasterStarter.new.start_pu end end end def init @@ -354,16 +366,19 @@ Git.checkout(tags.last, :orphan => true) puts "Push ... #{dest_url}" Git.remote_add(repo_name, dest_url) Git.commit(:m => 'Initial commit') + Git.checkout(Git::DEVELOP, :b => true) Git.push(repo_name, Git::DEFAULT_REFSPEC, :f => true) + Git.push(repo_name, Git::DEVELOP, :f => true) raise "Push failed for #{dest_url} repository!" unless Git.last_cmd_success? end end puts "Cloning new created project from #{dest_url} to #{local_directory_to_clone} ..." Git.clone(dest_url, local_directory_to_clone, :r => true) + Dir.chdir(local_directory_to_clone) { |_path| Git.checkout(Git::DEVELOP) } raise "Error cloning #{dest_url}!" unless Git.last_cmd_success? rescue => e error('Project initialization failed!', e) end \ No newline at end of file