Hi everyone!
I have following configuration which builds and pushes my project as image into dockerhub
pipelines:
branches:
master:
- step:
services:
- docker
script:
- mvn clean install
- export IMAGE_NAME=org/project:$BITBUCKET_COMMIT
- docker build -t $IMAGE_NAME .
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- docker push $IMAGE_NAME
This works fine and was easy to setup. Now, I want to tag my images with the current version of my project, which is specified in the *pom.xml* which lies in the root directory.
How can I read/extract/store the version of my project and use it as tag for a docker image?
Cheers,
Alexander