Skip to content
Snippets Groups Projects
Select Git revision
  • 1d03d0f9dd0b6f3d9c5f9473e0c200794c338ec1
  • master default protected
  • renovate/m13253-dns-over-https-2.x
3 results

tagging.sh

Blame
  • tagging.sh 812 B
    #!/bin/sh
    
    if [ "$1" = "--help" ]; then
        echo "
        Usage of $0:
            $0 <PREFIX> <VERSION> <SUFFIX>
    
        Example:
            $0 doh 2.0.24 alpine
        "
    fi
    
    PREFIX=${1:-doh}
    VERSION=${2}
    [ "${3}" != "" ] && [ "${3}" != "debian" ] && SUFFIX="-${3}"
    
    
    
    if [ "$VERSION" != "" ]; then
        docker tag doh:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1)${SUFFIX}"
        docker tag doh:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1-2)${SUFFIX}"
        docker tag doh:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1-3)${SUFFIX}"
        docker tag doh:testing "$PREFIX:$(echo "${VERSION}" | sed -e 's/^v//' | cut -d. -f1-4)${SUFFIX}"
        [ "$SUFFIX" = "" ] && docker tag doh:testing "$PREFIX:latest"
    else
        echo "No version provided. Skipping tagging..."
    fi