Skip to content

Commit

Permalink
Add S3 redirect to latest MSI package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Apr 7, 2021
1 parent 882080f commit 00341f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packaging/bin/create-msi-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ sync_to_s3() ***REMOVED***
# Disable cache for index files.
s3cmd modify --recursive --exclude='*' --include='index.html' \
--add-header='Cache-Control:no-cache, max-age=0' "s3://$***REMOVED***S3PATH***REMOVED***/"

# Update latest redirect
latest="$(find "$REPODIR" -name '*.msi' -printf '%P\n' | sort | tail -1)"
s3cmd --force --add-header="x-amz-website-redirect-location:/msi/$***REMOVED***latest***REMOVED***" \
--add-header='Cache-Control:no-cache, max-age=0' \
put "$(mktemp)" "s3://$***REMOVED***S3PATH***REMOVED***/k6-latest-amd64.msi"
***REMOVED***

mkdir -p "$REPODIR"
Expand All @@ -44,8 +50,6 @@ s3cmd sync --exclude='*' --include='*.msi' "s3://$***REMOVED***S3PATH***REMOVED*
# Copy the new packages in
find "$PKGDIR" -name "*.msi" -type f -print0 | xargs -r0 cp -t "$REPODIR"

# TODO: Handle k6-latest-amd64.msi

delete_old_pkgs "$REPODIR"

log "Generating index.html ..."
Expand Down

0 comments on commit 00341f2

Please sign in to comment.