-
Notifications
You must be signed in to change notification settings - Fork 64
60 lines (53 loc) · 2.23 KB
/
manual-freeze-tag.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Freeze helm release tag in helm charts on manual event
on:
workflow_dispatch:
inputs:
oldversion:
default: "0-latest"
description: "Old helm version to be replaced"
required: true
type: string
newversion:
default: "1.2.0"
description: "New helm version to replace"
required: true
type: string
imageversion:
default: "1.2"
description: "New image version to replace"
required: true
type: string
branches-ignore:
- main
jobs:
freeze-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Set up Git
run: |
git config --global user.name "CICD-at-OPEA"
git config --global user.email "CICD@opea.dev"
git remote set-url origin https://CICD-at-OPEA:"${{ secrets.ACTION_TOKEN }}"@github.com/opea-project/GenAIInfra.git
- name: Run script
env:
NEWTAG: ${{ inputs.imageversion }}
run: |
find helm-charts/ -name '*values.yaml' -type f -exec sed -i "s#tag: \"latest\"#tag: \"${{ inputs.imageversion }}\"#g" {} \;
find helm-charts/ -name 'Chart.yaml' -type f -exec sed -i "s#version: ${{ inputs.oldversion }}#version: ${{ inputs.newversion }}#g" {} \;
find microservices-connector/helm/ -name '*values.yaml' -type f -exec sed -i "s#tag: \"latest\"#tag: \"${{ inputs.imageversion }}\"#g" {} \;
find microservices-connector/helm/ -name 'Chart.yaml' -type f -exec sed -i "s#version: ${{ inputs.oldversion }}#version: ${{ inputs.newversion }}#g" {} \;
sed -i "s|opea/gmcrouter:latest|opea/gmcrouter:$NEWTAG|g" microservices-connector/config/gmcrouter/gmc-router.yaml
sed -i "s|opea/gmcmanager:latest|opea/gmcmanager:$NEWTAG|g" microservices-connector/config/manager/gmc-manager.yaml
./helm-charts/update_manifests.sh
- name: Commit changes
run: |
git add .
git commit -s -m "Freeze Helm charts versions for release ${{ inputs.imageversion }}"
git push