-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from jgwest/add-rollouts-upgrade-script
Add automatic rollouts upgrade script (#33)
- Loading branch information
Showing
9 changed files
with
538 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
settings.env | ||
argo-rollouts-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Update argo-rollouts-manager to latest release of Argo Rollouts | ||
|
||
The Go code and script this in this directory will automatically open a pull request to update the argo-rollouts-manager to the latest official argo-rollouts release: | ||
- Update container image version in `default.go` | ||
- Update `go.mod` to point to latest module version | ||
- Update CRDs to latest | ||
- Update target Rollouts version in `hack/run-upstream-argo-rollouts-e2e-tests.sh` | ||
- Open Pull Request using 'gh' CLI | ||
|
||
## Instructions | ||
|
||
### Prerequisites | ||
- GitHub CLI (_gh_) installed and on PATH | ||
- Go installed an on PATH | ||
- [Operator-sdk v1.28.0](https://github.com/operator-framework/operator-sdk/releases/tag/v1.28.0) installed (as of January 2024), and on PATH | ||
- You must have your own fork of the [argo-rollouts-manager](https://github.com/argoproj-labs/argo-rollouts-manager) repository (example: `jgwest/argo-rollouts-manager`) | ||
- Your local SSH key registered (e.g. `~/.ssh/id_rsa.pub`) with GitHub to allow git clone via SSH | ||
|
||
### Configure and run the tool | ||
|
||
```bash | ||
|
||
# Set required Environment Variables | ||
export GITHUB_FORK_USERNAME="(your username here)" | ||
export GH_TOKEN="(a GitHub personal access token that can clone/push/open PRs against argo-rollouts-manager repo)" | ||
|
||
# or, you can set these values in the settings.env file: | ||
# cp settings_template.env settings.env | ||
# Then set env vars in settings.env (which is excluded in the .gitignore) | ||
|
||
./init-repo.sh | ||
./go-run.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
cd $SCRIPT_DIR | ||
|
||
# Read Github Token and Username from settings.env, if it exists | ||
vars_file="$SCRIPT_DIR/settings.env" | ||
if [[ -f "$vars_file" ]]; then | ||
source "$vars_file" | ||
fi | ||
|
||
# Run the upgrade code | ||
go run . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module github.com/jgwest/argo-rollouts-release-job | ||
|
||
go 1.20 | ||
|
||
require ( | ||
github.com/google/go-github/v58 v58.0.0 | ||
github.com/google/go-querystring v1.1.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= | ||
github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw= | ||
github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4= | ||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= | ||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= | ||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
cd $SCRIPT_DIR | ||
|
||
# Read Github Token and Username from settings.env, if it exists | ||
vars_file="$SCRIPT_DIR/settings.env" | ||
if [[ -f "$vars_file" ]]; then | ||
source "$vars_file" | ||
fi | ||
|
||
# Clone fork of argo-rollouts-manager repo | ||
|
||
rm -rf "$SCRIPT_DIR/argo-rollouts-manager" || true | ||
|
||
git clone "[email protected]:$GITHUB_FORK_USERNAME/argo-rollouts-manager" | ||
cd argo-rollouts-manager | ||
|
||
# Add a remote back to the original repo | ||
|
||
git remote add parent "[email protected]:argoproj-labs/argo-rollouts-manager" | ||
git fetch parent | ||
|
Oops, something went wrong.