Skip to content

Commit

Permalink
feat: publish releases to the s3 bucket (#297)
Browse files Browse the repository at this point in the history
publishes the release tgz file into a s3 bucket.
  • Loading branch information
ricardomaraschini authored Jan 24, 2024
1 parent ddaf5d6 commit f72ad82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/cache-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,25 @@ function metadata() {

}

function embeddedcluster() {
if [ -z "${EC_VERSION}" ]; then
echo "EC_VERSION unset, not uploading embedded cluster release"
return 0
fi
# check if a file 'embedded-cluster-linux-amd64.tgz' exists in the directory
# if it does, upload it as releases/${ec_version}.tgz
if [ -f embedded-cluster-linux-amd64.tgz ]; then
retry 3 aws s3 cp embedded-cluster-linux-amd64.tgz "s3://${S3_BUCKET}/releases/${EC_VERSION}.tgz"
else
echo "embedded-cluster-linux-amd64.tgz not found, skipping upload"
fi
}

# there are two files to be uploaded for each release - the k0s binary and the metadata file
function main() {
k0sbin
metadata
embeddedcluster
}

main "$@"

0 comments on commit f72ad82

Please sign in to comment.