Skip to content

Commit

Permalink
deploy-to-gcs: Use gcloud storage rsync
Browse files Browse the repository at this point in the history
rsync features:
* exclude list (used for timestamp)
* --delete-unmatched-destination-objects may be useful in future to
  delete unused metadata files

Note that gcloud rsync CLI is not the same as unix rsync: the SOURCE
and DEST arguments in particular function completely differently.

Also put some variables into actual named variables.

Signed-off-by: Jussi Kukkonen <[email protected]>
  • Loading branch information
jku committed Mar 4, 2024
1 parent ca2bcc9 commit b5afa4e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy-to-gcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ jobs:

- name: Upload repository to GCS
run: |
BUCKET="gs://tuf-root-staging/"
LOAD_BALANCER="tuf-repo-cdn-lb"
# Upload metadata, make sure we upload timestamp last
mv repository/timestamp.json .
gcloud storage cp --cache-control=no-store -r repository/* gs://tuf-root-staging/
gcloud storage cp --cache-control=no-store timestamp.json gs://tuf-root-staging/
gcloud storage rsync --cache-control=no-store --recursive --exclude=timestamp.json \
repository/ $BUCKET
gcloud storage cp --cache-control=no-store repository/timestamp.json $BUCKET
# invalidate CDN cache
gcloud compute url-maps invalidate-cdn-cache tuf-repo-cdn-lb --path "/*" --async
gcloud compute url-maps invalidate-cdn-cache $LOAD_BALANCER --path "/*" --async

0 comments on commit b5afa4e

Please sign in to comment.