Skip to content

Commit

Permalink
Merge pull request #32 from CybercentreCanada/pipeline-checks
Browse files Browse the repository at this point in the history
Switch to checking for branch head rather than history
  • Loading branch information
cccs-sgaron authored Mar 23, 2021
2 parents 8b442df + 40dc852 commit e08df70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pipelines/azure-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ stages:
if [[ "$TAG" == *stable* ]]; then export BUILD_TYPE=stable; else export BUILD_TYPE=latest; fi
export VERSION=${TAG/stable}
export BRANCH=`git branch -r --contains ${BUILD_SOURCEBRANCH} | grep -v ${BUILD_SOURCEVERSION} | xargs`
export COMMIT=`git rev-parse --verify ${BUILD_SOURCEBRANCH}`
export BRANCH=`git ls-remote --heads origin | grep $COMMIT | sed "s/.*\///"`
echo "Building $VERSION On branch $BRANCH"
if [[ "$VERSION" == *stable* ]] && [[ $BRANCH != "origin/master" ]]; then exit 1; fi
if [[ "$VERSION" == *dev* ]] && [[ $BRANCH != "origin/dev" ]]; then exit 1; fi
if [[ "$VERSION" == *stable* ]] && [[ $BRANCH != "master" ]]; then exit 1; fi
if [[ "$VERSION" == *dev* ]] && [[ $BRANCH != "dev" ]]; then exit 1; fi
export VERSION=${VERSION/beta/b}
export SERIES="`expr $TAG : '\([0-9]\+\.[0-9]\+\.\)'`${BUILD_TYPE}"
Expand Down

0 comments on commit e08df70

Please sign in to comment.