-
Notifications
You must be signed in to change notification settings - Fork 5
/
template.yml
183 lines (173 loc) · 4.35 KB
/
template.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
apiVersion: v1
kind: Template
metadata:
name: scala-sbt
annotations:
displayName: Scala SBT
description: SBT with multi-project support
iconClass: "icon-scala"
tags: "scala,sbt"
parameters:
- name: NAME
displayName: Name
description: The name applied to objects created by this template.
required: true
- name: SBT_VERSION
displayName: SBT Version
description: Version of SBT to use (eg. 0.13.16).
value: 0.13.16
required: true
- name: SCALA_VERSION
displayName: Scala Version
description: Version of Scala to use (eg. 2.12.5).
value: 2.12.5
required: true
- name: SOURCE_REPOSITORY_URL
displayName: Git Repository URL
description: The URL of the repository with your application source code.
required: true
- name: SOURCE_REPOSITORY_REF
displayName: Git Reference
description: Repository ref name.
value: master
required: true
- name: SUBPROJECT
displayName: Subproject
description: Name of subdirectory in multi-project SBT builds.
required: false
objects:
- kind: BuildConfig
apiVersion: v1
metadata:
name: ${NAME}
annotations:
iconClass: "icon-scala"
spec:
resources:
limits:
cpu: "1"
memory: "1Gi"
source:
type: Git
git:
uri: "${SOURCE_REPOSITORY_URL}"
ref: "${SOURCE_REPOSITORY_REF}"
contextDir: ""
strategy:
type: Source
sourceStrategy:
from:
kind: DockerImage
name: jwiii/sbt-s2i:${SBT_VERSION}-${SCALA_VERSION}
env:
- name: SBT_SUBPROJECT
value: ${SUBPROJECT}
output:
to:
kind: ImageStreamTag
name: "${NAME}:latest"
triggers:
- type: ConfigChange
- kind: ImageStream
apiVersion: v1
metadata:
name: "${NAME}"
- apiVersion: v1
kind: Service
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
ports:
- name: 9000-tcp
port: 9000
protocol: TCP
targetPort: 9000
selector:
app: ${NAME}
deploymentconfig: ${NAME}
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: 1
selector:
app: ${NAME}
deploymentconfig: ${NAME}
strategy:
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: ${NAME}
deploymentconfig: ${NAME}
spec:
containers:
- env:
- name: SBT_SUBPROJECT
value: ${SUBPROJECT}
image: ""
imagePullPolicy: Always
name: ${NAME}
ports:
- containerPort: 9000
protocol: TCP
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- ${NAME}
from:
kind: ImageStreamTag
name: ${NAME}:latest
type: ImageChange
- apiVersion: v1
kind: ImageStream
metadata:
name: sbt-s2i
annotations:
iconClass: icon-scala
spec:
lookupPolicy:
local: false
tags:
- annotations:
description: Build and run Scala and Java applications using SBT
iconClass: icon-scala
openshift.io/display-name: SBT
openshift.io/provider-display-name: https://github.com/jw3/sbt-s2i
sampleRepo: https://github.com/theiterators/akka-http-microservice
supports: sbt,java,scala
tags: builder,java,scala
version: ${SBT_VERSION}-${SCALA_VERSION}
from:
kind: DockerImage
name: jwiii/sbt-s2i:${SBT_VERSION}-${SCALA_VERSION}
generation: 1
importPolicy: {}
name: ${SBT_VERSION}-${SCALA_VERSION}
referencePolicy:
type: Source