-
Notifications
You must be signed in to change notification settings - Fork 0
/
graalvm-native-maven-template.yaml
223 lines (223 loc) · 5.8 KB
/
graalvm-native-maven-template.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
name: graalvm-native-maven-template
parameters:
- name: GIT_REPO
description: "The git repo to use"
- name: GIT_BRANCH
description: "The git repo branch to use"
- name: APP_NAME
descriptiom: "The app name used in build config and image stream names"
- name: REFLECTION_CONFIGURATION_RESOURCES
description: classpath location of resources for reflection configuration.
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
creationTimestamp: null
name: ${APP_NAME}-pipeline
spec:
nodeSelector: {}
output: {}
postCommit: {}
resources: {}
runPolicy: Serial
strategy:
jenkinsPipelineStrategy:
jenkinsfile: |-
pipeline {
agent {
node {
label 'maven'
}
}
stages {
stage('checkout'){
steps{
git url: '${GIT_REPO}', branch: '${GIT_BRANCH}'
}
}
stage('build') {
steps {
sh '''
mvn install:install-file -Dfile=${JAVA_HOME}/jre/lib/svm/builder/svm.jar -DgroupId=com.oracle.substratevm -DartifactId=svm -Dversion=GraalVM-1.0.0-rc5 -Dpackaging=jar
mvn clean package
'''
}
}
stage('build image') {
steps {
sh '''
oc start-build ${APP_NAME}-ubuntu --from-dir=. --follow
'''
}
}
stage('scratch image build') {
steps {
sh '''
oc start-build ${APP_NAME}-scratch --from-dir=. --follow
'''
}
}
}
}
triggers: []
status:
lastVersion: 0
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewBuild
creationTimestamp: null
labels:
build: ${APP_NAME}-scratch
name: ${APP_NAME}-scratch
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}-scratch:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
dockerfile: |-
FROM scratch
COPY /target/app /app
CMD ["/app"]
images:
- from:
kind: ImageStreamTag
name: ${APP_NAME}-ubuntu:latest
paths:
- destinationDir: .
sourcePath: /target
type: Git
strategy:
dockerStrategy:
noCache: true
from:
kind: DockerImage
name: scratch
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- github:
secret: 3ThIYgvq0CGJ3be_QgFY
type: GitHub
- generic:
secret: W_uXkLseAnD4Y5lgJ31G
type: Generic
- imageChange:
from:
kind: ImageStreamTag
name: ${APP_NAME}-ubuntu:latest
type: ImageChange
- type: ConfigChange
status:
lastVersion: 0
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewBuild
creationTimestamp: null
labels:
build: ${APP_NAME}-ubuntu
name: ${APP_NAME}-ubuntu
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}-ubuntu:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
dockerfile: |-
FROM petenorth/graal:1.0.0-rc5
RUN apt-get update && apt-get -y install gcc zlib1g-dev
COPY target /target/
WORKDIR /target
RUN native-image \
--no-server \
-H:+ReportUnsupportedElementsAtRuntime \
-H:ReflectionConfigurationResources=${REFLECTION_CONFIGURATION_RESOURCES} \
--static \
-jar $(ls *.jar)
RUN mv $(basename $(ls *.jar) .jar) app
type: Git
strategy:
dockerStrategy:
noCache: true
from:
kind: DockerImage
name: petenorth/graal:1.0.0-rc5
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- github:
secret: tTurd9WzEPp1AuXCADAp
type: GitHub
- generic:
secret: xv8jWihF9JNFWc5qj5Fk
type: Generic
- type: ConfigChange
status:
lastVersion: 0
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewBuild
openshift.io/image.dockerRepositoryCheck: 2018-08-19T09:30:21Z
creationTimestamp: null
generation: 2
labels:
build: ${APP_NAME}-scratch
name: ${APP_NAME}-scratch
spec:
lookupPolicy:
local: false
tags:
- annotations: null
from:
kind: DockerImage
name: 172.30.1.1:5000/myproject/${APP_NAME}-scratch:latest
generation: 2
importPolicy: {}
name: latest
referencePolicy:
type: Source
status:
dockerImageRepository: ""
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/image.dockerRepositoryCheck: 2018-08-19T09:30:28Z
creationTimestamp: null
generation: 2
name: ${APP_NAME}-ubuntu
spec:
lookupPolicy:
local: false
tags:
- annotations: null
from:
kind: DockerImage
name: 172.30.1.1:5000/myproject/${APP_NAME}-ubuntu:latest
generation: 2
importPolicy: {}
name: latest
referencePolicy:
type: Source
status:
dockerImageRepository: ""