mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
4e2e91e089
* Add python pip pakacge to install aws cli Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Upload build artifacts to aws s3 instead of gcp bucket Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Upload logs to aws s3 instead of google buckets Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Replace gcloud auth with aws credentials for artifact uploading to buckets Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> * Replace usage of google bucket with aws s3 buckets Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com> Signed-off-by: Venkata Krishna Rohit Sakala <rohitsakala@gmail.com>
38 lines
728 B
Bash
Executable File
38 lines
728 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Check for AWS Credentials
|
|
[ -n "$AWS_SECRET_ACCESS_KEY" ] || {
|
|
exit 0
|
|
}
|
|
[ -n "$AWS_ACCESS_KEY_ID" ] || {
|
|
exit 0
|
|
}
|
|
|
|
[ -x "$1" ] || {
|
|
echo "First argument should be an executable" >&2
|
|
exit 1
|
|
}
|
|
[ -n "$2" ] || {
|
|
echo "Second argument should be a commit hash" >&2
|
|
exit 1
|
|
}
|
|
|
|
umask 077
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
cleanup() {
|
|
exit_code=$?
|
|
trap - EXIT INT
|
|
rm -rf ${TMPDIR}
|
|
exit ${exit_code}
|
|
}
|
|
trap cleanup EXIT INT
|
|
|
|
BUILD_NAME=$(basename $1)-$2
|
|
(cd $(dirname $1) && sha256sum $(basename $1)) >${TMPDIR}/${BUILD_NAME}.sha256sum
|
|
cp $1 ${TMPDIR}/${BUILD_NAME}
|
|
|
|
aws s3 cp ${TMPDIR}/${BUILD_NAME}* s3://k3s-ci-builds || exit 1
|
|
echo "Build uploaded" >&2
|
|
echo "https://k3s-ci-builds.s3.amazonaws.com/${BUILD_NAME}"
|