Skip to content

Commit 4190d76

Browse files
usbulatBulat Yusupov
andauthored
Fix build (#91)
* changed mvn to mvnw * fixing build added Dockerfile for openjdk * fixing build added Dockerfile for openjdk * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * changed step in Jenkinsfile * changed step in Jenkinsfile * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit * test commit Co-authored-by: Bulat Yusupov <byusupov@provectus.com>
1 parent 8494e91 commit 4190d76

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Jenkinsfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,19 @@ spec:
9090
stage('Build artifact') {
9191
steps {
9292
container('docker-client') {
93-
sh "docker run -v $WORKSPACE:/usr/src/mymaven -v /tmp/repository:/root/.m2/repository -w /usr/src/mymaven maven:3.6.3-jdk-13 bash -c 'mvn clean package -Pprod'"
93+
sh "docker run -v /var/run/docker.sock:/var/run/docker.sock -v $WORKSPACE:/usr/src/mymaven -v /tmp/repository:/root/.m2/repository -w /usr/src/mymaven provectuslabs/openjdk:13 bash -c 'chown -R \$(whoami):\$(whoami) kafka-ui-react-app && ./mvnw clean package -Pprod'"
9494
}
9595
}
9696
}
9797
stage('Build docker image') {
98+
when {
99+
expression { return env.GIT_BRANCH == 'origin/master'; }
100+
}
98101
steps {
99102
container('docker-client') {
100103
dir(path: './kafka-ui-api') {
101104
script {
102-
dockerImage = docker.build( registry + ":$VERSION", "--build-arg JAR_FILE=*.jar -f Dockerfile ." )
105+
dockerImage = docker.build( registry + ":$VERSION", "--build-arg JAR_FILE=kafka-ui-api-\'$VERSION\'.jar -f Dockerfile ." )
103106
}
104107
}
105108
}
@@ -121,6 +124,9 @@ spec:
121124
}
122125
}
123126
stage('Remove unused docker image') {
127+
when {
128+
expression { return env.GIT_BRANCH == 'origin/master'; }
129+
}
124130
steps{
125131
container('docker-client') {
126132
sh "docker rmi $registry:$VERSION"

docker-openjdk/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM openjdk:13
2+
RUN yum install -y git && \
3+
yum groupinstall -y "Development Tools"

0 commit comments

Comments
 (0)