infra pipeline specialised

This commit is contained in:
2020-03-19 11:27:28 +01:00
parent 1860b861c0
commit 54710dc73f
6 changed files with 102 additions and 4 deletions

View File

@@ -0,0 +1,87 @@
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: infra-pipeline
namespace: tekton-pipeline-1
spec:
params:
- name: git-repo-name
description: name of the git repo (used to determine the name of the image)
- name: git-url
description: url of the git repository to clone
- name: revision
description: revision to check out
- name: branch
description: name of the master branch of the repository
- name: git-repo-full-name
description: full name of the github repo (used for status updates)
workspaces:
- name: workspace
tasks:
- name: clone-git-repo
taskRef:
name: git-clone
workspaces:
- name: output
workspace: workspace
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.revision)
- name: set-begun-status
taskRef:
name: github-set-status
runAfter:
- clone-git-repo
params:
- name: REPO_FULL_NAME
value: $(params.git-repo-full-name)
- name: SHA
value: $(params.revision)
- name: TARGET_URL
value: tekton.llocal.host/dashboard
- name: STATE
value: pending
- name: DESCRIPTION
value: "Deploy to cluster has started (will not complete if this is not master branch)"
- name: deploy-infrastructure
taskRef:
name: deploy-app
runAfter:
- clone-git-repo
workspaces:
- name: source
workspace: workspace
params:
- name: yaml-location
value: infra/
conditions:
- conditionRef: "is-not-equal"
params:
- name: "left"
value: "master"
- name: "right"
value: "$(params.branch)"
- name: set-finished-state
taskRef:
name: github-set-status
runAfter:
- deploy-infrastructure
- set-begun-status
params:
- name: REPO_FULL_NAME
value: $(params.git-repo-full-name)
- name: SHA
value: $(params.revision)
- name: TARGET_URL
value: tekton.llocal.host/dashboard
- name: STATE
value: success
- name: DESCRIPTION
value: "deployment applied"

View File

@@ -12,7 +12,9 @@ spec:
- name: command
default: apply
- name: deploy-name
default: ""
- name: deploy-version
default: ""
workspaces:
- name: source
mountpath: /source

View File

@@ -27,8 +27,8 @@ spec:
spec:
serviceAccountName: service-acc
pipelineRef:
name: stage-application-pipeline
Timeout: "2h30m00s"
name: infra-pipeline
Timeout: "30m00s"
workspaces:
- name: workspace
persistentVolumeClaim:
@@ -42,7 +42,5 @@ spec:
value: $(params.gitreponame)
- name: revision
value: $(params.gitrevision)
- name: sha
value: $(params.sha)
- name: git-repo-full-name
value: $(params.gitrepofullname)

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: example-service
namespace: default
spec:
ports:
- name: test
protocol: TCP
port: 666
targetPort: 666