Skip to content

Commit fde6af6

Browse files
committed
fix: Add dockerPreRelease profile to fix pre-release workflow
Maven does not interpolate property references like ${project.version} within command-line -D values, causing Jib to fail with "invalid tag". Add a separate dockerPreRelease profile that configures the version tag in pom.xml where Maven properly interpolates it. Update the pre-release workflow to use this profile instead of passing the tag via command line.
1 parent 721f900 commit fde6af6

File tree

2 files changed

+95
-2
lines changed

2 files changed

+95
-2
lines changed

.github/workflows/server-pre-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ jobs:
4949
DOCKER_USERNAME: ${{ github.actor }}
5050
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
5151
run: |
52-
mvn --batch-mode deploy -Pdocker -Dmaven.deploy.skip \
53-
'-Djib.to.tags=${project.version}' \
52+
mvn --batch-mode deploy -PdockerPreRelease -Dmaven.deploy.skip \
5453
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
5554
-Dsonar.projectKey=aehrc_pathling -Dsonar.organization=aehrc \
5655
-Dsonar.host.url=https://sonarcloud.io \

server/pom.xml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,5 +811,99 @@
811811
</plugins>
812812
</build>
813813
</profile>
814+
<profile>
815+
<!-- Pre-release profile for Docker builds. Only tags with the project version. -->
816+
<id>dockerPreRelease</id>
817+
<build>
818+
<plugins>
819+
<plugin>
820+
<groupId>org.apache.maven.plugins</groupId>
821+
<artifactId>maven-failsafe-plugin</artifactId>
822+
<executions>
823+
<execution>
824+
<id>system-test</id>
825+
<goals>
826+
<goal>integration-test</goal>
827+
<goal>verify</goal>
828+
</goals>
829+
</execution>
830+
</executions>
831+
<configuration>
832+
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
833+
<includes>
834+
<include>**/*.java</include>
835+
</includes>
836+
<groups>SystemTest</groups>
837+
<systemPropertyVariables>
838+
<pathling.systemTest.version>${git.commit.id}</pathling.systemTest.version>
839+
<pathling.systemTest.auth.issuer>
840+
https://auth.ontoserver.csiro.au/auth/realms/aehrc
841+
</pathling.systemTest.auth.issuer>
842+
<pathling.systemTest.auth.clientId>pathling-test</pathling.systemTest.auth.clientId>
843+
<pathling.systemTest.auth.requestedScope>
844+
openid user/*.*
845+
</pathling.systemTest.auth.requestedScope>
846+
<pathling.systemTest.terminology.serverUrl>
847+
https://tx.ontoserver.csiro.au/fhir
848+
</pathling.systemTest.terminology.serverUrl>
849+
<pathling.systemTest.dockerRepository>
850+
${pathling.fhirServerDockerRepo}
851+
</pathling.systemTest.dockerRepository>
852+
<spring.profiles.active>system-test</spring.profiles.active>
853+
</systemPropertyVariables>
854+
</configuration>
855+
</plugin>
856+
<plugin>
857+
<groupId>com.google.cloud.tools</groupId>
858+
<artifactId>jib-maven-plugin</artifactId>
859+
<version>${pathling.jibVersion}</version>
860+
<configuration>
861+
<from>
862+
<image>${pathling.dockerBaseImage}</image>
863+
<platforms>
864+
<platform>
865+
<architecture>amd64</architecture>
866+
<os>linux</os>
867+
</platform>
868+
<platform>
869+
<architecture>arm64</architecture>
870+
<os>linux</os>
871+
</platform>
872+
</platforms>
873+
</from>
874+
<to>
875+
<image>${pathling.fhirServerDockerRepo}</image>
876+
<tags>
877+
<tag>${project.version}</tag>
878+
</tags>
879+
</to>
880+
<container>
881+
<jvmFlags>
882+
<jvmFlag>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</jvmFlag>
883+
<jvmFlag>--add-opens=java.base/java.net=ALL-UNNAMED</jvmFlag>
884+
<jvmFlag>--add-opens=java.base/sun.util.calendar=ALL-UNNAMED</jvmFlag>
885+
</jvmFlags>
886+
</container>
887+
</configuration>
888+
<executions>
889+
<execution>
890+
<id>build</id>
891+
<phase>package</phase>
892+
<goals>
893+
<goal>dockerBuild</goal>
894+
</goals>
895+
</execution>
896+
<execution>
897+
<id>deploy</id>
898+
<phase>deploy</phase>
899+
<goals>
900+
<goal>build</goal>
901+
</goals>
902+
</execution>
903+
</executions>
904+
</plugin>
905+
</plugins>
906+
</build>
907+
</profile>
814908
</profiles>
815909
</project>

0 commit comments

Comments
 (0)