Skip to content

Commit

Permalink
Install dotnet sdk if not installed (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraksh1 authored Mar 10, 2024
1 parent 519ec6d commit cf094dd
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions vsts/pipelines/templates/_releaseStepTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,20 @@ steps:
scriptPath: ./vsts/scripts/tagBuilderImagesForRelease.sh
condition: and(succeeded(), eq(variables['ReleaseBuildImages'], 'true'))

- task: UseDotNet@2
displayName: 'Use .NET Core sdk 7.x'
inputs:
version: 7.x
- script: |
dotnet --version
if [ $? -ne 0 ]; then
echo "Failed to check dotnet version. Assuming not installed."
fi
# Check for installed .NET 7.x using package manager
dpkg --list | grep 'dotnet-sdk-7\.'
if [ $? -ne 0 ]; then
echo "dotnet 7.x is not installed. Installing..."
# Update package list and install .NET 7.x SDK
sudo apt-get update
sudo apt-get install -y dotnet-sdk-7.0
fi
displayName: 'Install Dotnet SDK 7 if not installed'

- task: ShellScript@2
displayName: 'Test runtime images for pme staging registry'
Expand Down

0 comments on commit cf094dd

Please sign in to comment.