Hello folks, i have to retrieve the git tag of the branch and save it to a variable, so i can name an artifact with thata value.
here is my pipeline step:
image: mcr.microsoft.com/dotnet/sdk:5.0
pipelines:
pull-requests:
'**':
- step:
script: # Modify the commands below to build your repository.
- git status
- git fetch --prune
- export PROJECT_NAME=ProvaPipelineDotNet.sln
- export TEST_NAME=TestProject1
- export GIT_TAG=`git describe --tags --always --abbrev=0`
- echo ${GIT_TAG}
- dotnet restore
- dotnet build $PROJECT_NAME
- dotnet test --logger "html;logfilename=$BITBUCKET_CLONE_DIR/testResults.html"
- dotnet publish --no-restore -c Release -o $BITBUCKET_CLONE_DIR/dist
- apt-get update
- apt-get -qq install zip curl
- zip -r $GIT_TAG.zip $BITBUCKET_CLONE_DIR/dist/
artifacts:
- ${GIT_TAG}.zip
- testResults.html