Oct 06 2022
04:37 PM
- last edited on
Mar 05 2024
02:05 PM
by
TechCommunityAP
Oct 06 2022
04:37 PM
- last edited on
Mar 05 2024
02:05 PM
by
TechCommunityAP
We are using Azure DevOps to run a CI/CD pipeline to our various environments. We recently encountered an issue where one of the developers re-named a TypeScript file - perfectly reasonable thing to do - and then pushed his changes to BitBucket.
When the pipeline ran, the new output file was deployed to the target server, but because there was no cleaning process, the same file was already there with it's old name. Then subsequently when the bundle was served to the browser, it included the contents of both files and so we had instances of "Identifier 'x' has already been declared".
Just wondering if anyone has a neat way of handling this situation. Do you include a clean-up step in the pipeline?
Oct 06 2022 05:48 PM
Oct 06 2022 05:58 PM
Hi,
Thanks for the reply. Apologies, wasn't sure what detail I needed to include.
We are using a YAML file to define the pipeline steps. It is deploying to a VM.
Deployment steps are as follows:
- stage: Deploy
displayName: Deploy to IIS
dependsOn: Build
jobs:
- deployment: DeploytoIIS
displayName: Deploy the web application to dev environment
environment:
name: Development-env-02
resourceType: VirtualMachine
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)'
- task: IISWebAppDeploymentOnMachineGroup@0
displayName: 'Deploy IIS Website'
inputs:
WebSiteName: '$(websiteName)'
Package: '$(System.ArtifactsDirectory)\**\Zeus.zip'
So maybe there is a clean step we can include?
Oct 07 2022 01:42 AM
SolutionOct 09 2022 10:03 PM
Oct 07 2022 01:42 AM
Solution