Skip to content

Commit

Permalink
TeamCity : Skip google_project sweeper in Beta projects (#8756)
Browse files Browse the repository at this point in the history
* Add `SKIP_PROJECT_SWEEPER` to Beta projects only

* Adding log to project sweeper so skip decision is in logs

* Make the param an environment variable instead of configuration parameter

* Remove log about skipping project sweeper
  • Loading branch information
SarahFrench authored Nov 14, 2023
1 parent c0d9ebe commit 184b2f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ fun Google<%= version.capitalize unless version == 'ga' -%>(environment: String,
// Adding this allows custom builds to use alternative branches. E.g. testing release branches in the downstreams

params {
// Controls the VCS root, and allows custom builds to point at different branches
param("BRANCH_NAME", branchRef)

<% unless version == 'ga' -%>
// Skip the sweeper for project resources in the Beta tests only
param("env.SKIP_PROJECT_SWEEPER", 1)
<% end -%>
// Not used, but making `environment` a param makes the value visible to non-admins in TeamCity
param("ENVIRONMENT", environment)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func init() {
// already be in-progress.
// Example: SKIP_PROJECT_SWEEPER=1 go test ./google -v -sweep=us-central1 -sweep-run=
if os.Getenv("SKIP_PROJECT_SWEEPER") != "" {
// No logging here - see https://github.com/GoogleCloudPlatform/magic-modules/pull/7439
return
}

Expand Down

0 comments on commit 184b2f1

Please sign in to comment.