Skip to content

Commit

Permalink
Merge pull request #14 from rht-labs/feature/jenkins-agents
Browse files Browse the repository at this point in the history
Regarding issue #15 we can pass this check for now. It works on Openshift.
  • Loading branch information
ckavili authored Apr 1, 2020
2 parents 18a629a + 781805d commit bd56b56
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 99 deletions.
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "v0.0.1"
description: A Helm chart for deploying Jenkins on OpenShift
name: jenkins
version: 0.0.2
version: 0.0.3
home: https://github.com/rht-labs/charts
maintainers:
- name: springdo
Expand Down
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 }}
62 changes: 44 additions & 18 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,48 @@ 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

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: '/'
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"

0 comments on commit bd56b56

Please sign in to comment.