This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
deploy-task.yaml
56 lines (55 loc) · 1.66 KB
/
deploy-task.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#Kabanero! on activate substitute StackId for text 'StackId'
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: StackId-deploy-task
spec:
resources:
inputs:
- name: git-source
type: git
- name: docker-image
type: image
params:
- name: repository-name
default: StackId
- name: app-deploy-file-name
default: app-deploy.yaml
- name: docker-imagename
type: string
default: "null"
- name: docker-imagetag
type: string
default: "null"
steps:
- name: enforce-stack-policy-pre-deploy
securityContext:
privileged: true
image: kabanero/kabanero-utils:latest
command: ["/bin/bash"]
args:
- -c
- |
INPUTS_RESOURCE_DOCKER_IMAGE_URL_LOWERCASE=$( /scripts/imageurl_imagename_lowercase.sh -u "$(inputs.resources.docker-image.url)" -n "$(inputs.params.docker-imagename)" -t "$(inputs.params.docker-imagetag)" )
retVal=$?
if [ $retVal -ne 0 ]; then
echo "The script failed(/scripts/imageurl_imagename_lowercase.sh) Reason: $INPUTS_RESOURCE_DOCKER_IMAGE_URL_LOWERCASE" >&2
exit $retVal
fi
echo "INPUTS_RESOURCE_DOCKER_IMAGE_URL_LOWERCASE=$INPUTS_RESOURCE_DOCKER_IMAGE_URL_LOWERCASE"
/scripts/enforce_deploy_stack_policy.sh $INPUTS_RESOURCE_DOCKER_IMAGE_URL_LOWERCASE
env:
- name: gitsource
value: git-source
- name: deploy-image
image: kabanero/kabanero-utils:latest
command: ['/bin/sh']
args:
- -c
- |
kubectl apply -f /workspace/$gitsource/${YAMLFILE}
env:
- name: gitsource
value: git-source
- name: YAMLFILE
value: $(inputs.params.app-deploy-file-name)