Skip to content

Commit

Permalink
Add task to install dotnet sdk (#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraksh1 authored Mar 11, 2024
1 parent 76639e7 commit e2fa918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
5 changes: 5 additions & 0 deletions vsts/pipelines/templates/_releaseJobTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
skipComponentGovernanceDetection: true
timeoutInMinutes: 300
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 7.x'
inputs:
version: 7.0.306

- script: |
echo "##vso[task.setvariable variable=ReleaseBuildImages;]true"
echo "##vso[task.setvariable variable=ReleaseRuntimeImages;]false"
Expand Down
21 changes: 0 additions & 21 deletions vsts/pipelines/templates/_releaseStepTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,6 @@ steps:
scriptPath: ./vsts/scripts/tagBuilderImagesForRelease.sh
condition: and(succeeded(), eq(variables['ReleaseBuildImages'], 'true'))

- 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
# Check if dotnet is present in the PATH
echo "$PATH"
# try adding dotnet to path
export PATH=$PATH:/usr/bin/dotnet
# Check if it is in PATH now
dotnet --list-sdks
displayName: 'Install Dotnet SDK 7 if not installed'

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

0 comments on commit e2fa918

Please sign in to comment.