mirror of
https://github.com/bvanroll/stage-infra.git
synced 2025-12-12 11:36:10 +00:00
mmmmmmmmmmmmm, denk dak het heb deze keer
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: stage-application-pipeline
|
||||
name: application-pipeline
|
||||
namespace: tekton-pipeline-1
|
||||
spec:
|
||||
params:
|
||||
- name: git-repo-full-name
|
||||
description: full name of the github repo (used for status updates)
|
||||
- name: git-repo-name
|
||||
description: name of the git repo (used to determine the name of the image)
|
||||
- name: git-url
|
||||
@@ -15,12 +13,16 @@ spec:
|
||||
- name: revision
|
||||
description: revision to checkout
|
||||
- name: branch
|
||||
description: name of the branch to checkout
|
||||
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
|
||||
taskRef:
|
||||
taskRef:
|
||||
name: git-clone
|
||||
workspaces:
|
||||
- name: output
|
||||
@@ -31,8 +33,7 @@ spec:
|
||||
- name: revision
|
||||
value: $(params.revision)
|
||||
|
||||
|
||||
- name: set-begun-status
|
||||
- name: set-status-build-and-push
|
||||
taskRef:
|
||||
name: github-set-status
|
||||
runAfter:
|
||||
@@ -42,50 +43,67 @@ spec:
|
||||
value: $(params.git-repo-full-name)
|
||||
- name: SHA
|
||||
value: $(params.revision)
|
||||
- name: TARGET_URL
|
||||
value: tekton.llocal.host/dashboard
|
||||
- name: STATE
|
||||
value: pending
|
||||
- name: TARGET_URL
|
||||
value: http://tekton.llocal.host/dashboard
|
||||
- name: DESCRIPTION
|
||||
value: "Build of maven file has started"
|
||||
value: "Build and push has started"
|
||||
|
||||
- name: build-and-push-maven
|
||||
- name: build-and-push
|
||||
taskRef:
|
||||
name: build-maven
|
||||
name: build-and-push
|
||||
runAfter:
|
||||
- clone
|
||||
params:
|
||||
- name: image-name
|
||||
value: $(params.git-repo-name)
|
||||
- name: image-tag
|
||||
value: $(params.branch)
|
||||
Timeout: "1h30m00s"
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: workspace
|
||||
params:
|
||||
- name: context
|
||||
value: "src"
|
||||
- name: image-name
|
||||
value: "$(params.git-repo-name)"
|
||||
- name: version
|
||||
value: "$(params.branch)"
|
||||
|
||||
- name: set-build-finshed-status
|
||||
- name: set-status-deploy
|
||||
taskRef:
|
||||
name: github-set-status
|
||||
runAfter:
|
||||
- build-and-push-maven
|
||||
- build-and-push
|
||||
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
|
||||
value: $(tasks.build-and-push.results.state)
|
||||
- name: TARGET_URL
|
||||
value: http://ingress.llocal.host/$(params.git-repo-name)
|
||||
- name: DESCRIPTION
|
||||
value: "build and push has finished, now starting deployment"
|
||||
|
||||
value: $(tasks.build-and-push.results.description)
|
||||
|
||||
- name: deploy-app
|
||||
taskRef:
|
||||
name: deploy-app
|
||||
name: deploy-yaml-file
|
||||
runAfter:
|
||||
- build-and-push-maven
|
||||
- build-and-push
|
||||
conditions:
|
||||
- conditionRef: is-not-equal
|
||||
params:
|
||||
- name: left
|
||||
value: "error"
|
||||
- name: right
|
||||
value: "$(tasks.build-and-push.results.state)"
|
||||
|
||||
- conditionRef: is-not-equal
|
||||
params:
|
||||
- name: left
|
||||
value: "failure"
|
||||
- name: right
|
||||
value: "$(tasks.build-and-push.results.state)"
|
||||
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: workspace
|
||||
@@ -94,8 +112,9 @@ spec:
|
||||
value: "$(params.git-repo-name)"
|
||||
- name: deploy-version
|
||||
value: "$(params.branch)"
|
||||
|
||||
|
||||
- name: set-deploy-finished-status
|
||||
- name: set-status-finished
|
||||
taskRef:
|
||||
name: github-set-status
|
||||
runAfter:
|
||||
@@ -105,9 +124,9 @@ spec:
|
||||
value: $(params.git-repo-full-name)
|
||||
- name: SHA
|
||||
value: $(params.revision)
|
||||
- name: TARGET_URL
|
||||
value: tekton.llocal.host/dashboard
|
||||
- name: STATE
|
||||
value: success
|
||||
value: $(tasks.deploy-app.results.state)
|
||||
- name: TARGET_URL
|
||||
value: http://tekton.llocal.host/$(params.git-repo-name)
|
||||
- name: DESCRIPTION
|
||||
value: "deploy finished"
|
||||
value: "$(tasks.deploy-app.results.description)"
|
||||
@@ -2,7 +2,7 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: infra-pipeline
|
||||
name: infrastructure-pipeline
|
||||
namespace: tekton-pipeline-1
|
||||
spec:
|
||||
params:
|
||||
@@ -51,7 +51,7 @@ spec:
|
||||
|
||||
- name: deploy-infrastructure
|
||||
taskRef:
|
||||
name: deploy-app
|
||||
name: deploy-to-cluster
|
||||
runAfter:
|
||||
- clone-git-repo
|
||||
workspaces:
|
||||
@@ -61,7 +61,7 @@ spec:
|
||||
- name: yaml-location
|
||||
value: infra/
|
||||
conditions:
|
||||
- conditionRef: "is-not-equal"
|
||||
- conditionRef: "is-equal"
|
||||
params:
|
||||
- name: "left"
|
||||
value: "master"
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: stage-application-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 checkout
|
||||
- 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)
|
||||
- name: sha
|
||||
description: used for github status updates
|
||||
workspaces:
|
||||
- name: workspace
|
||||
tasks:
|
||||
|
||||
- name: clone
|
||||
taskRef:
|
||||
name: git-clone
|
||||
workspaces:
|
||||
- name: output
|
||||
workspace: workspace
|
||||
params:
|
||||
- name: url
|
||||
value: $(params.git-url)
|
||||
- name: revision
|
||||
value: $(params.revision)
|
||||
|
||||
# - name: set-status-building
|
||||
# taskRef:
|
||||
# name: github-set-status
|
||||
# runAfter:
|
||||
# - clone
|
||||
# params:
|
||||
# - name: REPO_FULL_NAME
|
||||
# value: $(params.git-repo-full-name)
|
||||
# - name: SHA
|
||||
# value: $(params.sha)
|
||||
# - name: STATE
|
||||
# value: pending
|
||||
# - name: TARGET_URL
|
||||
# value: http://ingress.llocal.host/$(params.git-repo-name)
|
||||
# - name: DESCRIPTION
|
||||
# value: "Build and push has started"
|
||||
|
||||
- name: build-and-push
|
||||
taskRef:
|
||||
name: build-and-push
|
||||
conditions:
|
||||
- conditionRef: "is-not-equal"
|
||||
params:
|
||||
- name: "left"
|
||||
value: "stage-infra"
|
||||
- name: "right"
|
||||
value: "$(params.git-repo-name)"
|
||||
runAfter:
|
||||
- clone
|
||||
Timeout: "1h30m00s"
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: workspace
|
||||
params:
|
||||
- name: context
|
||||
value: "src"
|
||||
- name: image-name
|
||||
value: "$(params.git-repo-name)"
|
||||
- name: version
|
||||
value: "$(params.branch)"
|
||||
|
||||
# - name: set-status-building
|
||||
# taskRef:
|
||||
# name: github-set-status
|
||||
# runAfter:
|
||||
# - build-and-push
|
||||
# params:
|
||||
# - name: REPO_FULL_NAME
|
||||
# value: $(params.git-repo-full-name)
|
||||
# - name: SHA
|
||||
# value: $(params.sha)
|
||||
# - name: STATE
|
||||
# value: pending
|
||||
# - name: TARGET_URL
|
||||
# value: http://ingress.llocal.host/$(params.git-repo-name)
|
||||
# - name: DESCRIPTION
|
||||
# value: "Build and push has completed, starting deploy-app"
|
||||
|
||||
- name: deploy-app
|
||||
taskRef:
|
||||
name: deploy-app
|
||||
runAfter:
|
||||
- build-and-push
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: workspace
|
||||
params:
|
||||
- name: deploy-name
|
||||
value: "$(params.git-repo-name)"
|
||||
- name: deploy-version
|
||||
value: "$(params.branch)"
|
||||
|
||||
|
||||
- name: set-status-building
|
||||
taskRef:
|
||||
name: github-set-status
|
||||
runAfter:
|
||||
- deploy-app
|
||||
params:
|
||||
- name: REPO_FULL_NAME
|
||||
value: $(params.git-repo-full-name)
|
||||
- name: SHA
|
||||
value: $(params.sha)
|
||||
- name: STATE
|
||||
value: success
|
||||
- name: TARGET_URL
|
||||
value: http://tekton.llocal.host/$(params.git-repo-name)
|
||||
- name: DESCRIPTION
|
||||
value: "Deploy finished"
|
||||
Reference in New Issue
Block a user