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