2 # Upload all the artifacts to our S3 bucket. All the files inside ${upload_dir}
3 # will be uploaded to the deploy bucket and eventually signed and released in
4 # static.rust-lang.org.
9 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
11 upload_dir="$(mktemp -d)"
18 # Release tarballs produced by a dist builder.
19 if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
20 dist_dir="${build_dir}/dist"
21 rm -rf "${dist_dir}/doc"
22 cp -r "${dist_dir}"/* "${upload_dir}"
25 # CPU usage statistics.
26 cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"
28 # Build metrics generated by x.py.
29 cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json"
32 if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then
33 cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}"
36 echo "Files that will be uploaded:"
37 ls -lah "${upload_dir}"
40 deploy_dir="rustc-builds"
41 if [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
42 deploy_dir="rustc-builds-alt"
44 deploy_url="s3://${DEPLOY_BUCKET}/${deploy_dir}/$(ciCommit)"
46 retry aws s3 cp --storage-class INTELLIGENT_TIERING \
47 --no-progress --recursive --acl public-read "${upload_dir}" "${deploy_url}"