Skip to content

Commit

Permalink
Helm chart: improve ci image suffix management
Browse files Browse the repository at this point in the history
  • Loading branch information
giorio94 authored and adamjensenbot committed Jun 7, 2022
1 parent 416839b commit 180f12a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deployments/liqo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ Create version used to select the liqo version to be installed .
{{- end }}

{{/*
Create version used to select the liqo version to be installed.
The suffix added to the Liqo images, to identify CI builds.
*/}}
{{- define "liqo.suffix" -}}
{{- if or (eq .Values.tag "") (eq .Chart.AppVersion .Values.tag) }}
{{/* https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string */}}
{{- $semverregex := "^v(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" }}
{{- if or (eq .Values.tag "") (mustRegexMatch $semverregex .Values.tag) }}
{{- print "" }}
{{- else }}
{{- print "-ci" }}
Expand Down

0 comments on commit 180f12a

Please sign in to comment.