Reputation: 381
Have been setting up an Azure DevOps pipeline for bundling a function and deploying it over to GCP (deplyoment part is working fine and no issues).
But the overall process takes a lot of time, is there any suggestion how can we reduce the time of deployment?
azure-pipeline.yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: CopyFiles@2
inputs:
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: Npm@1
inputs:
command: 'install'
workingDir: '$(Build.ArtifactStagingDirectory)/functions'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
While release pipeline is just reading the drop and pushing it via shell script.
The overall pipeline takes a lot of time in copying the nodefile after npm install to the drop (over 10 minutes). Is there any way make this process fast?
Upvotes: 1
Views: 4089
Reputation: 51103
According to your YAML file, you have included all files when copy and publish to drop folder.
The alternative is choosing necessary files and excluding node_modules
folder from publishing to server. This will help to reduce time. A sample UI setting for reference.:
Source Folder: $(Build.SourcesDirectory)
Contents:
**\**
!**\node_modules\**
Target Folder: $(build.artifactstagingdirectory)
Publish Build Artifacts task: $(build.artifactstagingdirectory)
Artifact Name: drop
Upvotes: 2