Simple just install go and execute
./versioning minor ./version.txt
./versioning patch ./version.txt
./versioning major ./version.txt
- Remember to place the version.txt at the level of the compiled versioning code.
- Make a pull request
(remember you can only use major, minor, patch) run:
sh version.sh minor
version.sh
#!/usr/bin/env bash
./versioning $1 ./version.txt
VERSION=$(cat ./version.txt)
echo "🆚 New version: $VERSION"
# Build the image, passing in the version number as a build argument
PACKAGE_NAME=my-app:$version
echo "🏗️ Building $PACKAGE_NAME"
docker build -t package_name .
echo "📍 Pushing $PACKAGE_NAME"
docker push $package_name