Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Aug 29, 2024
1 parent ce95aef commit 0238c6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions scripts/create-previous-k0s-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,17 @@ function embeddedcluster() {
echo "EC_VERSION unset, not uploading embedded cluster release"
return 0
fi

# append a 'v' prefix to the version if it doesn't already have one
local version="$EC_VERSION"
if ! echo "$version" | grep -q "^v"; then
version="v$version"
fi

# check if a file 'embedded-cluster-linux-amd64-previous-k0s.tgz' exists in the directory
# if it does, upload it as releases/${ec_version}.tgz
# if it does, upload it as releases/${version}.tgz
if [ -f embedded-cluster-linux-amd64-previous-k0s.tgz ]; then
retry 3 aws s3 cp --no-progress embedded-cluster-linux-amd64-previous-k0s.tgz "s3://${S3_BUCKET}/releases/${EC_VERSION}.tgz"
retry 3 aws s3 cp --no-progress embedded-cluster-linux-amd64-previous-k0s.tgz "s3://${S3_BUCKET}/releases/${version}.tgz"
else
echo "embedded-cluster-linux-amd64-previous-k0s.tgz not found, skipping upload"
fi
Expand Down
11 changes: 9 additions & 2 deletions scripts/create-upgrade-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,17 @@ function embeddedcluster() {
echo "EC_VERSION unset, not uploading embedded cluster release"
return 0
fi

# append a 'v' prefix to the version if it doesn't already have one
local version="$EC_VERSION"
if ! echo "$version" | grep -q "^v"; then
version="v$version"
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 it does, upload it as releases/${version}.tgz
if [ -f embedded-cluster-linux-amd64.tgz ]; then
retry 3 aws s3 cp --no-progress embedded-cluster-linux-amd64.tgz "s3://${S3_BUCKET}/releases/${EC_VERSION}.tgz"
retry 3 aws s3 cp --no-progress embedded-cluster-linux-amd64.tgz "s3://${S3_BUCKET}/releases/${version}.tgz"
else
echo "embedded-cluster-linux-amd64.tgz not found, skipping upload"
fi
Expand Down

0 comments on commit 0238c6f

Please sign in to comment.