From fcc988835ce49dee4ce376565a9f643a165de74e Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 22 Aug 2019 10:31:26 +0200 Subject: Support building multiple versions per imagestream --- roles/ands_kaas/templates/40-kaas-app-builders.yml.j2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'roles/ands_kaas/templates/40-kaas-app-builders.yml.j2') diff --git a/roles/ands_kaas/templates/40-kaas-app-builders.yml.j2 b/roles/ands_kaas/templates/40-kaas-app-builders.yml.j2 index d033eda..50bef9a 100644 --- a/roles/ands_kaas/templates/40-kaas-app-builders.yml.j2 +++ b/roles/ands_kaas/templates/40-kaas-app-builders.yml.j2 @@ -16,17 +16,26 @@ objects: {% for name, builder in builders.iteritems() %} {% set isname = builder.name | default(name) | regex_replace('_','-') %} {% set istag = builder.version | default("latest") %} + {% set bcname = isname if istag == 'latest' else isname + '-' + istag %} {% set type = builder.type | default("Docker") %} {% set src_type = builder.src_type | default("git") %} {% set image_type = builder.image_type | default("ImageStreamTag") %} + {% if builder.name is not defined or builder.name == name %} - kind: ImageStream apiVersion: v1 metadata: name: {{ isname }} + labels: + app: {{ appname | default(kaas_project) }} + name: {{ isname }} + {% endif %} - kind: "BuildConfig" apiVersion: v1 metadata: - name: {{ isname }} + name: {{ bcname }} + labels: + app: {{ appname | default(kaas_project) }} + name: {{ isname }} spec: successfulBuildsHistoryLimit: "{{ kaas_pod_history_limit }}" failedBuildsHistoryLimit: "{{ kaas_pod_history_limit }}" -- cgit v1.2.3