Skip to content

Commit

Permalink
Add build flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asgeir Nilsen committed Mar 10, 2020
1 parent c73d95c commit 8116479
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM gradle:4.10.3-jdk8-alpine as builder
USER root
COPY . .
RUN gradle --no-daemon -Peventhub build
ARG buildFlags=""
RUN gradle --no-daemon ${buildFlags} build

FROM gcr.io/distroless/java
FROM gcr.io/distroless/java:8
ENV JAVA_TOOL_OPTIONS -XX:+ExitOnOutOfMemoryError
COPY --from=builder /home/gradle/build/deps/external/*.jar /data/
COPY --from=builder /home/gradle/build/deps/fint/*.jar /data/
Expand Down
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
pipeline {
parameters {
string(name: 'BUILD_FLAGS', defaultValue: '', description: 'Gradle build flags')
}
agent { label 'docker' }
stages {
stage('Build') {
steps {
sh 'git clean -fdx'
sh "docker build -t ${GIT_COMMIT} ."
sh "docker build --tag ${GIT_COMMIT} --build-arg buildFlags=${params.BUILD_FLAGS} ."
}
}
stage('Publish Latest') {
Expand Down

0 comments on commit 8116479

Please sign in to comment.