This commit is contained in:
2020-03-12 13:27:04 +01:00
parent 49ca01e818
commit 8a4d0c15bf
4 changed files with 74 additions and 26 deletions

View File

@@ -23,7 +23,6 @@ rules:
- "" - ""
- "apps" - "apps"
- "deploy" - "deploy"
- "networking.istio.io"
# deze zullen we ook moeten aanpassen elke pipeline die we maken, maar, deze pipelines zijn nu specifiek per branch, dus dit zou geen probleem leveren. # deze zullen we ook moeten aanpassen elke pipeline die we maken, maar, deze pipelines zijn nu specifiek per branch, dus dit zou geen probleem leveren.
resources: resources:
- pods - pods
@@ -204,14 +203,15 @@ spec:
- name: branch - name: branch
description: name of the master branch of the repository description: name of the master branch of the repository
workspaces: workspaces:
- name: workspace - name: workspace-master
- name: workspace-experimental
tasks: tasks:
- name: clone-master - name: clone-master
taskRef: taskRef:
name: git-clone name: git-clone
workspaces: workspaces:
- name: output - name: output
workspace: workspace workspace: workspace-master
params: params:
- name: url - name: url
value: $(inputs.params.git-url) value: $(inputs.params.git-url)
@@ -220,9 +220,11 @@ spec:
- name: build-and-push-a - name: build-and-push-a
taskRef: taskRef:
name: build-and-push name: build-and-push
runAfter:
- clone-master
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-master
params: params:
- name: context - name: context
value: "server-a" value: "server-a"
@@ -233,9 +235,11 @@ spec:
- name: build-and-push-b-stable - name: build-and-push-b-stable
taskRef: taskRef:
name: build-and-push name: build-and-push
runAfter:
- clone-master
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-master
params: params:
- name: context - name: context
value: "server-b" value: "server-b"
@@ -246,9 +250,11 @@ spec:
- name: build-and-push-d - name: build-and-push-d
taskRef: taskRef:
name: build-and-push name: build-and-push
runAfter:
- clone-master
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-master
params: params:
- name: context - name: context
value: "server-d" value: "server-d"
@@ -256,16 +262,12 @@ spec:
value: "server-d" value: "server-d"
- name: version - name: version
value: "$(inputs.params.master-branch)" value: "$(inputs.params.master-branch)"
- name: clone-experimental-branch - name: clone-experimental
taskRef: taskRef:
name: git-clone name: git-clone
workspaces: workspaces:
- name: output - name: output
workspace: workspace workspace: workspace-experimental
runAfter:
- build-and-push-a
- build-and-push-b-stable
- build-and-push-d
params: params:
- name: url - name: url
value: $(inputs.params.git-url) value: $(inputs.params.git-url)
@@ -276,9 +278,9 @@ spec:
name: build-and-push name: build-and-push
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-experimental
runAfter: runAfter:
- clone-experimental-branch - clone-experimental
params: params:
- name: context - name: context
value: "server-b" value: "server-b"
@@ -291,9 +293,12 @@ spec:
name: execute-yaml name: execute-yaml
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-master
runAfter: runAfter:
- build-and-push-b-experimental - build-and-push-b-experimental
- build-and-push-d
- build-and-push-a
- build-and-push-b-stable
params: params:
- name: yaml-location - name: yaml-location
value: "infra.yaml" value: "infra.yaml"
@@ -302,6 +307,6 @@ spec:
name: execute-yaml name: execute-yaml
workspaces: workspaces:
- name: source - name: source
workspace: workspace workspace: workspace-master
runAfter: runAfter:
- deploy-infra - deploy-infra

View File

@@ -22,10 +22,21 @@ spec:
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: workspace-pvc name: workspace-pvc-master
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteOnce
resources:
requests:
storage: 500Mi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: workspace-pvc-experimental
spec:
accessModes:
- ReadWriteOnce
resources: resources:
requests: requests:
storage: 500Mi storage: 500Mi
@@ -52,6 +63,13 @@ spec:
serviceAccountName: service-acc serviceAccountName: service-acc
pipelineRef: pipelineRef:
name: application-pipeline #gebruik dit om de pipeline aan te passen naar andere versies, zolang ze zich in dezelfde #namespace bevinden kunnen we deze pipeline hergebruiken om deployments op de cluster uit te voeren. service-mesh agnostisch. name: application-pipeline #gebruik dit om de pipeline aan te passen naar andere versies, zolang ze zich in dezelfde #namespace bevinden kunnen we deze pipeline hergebruiken om deployments op de cluster uit te voeren. service-mesh agnostisch.
workspaces:
- name: workspace-master
persistentVolumeClaim:
claimName: workspace-pvc-master
- name: workspace-experimental
persistentVolumeClaim:
claimName: workspace-pvc-experimental
params: params:
- name: git-url - name: git-url
value: $(inputs.params.gitrepositoryurl) value: $(inputs.params.gitrepositoryurl)
@@ -77,6 +95,12 @@ rules:
- pipelineruns - pipelineruns
- pipelineresources - pipelineresources
- taskruns - taskruns
- pods
- serviceaccounts
- namespaces
- services
- deployments
- deployments.apps
verbs: verbs:
- create - create
- get - get
@@ -102,12 +126,10 @@ apiVersion: tekton.dev/v1alpha1
kind: EventListener kind: EventListener
metadata: metadata:
name: github-event-listener name: github-event-listener
#namespace: stage-tekton-pipeline
spec: spec:
serviceAccountName: service-acc serviceAccountName: service-acc
triggers: triggers:
- binding: - bindings:
name: github-trigger-binding - name: github-trigger-binding
template: template:
name: github-trigger-template name: github-trigger-template
---

View File

@@ -236,8 +236,8 @@ spec:
- name: ExternalDomain - name: ExternalDomain
value: kube.llocal.host value: kube.llocal.host
- name: Service - name: Service
value: getting-started value: el-github-event-listener
- name: ServicePort - name: ServicePort
value: "443" value: "8080"
timeout: 1000s timeout: 1000s
serviceAccountName: service-acc serviceAccountName: service-acc

21
manifests/test.yaml Normal file
View File

@@ -0,0 +1,21 @@
apiVersion: tekton.dev/v1alpha1
kind: EventListener
metadata:
name: github-event-listener
#namespace: stage-tekton-pipeline
spec:
serviceAccountName: service-acc
triggers:
- name: github-trigger
interceptors:
- github:
secretRef:
secretName: webhook-secret
secretKey: secret
eventTypes:
- pull_request
- push
bindings:
name: github-trigger-binding
template:
name: github-trigger-template