-
Notifications
You must be signed in to change notification settings - Fork 0
/
wildfly-s2i-build-pipeline.yaml
108 lines (108 loc) · 2.92 KB
/
wildfly-s2i-build-pipeline.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: wildfly-s2i-build-pipeline
spec:
params:
- name: gitUrl
- name: revision
default: ""
- name: contextDir
default: ""
- name: outputImage
- name: deploy
default: "false"
- name: deployment-name
default: "deployed-app"
- name: MAVEN_ARGS_APPEND
default: ""
- name: MAVEN_OPTS
default: ""
- name: ARTIFACT_DIR
default: ""
- name: GALLEON_PROVISION_LAYERS
default: ""
- name: GALLEON_PROVISION_FEATURE_PACKS
default: ""
- name: kanikoExtraArgs
type: array
default: []
workspaces:
- name: shared-data
- name: maven-cache
tasks:
- name: git-clone-repo
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-data
params:
- name: url
value: "$(params.gitUrl)"
- name: revision
value: "$(params.revision)"
- name: deleteExisting
value: "true"
- name: depth
value: "1"
- name: wildfly-s2i-build
taskRef:
name: wildfly-s2i-build-task
params:
- name: contextDir
value: "$(params.contextDir)"
- name: MAVEN_ARGS_APPEND
value: "$(params.MAVEN_ARGS_APPEND)"
- name: MAVEN_OPTS
value: "$(params.MAVEN_OPTS)"
- name: _ARTIFACT_DIR
value: "$(params.ARTIFACT_DIR)"
- name: GALLEON_PROVISION_LAYERS
value: "$(params.GALLEON_PROVISION_LAYERS)"
- name: GALLEON_PROVISION_FEATURE_PACKS
value: "$(params.GALLEON_PROVISION_FEATURE_PACKS)"
runAfter:
- git-clone-repo
workspaces:
- name: sources
workspace: shared-data
- name: maven-cache
workspace: maven-cache
- name: kaniko-build-push
taskRef:
name: kaniko
params:
- name: IMAGE
value: "$(params.outputImage)"
- name: DOCKERFILE
value: "$(tasks.wildfly-s2i-build.results.dockerFile)"
- name: CONTEXT
value: "$(tasks.wildfly-s2i-build.results.dockerBuildContext)"
- name: EXTRA_ARGS
value: ["$(params.kanikoExtraArgs)"]
runAfter:
- wildfly-s2i-build
workspaces:
- name: source
workspace: shared-data
- name: start-deployment
runAfter:
- kaniko-build-push
when:
- input: "$(params.deploy)"
operator: in
values: ["true"]
taskRef:
name: kubernetes-actions
params:
- name: script
value: |
kubectl create deployment $1 --image=$2
kubectl expose deployment $1 --type=LoadBalancer --port=8080
kubectl scale deployment $1 --replicas=0
kubectl scale deployment $1 --replicas=1
- name: args
value:
- $(params.deployment-name)
- $(params.outputImage)