-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_args.sh
More file actions
26 lines (21 loc) · 1.1 KB
/
release_args.sh
File metadata and controls
26 lines (21 loc) · 1.1 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
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
# this function will be sourced from release.sh and be called from release_functions.sh
update_versions_modify_files() {
newReleaseVersion="${1}"
valuesYAML=k8s/helm/values.yaml
componentPatchTplYAML=k8s/helm/component-patch-tpl.yaml
./.bin/yq -i ".manager.image.tag = \"${newReleaseVersion}\"" "${valuesYAML}"
./.bin/yq -i ".values.images.backupOperator |= sub(\":(([0-9]+)\.([0-9]+)\.([0-9]+)((?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))|(?:\+[0-9A-Za-z-]+))?)\", \":${newReleaseVersion}\")" "${componentPatchTplYAML}"
# set kubectl-version in component-patch-tpl.yaml
local kubectlVersion
kubectlVersion=$(./.bin/yq '.initContainer.image.tag' < ${valuesYAML})
./.bin/yq -i ".values.images.kubectl |= sub(\":(([0-9]+)\.([0-9]+)\.([0-9]+)((?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))|(?:\+[0-9A-Za-z-]+))?)\", \":${kubectlVersion}\")" "${componentPatchTplYAML}"
}
update_versions_stage_modified_files() {
valuesYAML=k8s/helm/values.yaml
componentPatchTplYAML=k8s/helm/component-patch-tpl.yaml
git add "${valuesYAML}" "${componentPatchTplYAML}"
}