Skip to content
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

set custom org and repo for FF cloudbuild job #3505

Merged
merged 1 commit into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions gcb/fast-forward/cloudbuild.yaml
Expand Up @@ -75,6 +75,8 @@ steps:
- "fast-forward"
- "--log-level=${_LOG_LEVEL}"
- "--non-interactive"
- "--github-org=${_K8S_ORG}"
- "--github-repo=${_K8S_REPO}"
- "${_NOMOCK}"

tags:
Expand All @@ -84,6 +86,8 @@ tags:
- ${_GIT_TAG}
- ${_RELEASE_BRANCH}
- ${_TYPE_TAG}
- ${_K8S_ORG}
- ${_K8S_REPO}
- ${_TYPE}

options:
Expand Down
2 changes: 2 additions & 0 deletions pkg/fastforward/fastforward.go
Expand Up @@ -94,6 +94,8 @@ func (f *FastForward) Run() (err error) {
options.Stream = true
options.Project = f.options.GCPProjectID
options.ScratchBucket = "gs://" + f.options.GCPProjectID + "-gcb"
options.CustomK8SRepo = f.options.GitHubRepo
options.CustomK8sOrg = f.options.GitHubOrg
return f.Submit(options)
}

Expand Down
34 changes: 22 additions & 12 deletions pkg/gcp/gcb/gcb.go
Expand Up @@ -95,18 +95,20 @@ type Options struct {
// NonInteractive does not ask any questions if set to true.
NonInteractive bool

NoMock bool
Stage bool
Release bool
FastForward bool
Stream bool
BuildAtHead bool
Branch string
ReleaseType string
BuildVersion string
GcpUser string
LogLevel string
LastJobs int64
NoMock bool
Stage bool
Release bool
FastForward bool
Stream bool
BuildAtHead bool
Branch string
ReleaseType string
BuildVersion string
GcpUser string
LogLevel string
CustomK8SRepo string
CustomK8sOrg string
LastJobs int64

// OpenBuildService parameters
OBSStage bool
Expand Down Expand Up @@ -360,7 +362,15 @@ func (g *GCB) SetGCBSubstitutions(toolOrg, toolRepo, toolRef, gcsBucket string)
gcbSubs["TOOL_REF"] = toolRef

gcbSubs["K8S_ORG"] = release.GetK8sOrg()
if g.options.CustomK8sOrg != "" {
gcbSubs["K8S_ORG"] = g.options.CustomK8sOrg
}

gcbSubs["K8S_REPO"] = release.GetK8sRepo()
if g.options.CustomK8SRepo != "" {
gcbSubs["K8S_REPO"] = g.options.CustomK8SRepo
}

gcbSubs["K8S_REF"] = release.GetK8sRef()

gcpUser := g.options.GcpUser
Expand Down