app/cyclid/plugins/provisioner/debian.rb in cyclid-0.2.1 vs app/cyclid/plugins/provisioner/debian.rb in cyclid-0.2.2
- old
+ new
@@ -41,15 +41,16 @@
success = transport.exec 'sudo apt-get update'
raise 'failed to update repositories' unless success
end
- env[:packages].each do |package|
+ if env.key? :packages
success = transport.exec \
- "sudo -E apt-get install -y #{package}"
- raise "failed to install package #{package}" unless success
- end if env.key? :packages
+ "sudo -E apt-get install -y #{env[:packages].join(' ')}" \
+
+ raise "failed to install packages #{env[:packages].join(' ')}" unless success
+ end
rescue StandardError => ex
Cyclid.logger.error "failed to provision #{buildhost[:name]}: #{ex}"
raise
end
@@ -66,21 +67,21 @@
success = transport.exec \
"echo '#{fragment}' | sudo tee -a /etc/apt/sources.list.d/cyclid.list"
raise "failed to add repository #{url}" unless success
- if repo.key? :key_id
- # Import the signing key
- key_id = repo[:key_id]
+ return unless repo.key? :key_id
- success = transport.exec \
- "gpg --keyserver keyserver.ubuntu.com --recv-keys #{key_id}"
- raise "failed to import key #{key_id}" unless success
+ # Import the signing key
+ key_id = repo[:key_id]
- success = transport.exec \
- "gpg -a --export #{key_id} | sudo apt-key add -"
- raise "failed to add repository key #{key_id}" unless success
- end
+ success = transport.exec \
+ "gpg --keyserver keyserver.ubuntu.com --recv-keys #{key_id}"
+ raise "failed to import key #{key_id}" unless success
+
+ success = transport.exec \
+ "gpg -a --export #{key_id} | sudo apt-key add -"
+ raise "failed to add repository key #{key_id}" unless success
end
# Register this plugin
register_plugin 'debian'
end