-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore prerelease verions when uploading version file on release
- Loading branch information
Showing
3 changed files
with
30 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -ue | ||
|
||
BIN="syft" | ||
DISTDIR=$1 | ||
VERSION=$2 | ||
|
||
if [[ $VERSION == *-* ]] ; then | ||
echo "skipping publishing a version file (this is a pre-release: ${VERSION})" | ||
exit 0 | ||
fi | ||
|
||
echo "creating and publishing version file" | ||
|
||
# create a version file for version-update checks | ||
echo "${VERSION}" | tee ${DISTDIR}/VERSION | ||
|
||
# upload the version file that supports the application version update check | ||
docker run --rm \ | ||
-i \ | ||
-e AWS_DEFAULT_REGION=us-west-2 \ | ||
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \ | ||
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \ | ||
-v $(pwd)/${DISTDIR}/:/distmount \ | ||
amazon/aws-cli \ | ||
s3 cp /distmount/VERSION s3://toolbox-data.anchore.io/${BIN}/releases/latest/VERSION |
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