webhooks via webgui config, want dees is veel te ingewikkeld via yamls

This commit is contained in:
2020-03-05 14:15:31 +01:00
parent c6cdfba1be
commit 28f5fcb9e1
22 changed files with 360 additions and 429 deletions

View File

@@ -3,22 +3,20 @@ apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: build-and-push
namespace: tekton-pipeline-istio-project-1
spec:
inputs:
resources:
- name: git-source
type: git
params:
- name: pathToContext
- name: context
description: The path to the build context, used by Kaniko - within the workspace
default: .
- name: pathToDockerfile
description: The path to the dockerfile to build
default: Dockerfile
- name: imageUrl
description: value should be like - us.icr.io/test_namespace/builtImageApp
- name: imageTag
description: Tag to apply to the built image
- name: image-name
description: dockerhub url
- name: version
description: image-version (for instance latest or beta)
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor
@@ -28,6 +26,6 @@ spec:
command:
- /kaniko/executor
args:
- "--dockerfile=dockerfile"
- "--destination=beppev/$(inputs.params.imageUrl):$(inputs.params.imageTag)"
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/"
- "--dockerfile=$(inputs.resources.git-source.path)/$(inputs.params.context)/dockerfile"
- "--destination=beppev/$(inputs.params.image-name):$(inputs.params.version)"
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.context)/"

View File

@@ -3,51 +3,24 @@ apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: deploy-application
namespace: tekton-pipeline-istio-project-1
spec:
inputs:
resources:
- name: git-source
type: git
params:
- name: pathToContext
description: The path to the build context, used by Kaniko - within the workspace
default: .
- name: pathToYamlFile
description: The path to the yaml file to deploy within the git source
default: deploy.yaml
- name: imageUrl-a
description: Url of image repository
default: url
- name: imageTag-a
description: Tag of the images to be used.
default: "latest"
- name: imageUrl-b
description: Url of image repository
default: url
- name: imageTag-b
description: Tag of the images to be used.
default: "latest"
steps:
- name: replace-imagea
image: alpine
command: ["sed"]
- name: delete-old-deployment
image: lachlanevenson/k8s-kubectl
command: ["kubectl"]
args:
- "-i"
- "-e"
- "s;IMAGE-A;$(inputs.params.imageUrl-a):$(inputs.params.imageTag-a);g"
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)"
- name: replace-imageb
image: alpine
command: ["sed"]
args:
- "-i"
- "-e"
- "s;IMAGE-b;$(inputs.params.imageUrl-b):$(inputs.params.imageTag-b);g"
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)"
- name: deploy-app
- "delete"
- "-f"
- "$(inputs.resources.git-source.path)/deploy.yaml"
- name: deploy-new-app
image: lachlanevenson/k8s-kubectl
command: ["kubectl"]
args:
- "apply"
- "-f"
- "$(inputs.resources.git-source.path)/deploy.yaml"
- "$(inputs.resources.git-source.path)/deploy.yaml"

View File

@@ -1,20 +0,0 @@
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: test-run
spec:
serviceAccountName: tutorial-service
taskRef:
name: build-and-push
inputs:
resources:
- name: git-source
resourceRef:
name: git
params:
- name: pathToContext
value: /serverA/ #configure: may change according to your source
- name: imageUrl
value: "server-a"
- name: imageTag
value: "latest"