Reputation: 7866
I'm new to Azure DevOps and trying to configure CI/CD pipelines. Here are the steps that I followed.
azure-pipelines.yml
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: CopyFiles@2
inputs:
contents: 'build/**'
targetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
Build and deployment works fine, but there are 2 problems
Upvotes: 0
Views: 961
Reputation: 2196
You could use IISWebAppDeploymentOnMachineGroup@0 - IIS web app deploy v0 task in your release pipeline.
Using predefined variable to locate the .zip
$(System.DefaultWorkingDirectory)\**\*.zip
This task supports the .zip file extract.
Upvotes: 1