Created
August 3, 2020 17:18
-
-
Save arashkaffamanesh/901680cdfefc7c5bc4462b379126e7e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
description: Url of image repository | |
default: url | |
- name: imageTag | |
description: Tag of the images to be used. | |
default: "latest" | |
steps: | |
- name: update-yaml | |
image: alpine | |
command: ["sed"] | |
args: | |
- "-i" | |
- "-e" | |
- "s;IMAGE;$(inputs.params.imageUrl):$(inputs.params.imageTag);g" | |
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)" | |
- name: deploy-app | |
# image: lachlanevenson/k8s-kubectl | |
# image from kubernautslabs with helm push plugin | |
image: kubernautslabs/helm-kubectl | |
command: ["kubectl"] | |
args: | |
- "apply" | |
- "-f" | |
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)" | |
- name: push-to-chartmuseum | |
image: kubernautslabs/helm-kubectl | |
command: ["curl"] | |
args: | |
- "--data-binary" | |
- "@$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/hello-1.tgz" | |
- "http://chartmuseum-chartmuseum.chartmuseum.svc.cluster.local:8080/api/charts" | |
- name: helm-install-hello | |
image: kubernautslabs/helm-kubectl | |
command: ["sh"] | |
args: | |
- -c | |
- 'helm repo add chartmuseum http://chartmuseum-chartmuseum.chartmuseum.svc.cluster.local:8080 && helm repo update && helm upgrade --install hello chartmuseum/hello --version=1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment