How my mistake made the build 20 minutes slower

Joost van Wollingen
The Protean Tester
Published in
2 min readFeb 5, 2020

--

In order to deploy the same version of your code on all environments, it is important to create immutable artifacts of your application and only do deployments using those artifacts. The artifacts should be created by your CI server, to ensure a consistent environment is used to create the artifacts every time. That’s exactly what I was doing the other day for an application consisting out of more than 15 components. Each component needed to be built in Azure DevOps and subsequently published as a Build Artifact.

The initial version of the pipeline ran over 25 minutes to publish the 15 or so artifacts: NodeJS applications including their node_modules. The task taking the most time was the PublishBuildArtifacts task, some applications took 20 minutes for that step alone — really slow!.

24 minutes is definitely too long for a pipeline!

Of course, this operation should be much faster, so I deducted that I wrongly assumed that the PublishBuildArtifacts task would create a ZIP file and than upload that as the artifact. Instead, I think, the task takes every individual file in the folder mentioned and uploads them one by one.

By adding the ArchiveFiles task the running time for the build was reduced to a total of 1 minute 30 seconds. The longest publish task is now taking ~20 seconds, down from 20+ minutes! All by adding a single task that creates a ZIP file first. Find a snippet below to get started.

--

--