-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathoperator-module-version-update.yaml
More file actions
133 lines (119 loc) · 5.97 KB
/
operator-module-version-update.yaml
File metadata and controls
133 lines (119 loc) · 5.97 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Reusable workflow to perform operator version update
# To perform module version update for csm-operator version update, needs two arguments as input to the workflow
name: CSM Operator Module Version Update
on:
workflow_call:
inputs:
csm-version:
description: 'CSM program version, ex: v1.14.0, v1.15.0, ...'
required: true
type: string
update-option:
description: 'Select the update flag, ex. "nightly" or "tag"'
required: true
type: string
jobs:
read-values:
runs-on: ubuntu-latest
steps:
- name: Checkout csm repository
uses: actions/checkout@v6
with:
repository: dell/csm
path: csm
- name: Read values from csm-versions.yaml
id: read_values
run: |
extract_value() {
grep -E "^$1" csm/config/csm-versions.yaml | cut -d ':' -f 2 | tr -d ' '
}
csm_version=$(extract_value 'csm-version')
csm_operator=$(extract_value 'csm-operator')
csi_powerscale=$(extract_value 'csi-powerscale')
csi_powerstore=$(extract_value 'csi-powerstore')
csi_powermax=$(extract_value 'csi-powermax')
csi_vxflexos=$(extract_value 'csi-vxflexos')
csi_unity=$(extract_value 'csi-unity')
csm_replication=$(extract_value 'csm-replication')
karavi_resiliency=$(extract_value 'karavi-resiliency')
csm_authorization_v2=$(extract_value 'csm-authorization-v2')
csireverseproxy=$(extract_value 'csireverseproxy')
karavi_observability=$(extract_value 'karavi-observability')
karavi_metrics_powerflex=$(extract_value 'karavi-metrics-powerflex')
csm_metrics_powerstore=$(extract_value 'csm-metrics-powerstore')
csm_metrics_powerscale=$(extract_value 'csm-metrics-powerscale')
csm_metrics_powermax=$(extract_value 'csm-metrics-powermax')
otel_collector=$(extract_value 'otel-collector')
echo "CSM_VERSION=$csm_version" >> $GITHUB_ENV
echo "CSM_OPERATOR=$csm_operator" >> $GITHUB_ENV
echo "CSI_POWERSCALE=$csi_powerscale" >> $GITHUB_ENV
echo "CSI_POWERSTORE=$csi_powerstore" >> $GITHUB_ENV
echo "CSI_POWERMAX=$csi_powermax" >> $GITHUB_ENV
echo "CSI_VXFLEXOS=$csi_vxflexos" >> $GITHUB_ENV
echo "CSI_UNITY=$csi_unity" >> $GITHUB_ENV
echo "CSM_REPLICATION=$csm_replication" >> $GITHUB_ENV
echo "KARAVI_RESILIENCY=$karavi_resiliency" >> $GITHUB_ENV
echo "CSM_AUTHORIZATION_V2=$csm_authorization_v2" >> $GITHUB_ENV
echo "CSIREVERSEPROXY=$csireverseproxy" >> $GITHUB_ENV
echo "KARAVI_OBSERVABILITY=$karavi_observability" >> $GITHUB_ENV
echo "KARAVI_METRICS_POWERFLEX=$karavi_metrics_powerflex" >> $GITHUB_ENV
echo "CSM_METRICS_POWERSTORE=$csm_metrics_powerstore" >> $GITHUB_ENV
echo "CSM_METRICS_POWERSCALE=$csm_metrics_powerscale" >> $GITHUB_ENV
echo "CSM_METRICS_POWERMAX=$csm_metrics_powermax" >> $GITHUB_ENV
echo "OTEL_COLLECTOR=$otel_collector" >> $GITHUB_ENV
- name: Checkout csm-operator repository
uses: actions/checkout@v6
with:
repository: dell/csm-operator
- name: Install dos2unix
run: sudo apt-get update && sudo apt-get install -y dos2unix
- name: Updating Module version
run: |
echo "Input csm version --> ${{ inputs.csm-version }}"
echo "Update flag --> ${{ inputs.update-option }}"
csm_ver_provided=${{ inputs.csm-version }}
csm_repo_ver="$(echo -e "${CSM_VERSION}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
csm_ver_provided="$(echo -e "${csm_ver_provided}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
if [ $csm_repo_ver == $csm_ver_provided ]; then
echo "CSM version verified, proceeding with the update..."
dos2unix $GITHUB_WORKSPACE/.github/scripts/module-version-update.sh
chmod +x $GITHUB_WORKSPACE/.github/scripts/module-version-update.sh
bash $GITHUB_WORKSPACE/.github/scripts/module-version-update.sh ${{ inputs.csm-version }} ${{ inputs.update-option}}
else
echo "CSM version mismatch detected. Please verify and update the version file in the CSM repository."
fi
shell: bash
# Needed for signing commits using Github App tokens
# See: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#commit-signing
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v3.1.1
id: generate-token
with:
app-id: ${{ vars.CSM_RELEASE_APP_ID }}
private-key: ${{ secrets.CSM_RELEASE_APP_PRIVATE_KEY }}
# Must enable "allow GitHub Actions to create pull requests" setting
# Author defaults to the user who triggered the workflow run
- name: Create pull request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.generate-token.outputs.token }}
branch: "operator-module-version-update-${{ inputs.csm-version }}"
commit-message: "Update operator modules version for csm-${{ inputs.csm-version }}"
title: "Update module versions for CSM ${{ inputs.csm-version }}"
body: |
Modules version updated to latest for following :-
- Observability
- Replication
- Resiliency
- Authorization V2
- csireverseproxy
Auto-generated by [common-github-actions](https://github.com/dell/common-github-actions)
sign-commits: true
delete-branch: true