Branch Name as Variable in Azure DevOps Pipelines with YAML

In many CI/CD scenarios it’s necessary to adjust the build, test or deployment process depending on which GIT branch has triggered the pipeline. In our case we build lots of Angular apps automatically with their desired target environment, e.g.

ng build --configuration="production" or
ng build --configuration="staging"

depending on where the artifact should be deployed afterwards. This can be achieved by adding some YAML that looks like this:

Branch Name as Variable in Azure DevOps Pipelines with YAML weiterlesen

Stop using npm install in your CI/CD pipelines

TLDR: npm install can update your npm packages potentially destabilizing your build process by using untested dependency versions. Use npm ci instead!

If you’re like me you might have several node-based apps, nicely configured to be built and deployed using automatic build & release pipelines.

So one of the first things you’re probably doing in that build pipeline is installing all required dependencies from npm, with your process looking something like this:

Stop using npm install in your CI/CD pipelines weiterlesen