forked from appsody/tekton-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappsody-build-task.yaml
64 lines (64 loc) · 1.9 KB
/
appsody-build-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
57
58
59
60
61
62
63
64
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: appsody-build-task
spec:
inputs:
resources:
- name: appsody-source
type: git
params:
- name: pathToDockerFile
default: /workspace/extracted/Dockerfile
- name: pathToContext
default: /workspace/extracted
- name: appsody-deploy-file-name
outputs:
resources:
- name: docker-image
type: image
steps:
- name: assemble-extract-step
image: appsody/appsody-docker
command: ["/bin/bash"]
args:
- -c
- "/setupAndRunExtract.sh"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: build-push-step
image: gcr.io/kaniko-project/executor
command:
- /kaniko/executor
args:
- --dockerfile=${inputs.params.pathToDockerFile}
- --destination=${outputs.resources.docker-image.url}
- --context=${inputs.params.pathToContext}
- name: modify-yaml
image: ubuntu
command: ['/bin/bash']
args: ['-c', 'find /workspace/appsody-source -name ${YAMLFILE} -type f -exec sed -i -e s!"image: .*$"!"image: ${IMG}"!g {} \;']
env:
- name: IMG
value: ${outputs.resources.docker-image.url}
- name: YAMLFILE
value: ${inputs.params.appsody-deploy-file-name}
- name: install-knative
image: lachlanevenson/k8s-kubectl
command: ['/bin/sh']
args: ['-c', 'find /workspace/appsody-source -name ${YAMLFILE} -type f|xargs kubectl apply -f']
env:
- name: YAMLFILE
value: ${inputs.params.appsody-deploy-file-name}
# - name: install-helm
# image: ibmcom/microclimate-k8s-helm:v2.9.1
# command: ['helm']
# args:
# - 'install'
# - '/workspace/extracted/config/chart'
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
type: Socket