-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: extract uploading artifacts into a script
- Loading branch information
1 parent
2dd4e73
commit 4479de4
Showing
3 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# Upload all the artifacts to our S3 bucket. All the files inside ${upload_dir} | ||
# will be uploaded to the deploy bucket and eventually signed and released in | ||
# static.rust-lang.org. | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" | ||
|
||
upload_dir="$(mktemp -d)" | ||
|
||
# Release tarballs produced by a dist builder. | ||
if [[ "${DEPLOY-0}" = "1" ]] || [[ "${DEPLOY_ALT-0}" = "1" ]]; then | ||
dist_dir=build/dist | ||
if isLinux; then | ||
dist_dir=obj/build/dist | ||
fi | ||
rm -rf "${dist_dir}/doc" | ||
cp -r "${dist_dir}"/* "${upload_dir}" | ||
fi | ||
|
||
# CPU usage statistics. | ||
cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" | ||
|
||
echo "Files that will be uploaded:" | ||
ls -lah "${upload_dir}" | ||
echo | ||
|
||
deploy_dir="rustc-builds" | ||
if [[ "${DEPLOY_ALT-0}" = "1" ]]; then | ||
deploy_dir="rustc-builds-alt" | ||
fi | ||
deploy_url="s3://${DEPLOY_BUCKET}/${deploy_dir}/$(ciCommit)" | ||
|
||
retry aws s3 cp --no-progress --recursive --acl public-read "${upload_dir}" "${deploy_url}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters