Skip to content

Commit

Permalink
fix pipelines#1
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqualespica committed Jul 12, 2022
1 parent fc0652e commit a010f95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .devops/deploy-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,13 @@ stages:
inputs:
targetType: 'inline'
script: |
echo "${{ parameters.environment }}"
echo "${{ parameters.ENV }}
version=$(cat pom.xml | grep '^.*<version>' | sed -n 2p | awk -F'[><]' '{print $3}')
branch="$(Build.SourceBranch)"
if [[ "$branch" != "refs/heads/master" && ! "$branch" =~ "refs/tags/.*" && "${{ parameters.environment }}" == "prod" ]]; then
if [[ "$branch" != "refs/heads/master" && ! "$branch" =~ "refs/tags/.*" && "${{ parameters.ENV }}" == "prod" ]]; then
echo "Deploy branch $branch is not allowed."
exit 1
fi
if [[ "$version" == *SNAPSHOT && "${{ parameters.environment }}" == "prod" ]]; then
if [[ "$version" == *SNAPSHOT && "${{ parameters.ENV }}" == "prod" ]]; then
echo "Version $version is not allowed."
exit 1
fi
Expand Down

0 comments on commit a010f95

Please sign in to comment.