Allow setting external dockerfile for simulator 56/130656/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 2 Sep 2022 08:35:48 +0000 (09:35 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 2 Sep 2022 08:36:54 +0000 (09:36 +0100)
If building with an external dockerfile, e.g. using
 mvn clean install -Pdocker -DdockerFile=/path/to/dockerfile
docker will look for project files in the same directory as the
new dockerfile. A new property is added for setting the context
path, to allow using existing project files in src/main/docker.

Issue-ID: POLICY-4334
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I25a192d01583f1085055db08477e9be884512091

models-sim/packages/models-simulator-docker/pom.xml

index 15daf00..e98517b 100644 (file)
@@ -44,6 +44,7 @@
         <docker.skip.push>false</docker.skip.push>
         <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+        <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
         <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
         <sonar.skip>true</sonar.skip>
                             <build>
                                 <cleanup>try</cleanup>
                                 <dockerFile>${dockerFile}</dockerFile>
+                                <contextDir>${docker.contextDir}</contextDir>
                                 <tags>
                                     <tag>${project.version}</tag>
                                     <tag>${project.version}-${maven.build.timestamp}</tag>
         <dependency>
             <groupId>org.onap.policy.models.sim</groupId>
             <artifactId>models-simulator-tarball</artifactId>
-           <version>${project.version}</version>
+            <version>${project.version}</version>
             <classifier>tarball</classifier>
             <type>tar.gz</type>
         </dependency>