DEV Community

Joost van Wollingen
Joost van Wollingen

Posted on • Originally published at vanwollingen.nl on

How my mistake made the build 20 minutes slower

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!.

the slow build
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.

https://medium.com/media/8d030f5dd409ada653170c6f56a2625c/href


Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay