This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to build the image in cluster
Signed-off-by: Tomas Coufal <[email protected]>
- Loading branch information
Showing
8 changed files
with
452 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{/* | ||
Return the proper Docker Image Registry Secret Names | ||
*/}} | ||
{{- define "janusIdp.renderImageBuildPullSecrets" -}} | ||
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.build.buildConfig) "context" $) -}} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Return the proper image name | ||
THIS IS AN OVERRIDE of upstream helper! | ||
https://github.com/backstage/charts/blob/13a408cc070005a9960a5e2a3f6ebfdd8c77d8d2/charts/backstage/templates/_helpers.tpl#L4 | ||
*/}} | ||
{{- define "backstage.image" -}} | ||
{{- $templatedImage := include "common.images.image" (dict "imageRoot" .Values.backstage.image "global" .Values.global) -}} | ||
{{ include "common.tplvalues.render" ( dict "value" $templatedImage "context" $ ) }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{- if .Values.build.enabled }} | ||
apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: {{- include "common.labels.standard" . | nindent 4 }} | ||
app.kubernetes.io/component: backstage | ||
{{- if .Values.upstream.commonLabels }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.upstream.commonLabels "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
{{- if or .Values.upstream.commonAnnotations .Values.build.buildConfig.annotations }} | ||
annotations: | ||
{{- if .Values.build.buildConfig.annotations }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.build.buildConfig.annotations "context" $) | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.upstream.commonAnnotations }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.upstream.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
resources: | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.build.buildConfig.resources "context" $) | nindent 4 }} | ||
failedBuildsHistoryLimit: {{ .Values.build.buildConfig.failedBuildsHistoryLimit }} | ||
successfulBuildsHistoryLimit: {{ .Values.build.buildConfig.successfulBuildsHistoryLimit }} | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: {{ include "common.names.fullname" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
runPolicy: Serial | ||
source: | ||
type: Git | ||
git: | ||
uri: {{ .Values.build.buildConfig.uri }} | ||
ref: {{ .Values.build.buildConfig.ref }} | ||
{{- if .Values.build.buildConfig.contextDir }} | ||
contextDir: {{ .Values.build.buildConfig.contextDir }} | ||
{{- end }} | ||
{{- if .Values.build.buildConfig.sourceSecretName }} | ||
sourceSecret: | ||
name: {{ .Values.build.buildConfig.sourceSecretName }} | ||
{{- end }} | ||
strategy: | ||
{{- if not (has .Values.build.buildConfig.strategy.type (list "Docker" "Source")) }} | ||
{{- fail "value 'build.buildConfig.type' must be either 'Docker' or 'Source'" }} | ||
{{- end }} | ||
{{- if eq .Values.build.buildConfig.strategy.type "Docker" }} | ||
type: Docker | ||
dockerStrategy: | ||
dockerfilePath: {{ .Values.build.buildConfig.strategy.docker.dockerfilePath }} | ||
{{- include "janusIdp.renderImageBuildPullSecrets" . | nindent 6 }} | ||
{{- else }} | ||
type: Source | ||
sourceStrategy: | ||
from: | ||
kind: ImageStreamTag | ||
name: "nodejs:latest" | ||
namespace: openshift | ||
{{- if .Values.build.buildConfig.strategy.source.scripts }} | ||
scripts: {{ .Values.build.buildConfig.strategy.source.scripts }} | ||
{{- end }} | ||
{{- end }} | ||
triggers: | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.build.buildConfig.triggers "context" $ ) | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.build.enabled }} | ||
apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: {{- include "common.labels.standard" . | nindent 4 }} | ||
app.kubernetes.io/component: backstage | ||
{{- if .Values.upstream.commonLabels }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.upstream.commonLabels "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
{{- if or .Values.upstream.commonAnnotations .Values.build.imageStream.annotations }} | ||
annotations: | ||
{{- if .Values.build.imageStream.annotations }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.build.imageStream.annotations "context" $) | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.upstream.commonAnnotations }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.upstream.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
lookupPolicy: | ||
local: true | ||
{{- end }} |
Oops, something went wrong.