My Azure DevOps pipeline is successfully packing up my web service into a zip file with the following task:
- task: DotNetCoreCLI@2
displayName: Pack Artifacts
inputs:
command: 'publish'
publishWebProjects: false
arguments: '"Web Service" --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
This deposits the entire contents of the project in a zip file in 'drop\a.zip'. Now, I have a script (setup.ps1) that I want to run to open up the firewall and an SSL certificate that needs to be installed. I want to add them to the same zip file that was the target for the 'publish' operation. I tried this:
- task: CopyFiles@2
inputs:
SourceFolder: 'Additional Files'
Contents: '*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
But it just added the files in the 'Additional Files' directory to the "\drop" directory alongside the a.zip file:
drop
a.zip
setup.ps1
www_mysite_com.pfx
How would I go about adding the additional files to the zip file that's created as part of the build and publish steps. This must be a common problem. What's the common solution?