Push docker images to a registry 87/58387/1
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>
Wed, 6 Jun 2018 11:18:05 +0000 (13:18 +0200)
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>
Wed, 1 Aug 2018 09:20:58 +0000 (11:20 +0200)
Change-Id: Ife1d98af977a439ef7196caa2cf8fb0968e65fe3
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Issue-ID: DCAEGEN2-601

.gitlab-ci.yml
hv-collector-analysis/pom.xml
pom.xml

index c1e5554..54bbacf 100644 (file)
@@ -2,6 +2,8 @@ image: archive.docker-registry.eecloud.nsn-net.net/imp/matryoshka:latest
 
 stages:
   - build
+  - publish
+  - trigger-integration-tests
 
 build:
   stage: build
@@ -9,8 +11,16 @@ build:
     - mvn -e -T2 -Panalysis clean install
   artifacts:
     paths:
-    - hv-collector-coverage/target/site/jacoco-aggregate
-    - hv-collector-core/target/reports
-    - hv-collector-main/target/reports
-    - hv-collector-utils/target/reports
+      - hv-collector-coverage/target/site/jacoco-aggregate
+      - hv-collector-core/target/reports
+      - hv-collector-main/target/reports
+      - hv-collector-utils/target/reports
     
+publish:
+  stage: publish
+  only:
+    - master
+  script:
+    - docker login $DOCKER_REPO_ADDR -u $DOCKER_REPO_USER -p $DOCKER_REPO_PASS
+    - mvn -e -DskipTests -DskipAnalysis -Ddocker.registry="$DOCKER_REPO_ADDR" deploy
+    - "curl -X POST -F token=$INTEGRATION_TESTS_TRIGGER_TOKEN -F ref=master https://gitlabe1.ext.net.nokia.com/api/v4/projects/33403/trigger/pipeline"
index 19955de..9950ec1 100644 (file)
   <version>1.0.0-SNAPSHOT</version>
   <description>VES HighVolume Collector :: Code analysis configuration</description>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 
 </project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2fc094e..17a86b4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                         <encoding>UTF-8</encoding>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <configuration>
+                        <skip>true</skip>
+                    </configuration>
+                </plugin>
                 <plugin>
                     <artifactId>kotlin-maven-plugin</artifactId>
                     <groupId>org.jetbrains.kotlin</groupId>
                                         <goal>build</goal>
                                     </goals>
                                 </execution>
+                                <execution>
+                                    <id>push-docker-image</id>
+                                    <phase>deploy</phase>
+                                    <goals>
+                                        <goal>push</goal>
+                                    </goals>
+                                </execution>
                             </executions>
                             <configuration>
                                 <verbose>true</verbose>
                                         <name>${docker-image.namespace}/${docker-image.name}</name>
                                         <build>
                                             <dockerFileDir>${project.basedir}</dockerFileDir>
-                                            <tags>
-                                                <tag>${project.version}</tag>
-                                            </tags>
                                         </build>
                                     </image>
                                 </images>