This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Mounts PWD (pom.xml must be at root) on lightest Maven image and extracts the project version | |
VERSION=`docker run -v $(pwd):/usr/src/app \ | |
-w /usr/src/app \ | |
maven:3.6.0-jdk-8-alpine mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version \ | |
-q \ | |
-DforceStdout` | |
docker tag $IMAGE_NAME $DOCKER_REPO:$VERSION | |
docker push $DOCKER_REPO:$VERSION |