I'm new to Azure DevOps and trying to configure CI/CD pipelines. Here are the steps that I followed.
- Created VM and setup IIS
- Created pipeline on Azure devops with Github source code. Here is yml file.
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'
- Created and configure Deployment groups, and setup agent with auth token
Build and deployment works fine, but there are 2 problems
- Build generates artifacts with zip file.
- zip file has lot more inner folder where actual executable files are located.
CodePudding user response:
Using predefined variable to locate the .zip
$(System.DefaultWorkingDirectory)\**\*.zip
This task supports the .zip file extract.