Skip to content

Commit

Permalink
Update target branch of release script (elastic#141)
Browse files Browse the repository at this point in the history
As part of elastic/package-storage#86 the way packages are released is changed. The release process will be snapshot -> staging -> production. This PR now first switches over to directly open PR's against production to move away from master. This allows us to update the deployment of epr.elastic.co to point to production branch instead and start to cleanup / remove the master branch.

The second step will be to adjust the script that it directly pushed to snapshot and we then have a release script to promote packages from snapshot to staging to production.
  • Loading branch information
ruflin authored Jul 1, 2020
1 parent 30d2af6 commit fabcf64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions dev/update-package-storage/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ func fetchUpstream(err error, options updateOptions) error {
return runGitCommand(options, "fetch", "upstream")
}

func checkoutMasterBranch(err error, options updateOptions) error {
func checkoutProductionBranch(err error, options updateOptions) error {
if err != nil {
return err
}
return runGitCommand(options, "checkout", "master")
return runGitCommand(options, "checkout", "production")
}

func rebaseUpstreamMaster(err error, options updateOptions) error {
func rebaseUpstreamProduction(err error, options updateOptions) error {
if err != nil {
return err
}
return runGitCommand(options, "rebase", "upstream/master")
return runGitCommand(options, "rebase", "upstream/production")
}

func addToIndex(err error, options updateOptions, packageName, packageVersion string) error {
Expand Down
6 changes: 3 additions & 3 deletions dev/update-package-storage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func main() {
}

err = fetchUpstream(err, options)
err = checkoutMasterBranch(err, options)
err = rebaseUpstreamMaster(err, options)
err = checkoutProductionBranch(err, options)
err = rebaseUpstreamProduction(err, options)
packageNames, err := listPackages(err, options)
err = reviewPackages(err, options, packageNames, handlePackageChanges)
if err != nil {
Expand All @@ -55,7 +55,7 @@ func handlePackageChanges(err error, options updateOptions, packageName string)
}

packageVersion, err := detectGreatestBuiltPackageVersion(err, options, packageName)
err = checkoutMasterBranch(err, options)
err = checkoutProductionBranch(err, options)
released, err := checkIfPackageReleased(err, options, packageName, packageVersion)
if released {
return nil
Expand Down

0 comments on commit fabcf64

Please sign in to comment.