...

Text file src/github.com/emissary-ingress/emissary/v3/releng/01-release-rc-update-apro

Documentation: github.com/emissary-ingress/emissary/v3/releng

     1#!/bin/bash
     2
     3if [ -z "$1" ]; then
     4    echo "First argument must be RC tag"
     5    exit -1
     6fi
     7
     8if [ -z "$2" ]; then
     9    echo "Second argument must be a GA tag"
    10    exit -1
    11fi
    12
    13if [ -z "$APRO_REPO_TARGET" ]; then
    14    echo "APRO_REPO_TARGET not set. This should be set in the environment"
    15    exit -1
    16fi
    17
    18# remove existing apro-prep-rc in case this is being run
    19# locally on a long lived dev machine
    20if [ -d "/tmp/apro-prep-rc" ]; then
    21    rm -rf /tmp/apro-prep-rc
    22fi
    23
    24# get a fresh copy of apro
    25git clone https://github.com/$APRO_REPO_TARGET.git /tmp/apro-prep-rc
    26pushd /tmp/apro-prep-rc
    27
    28# checkout or create proper rel branch
    29if [ ! $(git checkout rel/$2) ]; then
    30    case $2 in
    31        *"v1."*)
    32            git checkout ltr
    33            ;;
    34        *"v2."*)
    35            git checkout master
    36            ;;
    37        *)
    38            echo "Not intelligent enough to find branch that tracks $2 parent releases"
    39            exit 1
    40    esac
    41
    42    git checkout -b rel/$2
    43fi
    44
    45# set emissary tag into apro
    46CURRENT_EMISSARY_TAG=$(grep 'imageTag' emissaryInfo.yml | sed 's/imageTag://g' | tr -d ' ')
    47sed -i "s/$CURRENT_EMISSARY_TAG/$1/g" emissaryInfo.yml
    48git add .
    49git commit -s -m "(from CI) bump emissary version to latest RC"
    50git push --set-upstream origin rel/$2

View as plain text