-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: Migrate gsutil usage to gcloud storage #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,6 @@ steps: | |
| args: | ||
| - '-c' | ||
| - | | ||
| gsutil rm gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml | ||
| gcloud storage rm gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve the robustness of this cleanup step, I recommend adding the gcloud storage rm --ignore-not-found gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml |
||
| gcloud artifacts docker images delete us-central1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA} | ||
| gcloud run services delete helloworld-${SHORT_SHA} --region us-central1 --quiet | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,5 +15,5 @@ steps: | |
| args: | ||
| - '-c' | ||
| - | | ||
| gsutil rm gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml | ||
| gcloud storage rm gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a more resilient cleanup process, it's a good idea to add the gcloud storage rm --ignore-not-found gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml |
||
| gcloud artifacts versions delete 0.0.1 -q --package python-example-noncontainer-artifacts --repository $_ARTIFACT_REGISTRY_PYTHON_REPO --location us-central1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the cleanup step more robust, consider adding the
--ignore-not-foundflag. This will prevent the step from failing if the test log file doesn't exist (for example, if the test step failed before creating the log). This is generally a good practice for cleanup scripts to ensure they are idempotent and don't fail unnecessarily.gcloud storage rm --ignore-not-found gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml