]> git.proxmox.com Git - rustc.git/blame - src/ci/scripts/upload-artifacts.sh
New upstream version 1.63.0+dfsg1
[rustc.git] / src / ci / scripts / upload-artifacts.sh
CommitLineData
e74abb32
XL
1#!/bin/bash
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.
5
6set -euo pipefail
7IFS=$'\n\t'
8
9source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10
11upload_dir="$(mktemp -d)"
12
923072b8
FG
13build_dir=build
14if isLinux; then
15 build_dir=obj/build
16fi
17
e74abb32
XL
18# Release tarballs produced by a dist builder.
19if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
923072b8 20 dist_dir="${build_dir}/dist"
e74abb32
XL
21 rm -rf "${dist_dir}/doc"
22 cp -r "${dist_dir}"/* "${upload_dir}"
23fi
24
25# CPU usage statistics.
26cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"
27
923072b8
FG
28# Build metrics generated by x.py.
29cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json"
30
e74abb32
XL
31# Toolstate data.
32if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then
33 cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}"
34fi
35
36echo "Files that will be uploaded:"
37ls -lah "${upload_dir}"
38echo
39
40deploy_dir="rustc-builds"
41if [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
42 deploy_dir="rustc-builds-alt"
43fi
44deploy_url="s3://${DEPLOY_BUCKET}/${deploy_dir}/$(ciCommit)"
45
923072b8
FG
46retry aws s3 cp --storage-class INTELLIGENT_TIERING \
47 --no-progress --recursive --acl public-read "${upload_dir}" "${deploy_url}"