-
Notifications
You must be signed in to change notification settings - Fork 59
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
move dev env deployment job to helm repo #1738
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5a21eb6
feat: trigger increase chart version on merge to master
boolafish 3cffb2c
debug: switch to playground repo
boolafish e0c30f1
fix: unbound string
boolafish f134dc6
feat: add jitter to the call
boolafish 45a742d
remove jitter, not useful
boolafish c179ae2
chore: cleanup
boolafish 82d011e
fix: circle ci format
boolafish 50f0522
fix: notifiy service do not wait for non-existing deployment job
boolafish c5f97bd
chore: remove childchain master deployment
boolafish 2be9331
Merge branch 'master' into boolafish/move_deploy_to_helm_repo
boolafish 7d8a889
chore: remove childchain release from elixir-omg
boolafish 5b53fbc
Merge branch 'master' into boolafish/move_deploy_to_helm_repo
boolafish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,40 @@ | ||
#!/bin/sh | ||
|
||
""" | ||
This is the script that would send a dispatch event to the helm chart repo to | ||
auto increase chart version. | ||
This is the script that would send a dispatch event to the helm chart repo to auto increase chart version. | ||
You can set the UPDATE_DEV flag to decide whether to update to dev too. | ||
|
||
For master, we increase the chart version and update dev together. The app version should be short git sha with length 7. | ||
For release, we increase the chart version only. The app version should be semver. (eg. 1.0.3-pre.0) | ||
|
||
Required env vars: | ||
- CIRCLE_TAG | ||
- CHART_NAME | ||
- HELM_CHART_REPO | ||
- CHART_NAME (eg. childchain, watcher, watcher-info) | ||
- APP_VERSION (eg. 3d75118 or 1.0.3-pre.0) | ||
- HELM_CHART_REPO (eg. helm-devlopement) | ||
- UPDATE_DEV (true/false) | ||
- GITHUB_API_TOKEN | ||
""" | ||
|
||
set -e | ||
set -x | ||
set -ex | ||
|
||
increase_chart_version() { | ||
APP_VERSION="${CIRCLE_TAG#*v}" | ||
[ -z "$CHART_NAME" ] && echo "CHART_NAME should be set" && exit 1 | ||
[ -z "$APP_VERSION" ] && echo "APP_VERSION should be set" && exit 1 | ||
[ -z "$HELM_CHART_REPO" ] && echo "HELM_CHART_REPO should be set" && exit 1 | ||
[ -z "$UPDATE_DEV" ] && echo "HELM_CHART_REPO should be set" && exit 1 | ||
[ -z "$GITHUB_API_TOKEN" ] && echo "GITHUB_API_TOKEN should be set" && exit 1 | ||
|
||
echo "increase chart version for chart: ${CHART_NAME} with APP_VERSION: ${APP_VERSION}" | ||
|
||
curl --location --request POST 'https://api.github.com/repos/omgnetwork/'${HELM_CHART_REPO}'/dispatches' \ | ||
--header 'Accept: application/vnd.github.v3+json' \ | ||
--header 'authorization: token '${GITHUB_API_TOKEN}'' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{"event_type": "increase-chart-version", "client_payload": { "chart_name": "'${CHART_NAME}'", "app_version": "'${APP_VERSION}'" }}' | ||
} | ||
echo "increase chart version: chart [${CHART_NAME}], appVersion: [${APP_VERSION}], update_dev: [${UPDATE_DEV}]" | ||
|
||
increase_chart_version | ||
curl --location --request POST "https://api.github.com/repos/omgnetwork/${HELM_CHART_REPO}/dispatches" \ | ||
--header "Accept: application/vnd.github.v3+json" \ | ||
--header "authorization: token ${GITHUB_API_TOKEN}" \ | ||
--header "Content-Type: application/json" \ | ||
--data-raw " { \ | ||
\"event_type\": \"increase-chart-version\", \ | ||
\"client_payload\": { \ | ||
\"chart_name\": \"${CHART_NAME}\", \ | ||
\"app_version\": \"${APP_VERSION}\", \ | ||
\"update_dev\": \"${UPDATE_DEV}\" \ | ||
} \ | ||
}" |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually shall this be from helm repo instead??? @JBunCE @arthurk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/omgnetwork/helm-development/issues/478
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep i think that would be a better place to do it, just because the increase_chart_version_XXX has been run doesn't mean it's deployed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will have to be separate PR as I don't even know how to do that yet 😛