Skip to content

Commit

Permalink
Merge pull request #3174 from xmudrii/fix-project-sub
Browse files Browse the repository at this point in the history
Fix OBS project substitution in GCB
  • Loading branch information
k8s-ci-robot committed Jul 25, 2023
2 parents 4802d1d + 0f3fda1 commit 957c10d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions gcb/obs-release/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ steps:
- "${_NOMOCK}"
- "--log-level=${_LOG_LEVEL}"
- "--packages=${_PACKAGES}"
- "--project=${_PROJECT}"
- "--project=${_OBS_PROJECT}"

tags:
- ${_GCP_USER_TAG}
Expand All @@ -91,7 +91,7 @@ tags:
- ${_TYPE_TAG}
- ${_TYPE}
- ${_PACKAGES}
- ${_PROJECT_TAG}
- ${_OBS_PROJECT_TAG}

options:
machineType: E2_HIGHCPU_32
Expand Down
4 changes: 2 additions & 2 deletions gcb/obs-stage/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ steps:
# TODO(xmudrii) - followup: solve problem with delimiter
# - "--architectures=${_ARCHITECTURES}"
- "--version=${_VERSION}"
- "--project=${_PROJECT}"
- "--project=${_OBS_PROJECT}"
- "--source=${_PACKAGE_SOURCE}"

tags:
Expand All @@ -98,7 +98,7 @@ tags:
- ${_TYPE}
- ${_PACKAGES}
- ${_VERSION}
- ${_PROJECT_TAG}
- ${_OBS_PROJECT_TAG}

options:
machineType: E2_HIGHCPU_32
Expand Down
10 changes: 5 additions & 5 deletions pkg/gcp/gcb/gcb.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type Options struct {
Packages []string
Version string
Architectures []string
Project string
OBSProject string
PackageSource string
}

Expand Down Expand Up @@ -395,16 +395,16 @@ func (g *GCB) SetGCBSubstitutions(toolOrg, toolRepo, toolRef, gcsBucket string)
//nolint:gocritic // This needs some fixes that will be done in a follow-up
// gcbSubs["ARCHITECTURES"] = strings.Join(g.options.Architectures, ",")
gcbSubs["VERSION"] = g.options.Version
gcbSubs["PROJECT"] = g.options.Project
gcbSubs["PROJECT_TAG"] = strings.ReplaceAll(g.options.Project, ":", "-")
gcbSubs["OBS_PROJECT"] = g.options.OBSProject
gcbSubs["OBS_PROJECT_TAG"] = strings.ReplaceAll(g.options.OBSProject, ":", "-")
gcbSubs["PACKAGE_SOURCE"] = g.options.PackageSource

// Stop here when doing OBS stage
return gcbSubs, nil
case g.options.OBSRelease:
gcbSubs["PACKAGES"] = strings.Join(g.options.Packages, ",")
gcbSubs["PROJECT"] = g.options.Project
gcbSubs["PROJECT_TAG"] = strings.ReplaceAll(g.options.Project, ":", "-")
gcbSubs["OBS_PROJECT"] = g.options.OBSProject
gcbSubs["OBS_PROJECT_TAG"] = strings.ReplaceAll(g.options.OBSProject, ":", "-")

// Stop here when doing OBS release
return gcbSubs, nil
Expand Down

0 comments on commit 957c10d

Please sign in to comment.