-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add CI to bump geohub data pipeline version (#2314)
- Loading branch information
1 parent
cc47620
commit 7298102
Showing
2 changed files
with
59 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Bump geohub-data-pipeline version | ||
on: | ||
# This workflow will be triggered when the new release tag is created on geohub-data-pipeline repository.concurrency: | ||
# https://github.com/UNDP-Data/geohub-data-pipeline/blob/main/.github/workflows/acr_docker_image.yml | ||
repository_dispatch: | ||
types: [bump-pipeline-version] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: bump data-pipeline version | ||
run: ./backends/k8s/data-pipeline/bump-version.sh | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
branch: release/bump-geohub-data-pipeline | ||
title: "[RELEASE] bump version of geohub-data-pipeline" | ||
delete-branch: true | ||
commit-message: "[RELEASE] bump version of geohub-data-pipeline" | ||
body: | | ||
## Description | ||
This is going to bump the version of geohub-data-pipeline to apply the new pipeline docker image to kubernetes cluster | ||
--- | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
labels: release | ||
reviewers: | | ||
iferencik | ||
Thuhaa | ||
JinIgarashi |
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,20 @@ | ||
#!/bin/bash | ||
|
||
yaml_file=./yaml/ingest-environment.yaml | ||
url=https://api.github.com/repos/undp-data/geohub-data-pipeline/releases/latest | ||
|
||
# extract the latest tag version | ||
tag_name=$(curl -s $url | jq --raw-output '.tag_name') | ||
|
||
echo "Latest release version: $tag_name" | ||
|
||
imagename="undpgeohub.azurecr.io/geohub-data-pipeline" | ||
pattern="${imagename}:[^ ]*" | ||
sed -E "s|$pattern|$imagename:$tag_name|g" $yaml_file > "${yaml_file}_new" | ||
|
||
cat "${yaml_file}_new" | ||
|
||
# replace yaml file with new version | ||
mv "${yaml_file}_new" $yaml_file | ||
|
||
echo "tag version was replace to $tag_name" |