#!/usr/bin/env bash output_script_path="$1" linux_tarball="$2" darwin_tarball="$3" edge_name="$4" bucket="${BINARY_RELEASE_BUCKET:-"edge-bin"}" while read -u 10 p ; do key=$(echo $p | cut -d ' ' -f1) value=$(echo $p | cut -d ' ' -f2) command="export $key=$value" eval $command done 10 $output_script_path echo "set -x" >> $output_script_path remote_path="gs://${bucket}/${edge_name}-latest-linux-amd64.tar.gz" echo "echo \"copying linux tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $linux_tarball $remote_path" echo $command >> $output_script_path echo remote_path="gs://${bucket}/${edge_name}-${semver}-linux-amd64.tar.gz" echo "echo \"copying linux tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $linux_tarball $remote_path" echo $command >> $output_script_path echo remote_path="gs://${bucket}/${edge_name}-${short_sha}-linux-amd64.tar.gz" echo "echo \"copying linux tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $linux_tarball $remote_path" echo $command >> $output_script_path echo remote_path="gs://${bucket}/${edge_name}-latest-darwin-amd64.tar.gz" echo "echo \"copying darwin tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $darwin_tarball $remote_path" echo $command >> $output_script_path echo remote_path="gs://${bucket}/${edge_name}-${semver}-darwin-amd64.tar.gz" echo "echo \"copying darwin tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $darwin_tarball $remote_path" >> $output_script_path echo $command >> $output_script_path echo remote_path="gs://${bucket}/${edge_name}-${short_sha}-darwin-amd64.tar.gz" echo "echo \"copying darwin tarball to $remote_path\"" >> $output_script_path command="gsutil -m -o \"GSUtil:parallel_process_count=1\" cp -r $darwin_tarball $remote_path" >> $output_script_path echo $command >> $output_script_path echo