I'm just learning and new to Gitlab, but already have some tasks important for my work. One of them is building java project (maven build stage) and copying artifacts to the docker image with Fabric8io plugin. I'm using Gitlb CI for my task, and what I already can do is successfully passing pipeline of maven stages (build, test, deploy at this moment) and building a docker image and pushing it to repo with Fabric8io maven plugin. But now this proceses are separate from each other. I've spent a few days searching for the solution to add maven artifacts to docker image, but with no success. Settings in pom.xml point to the gitlab repository files, but not artifacts in maven container (the example below is from my .pom file, fabric8io section, I just experimented with different values and variables with no success).
<file>
<source>${project.build.directory}/313test.war</source>
<source>target/313test.war</source>
<outputDirectory>./</outputDirectory>
<destName>testapp.war</destName>
</file>
Had anyone any experience with this stack? Is there any working solution? Thank You in advance.
Well, I suppose a got it. Using execution of commands in .gitlab-ci.yml works like I needed:
In addition, I commented some tags in pom.xml, so my build section now looks like this:
So, running ls in run section of pom.xml file shows a WAR file in /opt/demo directory inside a built docker image
Thanks everyone )