-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheap-s2i-build.yaml
172 lines (172 loc) · 5.74 KB
/
eap-s2i-build.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
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
apiVersion: v1
kind: Template
labels:
template: eap-s2i-build
xpaas: "1.0"
app.kubernetes.io/name: ${APPLICATION_IMAGE}
message: A new ImageStream for your JBoss EAP based application has been created in your project.
metadata:
annotations:
description: This template builds an application image based on JBoss EAP from a Git repository using S2I.
iconClass: icon-eap
openshift.io/display-name: Template to build JBoss EAP application using S2I
openshift.io/provider-display-name: Red Hat
tags: eap,javaee,java,jboss
template.openshift.io/documentation-url: https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/
template.openshift.io/long-description: This template builds an image based on JBoss EAP using S2I.
template.openshift.io/support-url: https://access.redhat.com
name: eap-s2i-build
objects:
- apiVersion: v1
kind: ImageStream
metadata:
name: ${APPLICATION_IMAGE}
spec:
lookupPolicy:
local: true
- apiVersion: v1
kind: ImageStream
metadata:
name: ${APPLICATION_IMAGE}-build-artifacts
- apiVersion: v1
kind: BuildConfig
metadata:
name: ${APPLICATION_IMAGE}-build-artifacts
annotations:
"template.alpha.openshift.io/wait-for-ready": "true"
spec:
output:
to:
kind: ImageStreamTag
name: ${APPLICATION_IMAGE}-build-artifacts:latest
source:
contextDir: ${CONTEXT_DIR}
git:
ref: ${SOURCE_REPOSITORY_REF}
uri: ${SOURCE_REPOSITORY_URL}
type: Git
strategy:
sourceStrategy:
env:
- name: MAVEN_MIRROR_URL
value: ${MAVEN_MIRROR_URL}
- name: MAVEN_ARGS_APPEND
value: ${MAVEN_ARGS_APPEND}
- name: GALLEON_PROVISION_LAYERS
value: ${GALLEON_PROVISION_LAYERS}
- name: GALLEON_PROVISION_DEFAULT_FAT_SERVER
value: "true"
- name: ARTIFACT_DIR
value: ${ARTIFACT_DIR}
forcePull: true
from:
kind: ImageStreamTag
name: ${EAP_IMAGE}
namespace: ${EAP_IMAGESTREAM_NAMESPACE}
incremental: true
type: Source
triggers:
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
- generic:
secret: ${GENERIC_WEBHOOK_SECRET}
type: Generic
- imageChange: {}
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: BuildConfig
metadata:
name: ${APPLICATION_IMAGE}
spec:
output:
to:
kind: ImageStreamTag
name: ${APPLICATION_IMAGE}:latest
source:
dockerfile: |-
FROM ${EAP_RUNTIME_IMAGE}
COPY /server $JBOSS_HOME
USER root
RUN chown -R jboss:root $JBOSS_HOME && chmod -R ug+rwX $JBOSS_HOME
USER jboss
CMD $JBOSS_HOME/bin/openshift-launch.sh
images:
- from:
kind: ImageStreamTag
name: ${APPLICATION_IMAGE}-build-artifacts:latest
paths:
- destinationDir: .
sourcePath: /s2i-output/server/
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: ${EAP_RUNTIME_IMAGE}
namespace: ${EAP_IMAGESTREAM_NAMESPACE}
imageOptimizationPolicy: SkipLayers
type: Docker
triggers:
- imageChange:
from:
kind: ImageStreamTag
name: ${APPLICATION_IMAGE}-build-artifacts:latest
type: ImageChange
- type: ConfigChange
parameters:
- name: APPLICATION_IMAGE
displayName: Application Image Stream
description: The name for the application ImageStream. The application image will be tagged with the 'latest' tag.
required: true
- name: EAP_IMAGE
displayName: ImageStream Tag for EAP XP Image
description: 'Imagestream tag for EAP Builder Image, for example: jboss-eap-xp1-openjdk11-openshift:1.0'
required: true
- name: EAP_RUNTIME_IMAGE
displayName: ImageStream Tag for EAP XP Runtime Image
description: 'Imagestream tag for EAP Runtime Image, for example: jboss-eap-xp1-openjdk11-runtime-openshift:1.0'
required: true
- name: EAP_IMAGESTREAM_NAMESPACE
displayName: Namespace of the EAP ImageStreams
description: >-
Namespace in which the ImageStreams for Red Hat Middleware images are
installed. These ImageStreams are normally installed in the openshift namespace.
You should only need to modify this if you've installed the ImageStreams in a
different namespace/project.
required: true
value: openshift
- name: SOURCE_REPOSITORY_URL
displayName: Git Repository URL
description: Git source URI for application
required: true
- name: SOURCE_REPOSITORY_REF
displayName: Git Reference
description: Git branch/tag reference
- name: CONTEXT_DIR
displayName: Source Context Directory
description: Path within the Git repository that contains the application to build; empty for root project directory.
- name: GITHUB_WEBHOOK_SECRET
displayName: Github Webhook Secret
description: GitHub Webhook secret to trigger new builds when changes are pushed to the Git repository.
generate: expression
from: '[\w]{8}'
- name: GENERIC_WEBHOOK_SECRET
displayName: Generic Webhook Secret
description: Generic Webhook secret to trigger new builds.
generate: expression
from: '[\w]{8}'
- name: GALLEON_PROVISION_LAYERS
displayName: Galleon layers
description: Comma separated list of Galleon layers to provision a server.
- name: MAVEN_MIRROR_URL
displayName: Maven mirror URL
description: Maven mirror to use for S2I builds
- name: MAVEN_ARGS_APPEND
displayName: Maven Additional Arguments
description: Maven additional arguments to use for S2I builds
value: -Dcom.redhat.xpaas.repo.jbossorg
- name: ARTIFACT_DIR
description: >-
List of directories from which archives will be copied into the deployment
folder. If unspecified, all archives in /target will be copied.