lib/capistrano/tasks/stretcher.rake in capistrano-stretcher-0.5.2 vs lib/capistrano/tasks/stretcher.rake in capistrano-stretcher-0.5.3
- old
+ new
@@ -115,11 +115,11 @@
end
end
task :upload_tarball do
on application_builder_roles do
- as 'root' do
+ as fetch(:stretcher_user) || 'root' do
local_tarball_file = "#{local_tarball_path}/current/#{fetch(:local_tarball_name)}"
if fetch(:stretcher_src).start_with?("s3://")
# upload to s3
upload_s3(local_tarball_file, fetch(:stretcher_src))
@@ -131,10 +131,10 @@
end
end
task :create_and_upload_manifest do
on application_builder_roles do
- as 'root' do
+ as fetch(:stretcher_user) || 'root' do
failure_message = "Deploy failed at *$(hostname)* :fire:"
checksum = capture("openssl sha256 #{local_tarball_path}/current/#{fetch(:local_tarball_name)} | gawk -F' ' '{print $2}'").chomp
src = fetch(:stretcher_src)
template = File.read(File.expand_path('../../templates/manifest.yml.erb', __FILE__))
yaml = YAML.load(ERB.new(capture(:cat, "#{local_build_path}/#{fetch(:stretcher_hooks)}")).result(binding))