mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 20:12:43 +00:00
help
This commit is contained in:
30
manifests/tasks/build-and-push.yaml
Normal file
30
manifests/tasks/build-and-push.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: build-and-push
|
||||
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: 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
|
||||
steps:
|
||||
- name: build-and-push
|
||||
image: gcr.io/kaniko-project/executor
|
||||
command:
|
||||
- /kaniko/executor
|
||||
args:
|
||||
- "--dockerfile=$(inputs.params.pathToContext)/dockerfile"
|
||||
- "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)"
|
||||
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/"
|
53
manifests/tasks/deploy-application.yaml
Normal file
53
manifests/tasks/deploy-application.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: deploy-application
|
||||
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"]
|
||||
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
|
||||
image: lachlanevenson/k8s-kubectl
|
||||
command: ["kubectl"]
|
||||
args:
|
||||
- "apply"
|
||||
- "-f"
|
||||
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)"
|
Reference in New Issue
Block a user