2018-06-24 10:10:55 -07:00
|
|
|
# |source| me
|
|
|
|
|
2018-12-13 21:44:50 -08:00
|
|
|
upload-ci-artifact() {
|
2018-06-24 10:10:55 -07:00
|
|
|
echo "--- artifact: $1"
|
|
|
|
if [[ -r "$1" ]]; then
|
|
|
|
ls -l "$1"
|
|
|
|
if ${BUILDKITE:-false}; then
|
|
|
|
(
|
|
|
|
set -x
|
|
|
|
buildkite-agent artifact upload "$1"
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo ^^^ +++
|
|
|
|
echo "$1 not found"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-11-20 08:27:34 -08:00
|
|
|
upload-s3-artifact() {
|
|
|
|
echo "--- artifact: $1 to $2"
|
|
|
|
(
|
2022-01-03 13:39:01 -08:00
|
|
|
args=(
|
|
|
|
--rm
|
|
|
|
--env AWS_ACCESS_KEY_ID
|
|
|
|
--env AWS_SECRET_ACCESS_KEY
|
|
|
|
--volume "$PWD:/solana"
|
|
|
|
|
|
|
|
)
|
|
|
|
if [[ $(uname -m) = arm64 ]]; then
|
|
|
|
# Ref: https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/#tldr
|
|
|
|
args+=(
|
|
|
|
--platform linux/amd64
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
args+=(
|
2023-08-20 06:13:20 -07:00
|
|
|
amazon/aws-cli:2.13.11
|
|
|
|
s3 cp "$1" "$2" --acl public-read
|
2022-01-03 13:39:01 -08:00
|
|
|
)
|
|
|
|
set -x
|
|
|
|
docker run "${args[@]}"
|
2020-11-20 08:27:34 -08:00
|
|
|
)
|
|
|
|
}
|