To provide a runtime verification of the build that has been deployed, the version is automatically incremented by placing a variable in the pom.xml
file
<?xml version="1.0" encoding="UTF-8"?>
..
<artifactId>springboot</artifactId>
<groupId>io.cdaf</groupId>
<name>Spring Boot Data REST Sample</name>
<description>Spring Boot Data REST Sample</description>
<version>0.2.${build.number}</version>
In the build task, the build number is supplied as a maven parameter
mvn --batch-mode --file springboot/pom.xml package -D"build.number=${BUILDNUMBER}"
The resulting artefact is in a subdirectory, buy using the -flat parameter in storeForLocal
the artefact will be placed in the root of release package.
springboot/target/springboot.war -flat
By setting the buildImage
property in the CDAF.solution
driver file, a docker image build and push is triggered. In this example the image is pushed to an on-premise container registry (Nexus).
productName=Springboot Sprint Zero
solutionName=spring
artifactPrefix=0.2
buildImage=registry.access.redhat.com/ubi9/openjdk-17-runtime
CDAF_REGISTRY_URL=https://${NEXUS_REGISTRY}
CDAF_REGISTRY_TAG=${NEXUS_REGISTRY}/${SOLUTION}:$BUILDNUMBER
CDAF_REGISTRY_USER=${NEXUS_REGISTRY_USER}
CDAF_REGISTRY_TOKEN=${NEXUS_REGISTRY_PASS}
registryTag=${NEXUS_REGISTRY}/${SOLUTION}:$BUILDNUMBER
This image is consumed, along with other autonomous development components, in the Release Train.