Sfoglia il codice sorgente

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>
Bulat Yusupov 4 anni fa
parent
commit
4190d76f2f
2 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 8 2
      Jenkinsfile
  2. 3 0
      docker-openjdk/Dockerfile

+ 8 - 2
Jenkinsfile

@@ -90,16 +90,19 @@ spec:
         stage('Build artifact') {
             steps {
                 container('docker-client') {
-                    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'"
+                    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'"
                 }
             }
         }
         stage('Build docker image') {
+            when {
+                expression { return env.GIT_BRANCH == 'origin/master'; }
+            }
             steps {
                 container('docker-client') {
                     dir(path: './kafka-ui-api') {
                         script {
-                            dockerImage = docker.build( registry + ":$VERSION", "--build-arg JAR_FILE=*.jar -f Dockerfile ." )
+                            dockerImage = docker.build( registry + ":$VERSION", "--build-arg JAR_FILE=kafka-ui-api-\'$VERSION\'.jar -f Dockerfile ." )
                         }
                     }
                 }
@@ -121,6 +124,9 @@ spec:
             }
         }
         stage('Remove unused docker image') {
+            when {
+                expression { return env.GIT_BRANCH == 'origin/master'; }
+            }
             steps{
                 container('docker-client') {
                     sh "docker rmi $registry:$VERSION"

+ 3 - 0
docker-openjdk/Dockerfile

@@ -0,0 +1,3 @@
+FROM openjdk:13
+RUN  yum install -y git && \
+     yum groupinstall -y "Development Tools"