Book Image

Hands-On Continuous Integration and Delivery

By : Jean-Marcel Belmont
Book Image

Hands-On Continuous Integration and Delivery

By: Jean-Marcel Belmont

Overview of this book

Hands-On Continuous Integration and Delivery starts with the fundamentals of continuous integration (CI) and continuous delivery (CD) and where it fits in the DevOps ecosystem. You will explore the importance of stakeholder collaboration as part of CI/CD. As you make your way through the chapters, you will get to grips with Jenkins UI, and learn to install Jenkins on different platforms, add plugins, and write freestyle scripts. Next, you will gain hands-on experience of developing plugins with Jenkins UI, building the Jenkins 2.0 pipeline, and performing Docker integration. In the concluding chapters, you will install Travis CI and Circle CI and carry out scripting, logging, and debugging, helping you to acquire a broad knowledge of CI/CD with Travis CI and CircleCI. By the end of this book, you will have a detailed understanding of best practices for CI/CD systems and be able to implement them with confidence.
Table of Contents (18 chapters)

Debugging slow builds in CircleCI

A build may be slow in CircleCI due to a myriad of reasons. Let's look at a workflow example for go-template-example-with-circleci (https://circleci.com/workflow-run/533ee47a-a990-4679-826b-7b24221df2ca):

In particular, notice that the integration job took over a minute to finish and the deploy job took over a minute to finish as well, which is making the build take 3 minutes and 20 seconds to complete. If we click on the integration job, we see the following steps in the job:

Notice here that the npm install took 1 minute and 3 seconds to finish. Let's open up the run step call npm install for further details:

The only dependency we have is for cypress.io, but we are not caching this dependency so it will run this step every time. CircleCI has a way for us to cache our node dependencies by utilizing two field declarations called...