-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease.yml
136 lines (127 loc) · 3.26 KB
/
release.yml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
apiVersion: v1
kind: Namespace
metadata:
name: cf-system
labels:
istio-injection: enabled
---
apiVersion: v1
kind: Namespace
metadata:
name: cf-default
labels:
istio-injection: enabled
cf: enabled
---
apiVersion: build.knative.dev/v1alpha1
kind: BuildTemplate
metadata:
name: buildpack-bits
namespace: cf-system
spec:
parameters:
- name: IMAGE
description: The name of the image to push
- name: BUILDPACK_ORDER
description: A comma separated list of names or URLs for the buildpacks to use. Each buildpack is applied in order.
default: ""
- name: SKIP_DETECT
description: By default, the first buildpack to match is used. If true, detection is skipped and each buildpack contributes in order.
default: "false"
- name: DIRECTORY
description: The directory containing the app
default: ""
- name: CACHE
description: The name of the persistent app cache volume
default: app-cache
## TODO - This should go into "source" ideally
- name: URL
description: URL where the app bits are located
steps:
## TODO - This should go into "source" ideally
# In: a CF app in $DIRECTORY
# Out: a CF app droplet in /out
# Out: a build cache in /cache
- name: download
image: jszroberto/knative:download
args: ["bash", "-c", "wget -O archive.zip ${URL} && unzip -o -j archive.zip -d /out/"]
volumeMounts:
- name: bits
mountPath: /out
# In: a CF app in $DIRECTORY
# Out: a CF app droplet in /out
# Out: a build cache in /cache
- name: build
image: packs/cf:build
args: ["-skipDetect=${SKIP_DETECT}", "-buildpackOrder=${BUILDPACK_ORDER}"]
workingdir: "/bits${DIRECTORY}"
volumeMounts:
- name: bits
mountPath: /bits
- name: droplet
mountPath: /out
- name: "${CACHE}"
mountPath: /cache
# In: a CF app droplet in /in
# Out: an image published as $IMAGE
- name: export
image: packs/cf:export
workingdir: /in
args: ["${IMAGE}"]
volumeMounts:
- name: droplet
mountPath: /in
volumes:
- name: bits
emptyDir: {}
- name: droplet
emptyDir: {}
- name: app-cache
emptyDir: {}
---
apiVersion: build.knative.dev/v1alpha1
kind: BuildTemplate
metadata:
name: kaniko
namespace: cf-system
spec:
parameters:
- name: IMAGE
description: The name of the image to push
- name: DOCKERFILE
description: Path to the Dockerfile to build.
default: /workspace/Dockerfile
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor
args:
- --dockerfile=${DOCKERFILE}
- --destination=${IMAGE}
---
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: kleincf
namespace: cf-system
spec:
runLatest:
configuration:
revisionTemplate:
metadata:
labels:
knative.dev/type: app
spec:
container:
image: jszroberto/kleincf
env:
- name: NAMESPACE
value: cf-default
- name: REPOSITORY
value: jszroberto
- name: REGISTRY_CREDENTIALS
value: build-bot
- name: SERVICE_ADDRESS
value: http://kleincf.cf-system.knative.mybluemix-test.net
- name: DOMAIN
value: cf-default.knative.mybluemix-test.net