Skip to content

Commit

Permalink
🦆 MOVE - templates and vars from uj to chart file
Browse files Browse the repository at this point in the history
  • Loading branch information
springdo committed Apr 1, 2020
1 parent 18a629a commit 9ef701b
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 98 deletions.
52 changes: 0 additions & 52 deletions charts/jenkins/templates/buildconfig.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions charts/jenkins/templates/buildconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{- if .Values.buildconfigs }}
{{- range $key := .Values.buildconfigs }}
---
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: {{ .name }}
labels:
build: {{ .name }}
type: image
spec:
triggers:
- type: "ConfigChange"
{{- if .build_trigger_secret }}
- type: GitHub
github:
secret: {{ .build_trigger_secret | quote }}
- type: GitLab
gitlab:
secret: {{ .build_trigger_secret | quote }}
- type: BitBucket
bitbucket:
secret: {{ .build_trigger_secret | quote }}
- type: Generic
generic:
secret: {{ .build_trigger_secret | quote }}
allowEnv: true
{{- end}}
runPolicy: Serial
source:
type: Git
{{- if .source_secret }}
sourceSecret:
name: {{ .source_secret }}
{{- end }}
git:
uri: {{ .source_repo | quote }}
ref: {{ .source_repo_ref | default "master" | quote }}
contextDir: {{ .source_context_dir | quote }}
strategy:
type: {{ .strategy_type }}
{{- if eq .strategy_type "Docker" }}
dockerStrategy:
dockerfilePath: {{ .dockerfilePath | default "Dockerfile" | quote }}
from:
kind: DockerImage
name: "{{ .builder_image_name }}:{{ .builder_image_tag }}"
imagePullPolicy: Always
{{- end }}
{{- if eq .strategy_type "Source" }}
sourceStrategy:
from:
kind: "ImageStreamTag"
name: "{{ .builder_image_name }}:{{ .builder_image_tag }}"
namespace: {{ .builder_image_namespace | default "openshift" | quote }}
{{- end }}
{{- if .pull_secret }}
pullSecret:
name: {{ .pull_secret | quote}}
{{- end }}
output:
to:
kind: ImageStreamTag
name: "{{ .name }}:latest"
{{- end}}
{{- end}}
19 changes: 0 additions & 19 deletions charts/jenkins/templates/external-jenkins-imagestream.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions charts/jenkins/templates/imagestream.yaml

This file was deleted.

26 changes: 26 additions & 0 deletions charts/jenkins/templates/imagestreams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- range $key := .Values.imagestreams }}
---
kind: ImageStream
apiVersion: image.openshift.io/v1
{{- if .name | regexFind ".*slave" }}
labels:
build: {{ .name }}
role: jenkins-slave
{{- end }}
metadata:
name: {{ .name }}
annotations:
description: Keeps track of changes in the application image
{{- if .external }}
spec:
tags:
- name: {{ .external.builder_imagetag | quote }}
annotations: null
from:
kind: DockerImage
name: {{ .external.builder_registry }}/{{ .external.builder_repo }}/{{ .external.builder_image }}:{{ .external.builder_imagetag }}
importPolicy: {}
referencePolicy:
type: Source
{{- end }}
{{- end }}
64 changes: 46 additions & 18 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,50 @@ services:
target_port: 5000
selector: *name

imagestream:
name: *name
external:
builder_registry: quay.io
builder_repo: openshift
builder_image: origin-jenkins
builder_imagetag: latest
builder_repo: openshift
builder_image: jenkins
builder_imagetag: '2'
imagestreams:
# Jenkins Imagestream for custom build or external
- name: *name
external:
builder_registry: quay.io
builder_repo: openshift
builder_image: origin-jenkins
builder_imagetag: latest
# Jenkins agents image streams
- name: jenkins-slave-mvn
- name: jenkins-slave-argocd
- name: jenkins-slave-helm


buildconfigs:
- name: *name
build_trigger_secret: 'shhhhh-this-is-my-super-duper-secret123-shhhhh'
strategy_type: "Source"
source_secret: 'git-auth'
pull_secret: ''
source_repo: https://github.com/rht-labs/s2i-config-jenkins.git
source_repo_ref: v1.6
source_context_dir: '/'
builder_image_name: jenkins
builder_image_tag: '2'
- name: "jenkins-slave-mvn"
strategy_type: "Docker"
source_context_dir: "jenkins-slaves/jenkins-slave-mvn"
source_repo: "https://github.com/redhat-cop/containers-quickstarts"
source_repo_ref: "v1.20"
builder_image_name: "quay.io/openshift/origin-jenkins-agent-maven"
builder_image_tag: "4.2"
- name: "jenkins-slave-helm"
strategy_type: "Docker"
source_context_dir: "jenkins-slaves/jenkins-slave-helm"
source_repo: "https://github.com/redhat-cop/containers-quickstarts"
source_repo_ref: "v1.20"
builder_image_name: "registry.access.redhat.com/openshift3/jenkins-slave-base-rhel7"
builder_image_tag: "latest"
- name: "jenkins-slave-argocd"
strategy_type: "Docker"
source_context_dir: "jenkins-slaves/jenkins-slave-argocd"
source_repo: "https://github.com/redhat-cop/containers-quickstarts"
source_repo_ref: "v1.20"
builder_image_name: "registry.access.redhat.com/openshift3/jenkins-slave-base-rhel7"
builder_image_tag: "latest"

buildconfig:
name: *name
build_secret: 'shhhhh-this-is-my-super-duper-secret123-shhhhh'
source_secret: 'git-auth'
pull_secret: ''
source_repo_url: https://github.com/rht-labs/s2i-config-jenkins.git
source_repo_ref: v1.6
source_repo_context: '/'

0 comments on commit 9ef701b

Please sign in to comment.