Commit 5b83a1f5 authored by Julienne Lehmann's avatar Julienne Lehmann
Browse files

add VERSION for the container

parent 636e13b7
Pipeline #73461 failed with stage
in 9 minutes and 51 seconds
#!/bin/bash
# from: https://github.com/fmahnke/shell-semver/blob/4e70a1645c4a029ddafbed1ea63d2f0299866bf6/increment_version.sh
# Increment a version string using Semantic Versioning (SemVer) terminology.
# Parse command line options.
while getopts ":Mmp" Option
do
case $Option in
M ) major=true;;
m ) minor=true;;
p ) patch=true;;
esac
done
shift $(($OPTIND - 1))
version=$1
# Build array from version string.
a=(${version//./ })
# If version string is missing or has the wrong number of members, show usage message.
if [ ${#a[@]} -ne 3 ]
then
echo "usage: $(basename $0) [-Mmp] major.minor.patch"
exit 1
fi
# Increment version numbers as requested.
if [ ! -z $major ]
then
((++a[0]))
a[1]=0
a[2]=0
fi
if [ ! -z $minor ]
then
((++a[1]))
a[2]=0
fi
if [ ! -z $patch ]
then
((++a[2]))
fi
echo "${a[0]}.${a[1]}.${a[2]}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment