-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenshift.yml
121 lines (100 loc) · 2.57 KB
/
openshift.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
apiVersion: v1
kind: Template
metadata:
name: "apicast-custom-policies"
message: "3scale GUID Policy"
objects:
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
labels:
app: apicast
name: apicast-new-policies
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
labels:
app: apicast
name: apicast-new-policy
spec:
output:
to:
kind: ImageStreamTag
name: 'apicast-new-policies:${NEW_POLICY_RELEASE}'
source:
git:
uri: ${GIT_REPO}
ref: 'master'
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: 'amp-apicast-custom:${CUSTOM_IS_TAG}'
namespace: ${APICAST_CUSTOM_NAMESPACE}
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
labels:
app: apicast
name: apicast-custom
spec:
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'amp-apicast:${AMP_RELEASE}'
postCommit:
args:
- '--test'
- '--lazy'
command:
- bin/apicast
resources: {}
runPolicy: Serial
source:
images:
- from:
kind: ImageStreamTag
name: 'apicast-new-policies:${NEW_POLICY_RELEASE}'
paths:
# copy policy source code into the new image
- destinationDir: policies
sourcePath: /opt/app-root/policies/ngx-example
# copy also installed dependencies to the policy folder, so they are vendored
# - destinationDir: policies/example/0.1/resty/
# sourcePath: /opt/app-root/src/lua_modules/share/lua/5.1/resty/iputils.lua
type: Dockerfile
dockerfile: |
FROM scratch
COPY . src
USER root
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: 'amp-apicast-custom:${CUSTOM_IS_TAG}'
namespace: ${APICAST_CUSTOM_NAMESPACE}
type: Docker
# triggers:
# - type: ConfigChange
# - type: ImageChange
parameters:
- name: AMP_RELEASE
description: The destination tag of your AMP release (eg. 2.8)
value: '2.10'
- name: CUSTOM_IS_TAG
description: The version of the custom apicast imagestream pulled from the registry
value: '3scale2.10.0'
- name: NEW_POLICY_RELEASE
description: The version of the policies
value: '0.1.0'
- name: GIT_REPO
description: GIT REPO
value: 'https://github.com/3scale-demos/custom-policy-demo'
- name: APICAST_CUSTOM_NAMESPACE
description: 'where to find the custom policies'
value: 3scale