-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease_args.sh
More file actions
29 lines (23 loc) · 1.41 KB
/
release_args.sh
File metadata and controls
29 lines (23 loc) · 1.41 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
#!/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 ".containers.cas.image.tag = \"${newReleaseVersion}\"" "${valuesYAML}"
./.bin/yq -i ".values.images.cas |= sub(\":(([0-9]+)\.([0-9]+)\.([0-9]+)((?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))|(?:\+[0-9A-Za-z-]+))?)\", \":${newReleaseVersion}\")" "${componentPatchTplYAML}"
local chownImageTag
chownImageTag=$(./.bin/yq ".initContainers.volumeChown.image.tag" "${valuesYAML}")
./.bin/yq -i ".values.images.volumeChownInit |= sub(\":(([0-9]+)\.([0-9]+)\.([0-9]+)((?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))|(?:\+[0-9A-Za-z-]+))?)\", \":${chownImageTag}\")" "${componentPatchTplYAML}"
local additionalMountsImageTag
additionalMountsImageTag=$(./.bin/yq ".initContainers.additionalMounts.image.tag" "${valuesYAML}")
./.bin/yq -i ".values.images.additionalMountsInit |= sub(\":(([0-9]+)\.([0-9]+)\.([0-9]+)((?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))|(?:\+[0-9A-Za-z-]+))?)\", \":${additionalMountsImageTag}\")" "${componentPatchTplYAML}"
}
update_versions_stage_modified_files() {
valuesYAML=k8s/helm/values.yaml
componentPatchTplYAML=k8s/helm/component-patch-tpl.yaml
git add "${valuesYAML}" "${componentPatchTplYAML}"
}