Skip to content

Commit

Permalink
Merge pull request #1205 from saschagrunert/default-master
Browse files Browse the repository at this point in the history
Default to master branch in gcbmgr
  • Loading branch information
k8s-ci-robot authored Mar 24, 2020
2 parents e99305e + feb951d commit 60daf60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 4 additions & 9 deletions cmd/krel/cmd/gcbmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func init() {
gcbmgrCmd.PersistentFlags().StringVar(
&gcbmgrOpts.branch,
"branch",
"",
git.Master,
"Branch to run the specified GCB run against",
)

Expand Down Expand Up @@ -321,12 +321,7 @@ func setGCBSubstitutions(o *gcbmgrOptions) (map[string]string, error) {
gcbSubs["RC"] = ""
}

branch := o.branch
if branch == "" {
return gcbSubs, errors.New("Release branch must be set to continue")
}

gcbSubs["RELEASE_BRANCH"] = branch
gcbSubs["RELEASE_BRANCH"] = o.branch

if o.stage {
// TODO: Remove once we remove support for --built-at-head.
Expand Down Expand Up @@ -357,8 +352,8 @@ func setGCBSubstitutions(o *gcbmgrOptions) (map[string]string, error) {
gcbSubs["BUILDVERSION"] = buildVersion

kubecrossBranches := []string{
branch,
"master",
o.branch,
git.Master,
}

kubecrossVersion, kubecrossVersionErr := release.GetKubecrossVersion(kubecrossBranches...)
Expand Down
6 changes: 3 additions & 3 deletions docs/krel/gcbmgr.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Simply [install krel](README.md#installation).

```
Flags:
--branch string Branch to run the specified GCB run against
--branch string Branch to run the specified GCB run against (default "master")
--build-version string Build version
--gcb-config string If provided, this will be used as the name of the Google Cloud Build config file. (default "cloudbuild.yaml")
--gcp-user string If provided, this will be used as the GCP_USER_TAG.
Expand All @@ -56,6 +56,8 @@ Global Flags:
## Important notes

- Default executions of `krel gcbmgr` run in mock mode. To run an actual stage or release, you **MUST** provide the `--nomock` flag.
- Note that the default `--branch` is set to `master`, which means that it needs
to be set to the release branch if necessary.
- Always execute the release process in the following order:
- mock stage: `krel gcbmgr --stage`
- mock release: `krel gcbmgr --release`
Expand All @@ -81,15 +83,13 @@ Global Flags:

```shell
krel gcbmgr --stage \
--branch master \
--project kubernetes-release-test
```

### Alpha Release

```shell
krel gcbmgr --release \
--branch master \
--project kubernetes-release-test \
--build-version <build-version>
```
Expand Down

0 comments on commit 60daf60

Please sign in to comment.