Home > Enterprise >  How to deploy code without zip file and inner folders azure devops
How to deploy code without zip file and inner folders azure devops

Time:12-02

I'm new to Azure DevOps and trying to configure CI/CD pipelines. Here are the steps that I followed.

  1. Created VM and setup IIS
  2. 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'
  1. Created and configure Deployment groups, and setup agent with auth token

Build and deployment works fine, but there are 2 problems

  1. Build generates artifacts with zip file.

enter image description here

  1. zip file has lot more inner folder where actual executable files are located.

CodePudding user response:

You could use enter image description here

Using predefined variable to locate the .zip

$(System.DefaultWorkingDirectory)\**\*.zip

This task supports the .zip file extract.

enter image description here

  • Related