Skip to content

Commit d5ec17f

Browse files
committed
feat(charts): make configmap creation optional in contracts charts
1 parent 8ee9f43 commit d5ec17f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

charts/contracts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: contracts
22
description: A helm chart to manage fhevm Smart Contracts Deployment
3-
version: 0.7.5
3+
version: 0.7.6
44
apiVersion: v2
55
keywords:
66
- fhevm

charts/contracts/templates/sc-deploy-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ data:
99
deploy-contracts.sh: |
1010
#!/bin/bash
1111
set -eo pipefail
12-
12+
13+
{{- if .Values.scDeploy.configmap.create }}
1314
create_configmap() {
1415
configmap_name="${1}"
1516
if [[ -z "$configmap_name" ]]; then
@@ -77,6 +78,7 @@ data:
7778
exit 0
7879
fi
7980
{{- end }}
81+
{{- end }}
8082
8183
echo "executing deploy commands"
8284
{{- range .Values.scDeploy.deployCommands }}
@@ -104,8 +106,10 @@ data:
104106
{{- if .Values.scDeploy.verifyContracts }}
105107
npx --no-install hardhat verify:verify || true
106108
{{- end }}
109+
{{- if .Values.scDeploy.configmap.create }}
107110
echo "adding the current contracts version to the configmap"
108111
kubectl patch configmap "${CONFIGMAP_NAME}" -p="{\"data\": {\"contracts.version\": \"{{ .Values.scDeploy.image.tag }}\"}}"
112+
{{- end }}
109113
upgrade-contracts.sh: |
110114
#!/bin/bash
111115
set -eo pipefail
@@ -121,6 +125,8 @@ data:
121125
{{- range .Values.scUpgrade.upgradeCommands }}
122126
{{ . | nindent 4 }}
123127
{{- end }}
128+
{{- if .Values.scDeploy.configmap.create }}
124129
echo "updating the contracts version to the configmap"
125130
CONFIGMAP_NAME="{{ .Values.scDeploy.configmap.name }}"
126131
kubectl patch configmap "${CONFIGMAP_NAME}" -p="{\"data\": {\"contracts.version\": \"{{ .Values.scDeploy.image.tag }}\"}}"
132+
{{- end }}

charts/contracts/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ scDeploy:
3030

3131
# ConfigMap to store deployed contract addresses
3232
configmap:
33+
create: true
3334
name: "sc-addresses"
3435
annotations:
3536

0 commit comments

Comments
 (0)