Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FM-8299) spinner runs after spec_prep in provision #149

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/puppet_litmus/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ def run_local_command(command)
desc "provision container/VM - abs/docker/vagrant/vmpooler eg 'bundle exec rake 'litmus:provision[vmpooler, ubuntu-1604-x86_64]'"
task :provision, [:provisioner, :platform] do |_task, args|
include BoltSpec::Run
spinner = if (ENV['CI'] == 'true') || !ENV['DISTELLI_BUILDNUM'].nil?
TTY::Spinner.new(':spinner', frames: ['.'], interval: 0.1)
else
TTY::Spinner.new("Provisioning #{args[:platform]} using #{args[:provisioner]} provisioner.[:spinner]")
end
spinner.auto_spin
Rake::Task['spec_prep'].invoke
config_data = { 'modulepath' => File.join(Dir.pwd, 'spec', 'fixtures', 'modules') }
raise "the provision module was not found in #{config_data['modulepath']}, please amend the .fixtures.yml file" unless File.directory?(File.join(config_data['modulepath'], 'provision'))
Expand All @@ -147,6 +141,12 @@ def run_local_command(command)
end

params = { 'action' => 'provision', 'platform' => args[:platform], 'inventory' => Dir.pwd }
spinner = if (ENV['CI'] == 'true') || !ENV['DISTELLI_BUILDNUM'].nil?
TTY::Spinner.new(':spinner', frames: ['.'], interval: 0.1)
else
TTY::Spinner.new("Provisioning #{args[:platform]} using #{args[:provisioner]} provisioner.[:spinner]")
end
spinner.auto_spin
results = run_task("provision::#{args[:provisioner]}", 'localhost', params, config: config_data, inventory: nil)
if results.first['status'] != 'success'
spinner.error
Expand Down