@@ -70,13 +70,26 @@ namespace :litmus do
7070 result = run_command ( install_command , target_nodes , config : nil , inventory : inventory_hash )
7171 if result . is_a? ( Array )
7272 result . each do |node |
73- puts "#{ node [ 'node ' ] } failed #{ node [ 'result ' ] } " if node [ 'status' ] != 'success'
73+ puts "#{ node [ 'target ' ] } failed: ' #{ node [ 'value ' ] } ' " if node [ 'status' ] != 'success'
7474 end
7575 else
7676 raise "Failed trying to run '#{ install_command } ' against inventory."
7777 end
7878 end
7979
80+ def install_build_tools ( target_nodes , inventory_hash )
81+ puts 'Installing build tools...'
82+ install_build_command = "yum -y group install 'Development Tools'"
83+ result = run_command ( install_build_command , target_nodes , config : nil , inventory : inventory_hash )
84+ if result . is_a? ( Array )
85+ result . each do |node |
86+ puts "#{ node [ 'target' ] } failed: '#{ node [ 'value' ] } '" if node [ 'status' ] != 'success'
87+ end
88+ else
89+ raise "Failed trying to run '#{ install_build_command } ' against inventory."
90+ end
91+ end
92+
8093 # Install the gem under test and required fixture on a collection of nodes
8194 #
8295 # @param :target_node_name [Array] nodes on which to install a puppet module for testing.
@@ -92,11 +105,11 @@ namespace :litmus do
92105 include BoltSpec ::Run
93106
94107 # Build the gem
108+ puts 'Building gem...'
95109 `gem build puppet-strings.gemspec --quiet`
96110 result = $CHILD_STATUS
97111 raise "Unable to build the puppet-strings gem. Returned exit code #{ result . exitstatus } " unless result . exitstatus . zero?
98112
99- puts 'Built'
100113 # Find the gem build artifact
101114 gem_tar = Dir . glob ( 'puppet-strings-*.gem' ) . max_by { |f | File . mtime ( f ) }
102115 raise "Unable to find package in 'puppet-strings-*.gem'" if gem_tar . nil?
@@ -111,6 +124,8 @@ namespace :litmus do
111124 puts 'Copying gem to targets...'
112125 upload_file ( gem_tar , File . basename ( gem_tar ) , target_string , inventory : inventory_hash )
113126
127+ install_build_tools ( target_nodes , inventory_hash )
128+
114129 # Install dependent gems
115130 puts 'Installing yard gem...'
116131 install_remote_gem ( 'yard' , target_nodes , inventory_hash )
0 commit comments