The CI Workflow

Before we discuss the CI workflow, it is important to quickly understand the more basic concept of a pipeline in Jenkins. The term pipeline is used to refer to a mechanism or a system of moving something, say supplies, from one point to another. In the context of software development, we are referring to shipping an application from development to the end user.

Continuous integration and delivery pipelines help software development to move code from development to different environments such as staging and production. A pipeline provides a fast, repeatable, and consistent process for delivering software. While pipelines vary for different products and scenarios, there are some generic steps that are important on every pipeline. The steps in a CI pipeline depend on the type of project you are running but, at a high level, involve pulling code from source control, preparing a test environment, and running tests. These are mentioned in brief below:

Pulling Code from Source Control: The expectation here is that you have a central repository where every developer regularly checks in code. The pipeline is configured to pull in the latest changes from a centralized repository host such as GitHub or Bitbucket.

Preparing the Application Environment: Depending on the application, this step is optional, but most applications today rely on dependencies that have to be installed prior to running the application. For instance, a Python application could require pip packages, or a Node.js application could have some npm dependencies.

Testing: As mentioned in earlier chapters, test-driven development is a huge enabler of continuous integration; thus, testing is one of the more important stages in a pipeline. This stage will run all the tests in the application and ensure they pass.

Building: Depending on the manner in which the application is shipped or the programming language used, this step may have different configurations, but the result here is a build artifact. A build artifact is a shippable file of your application. If you are using Java, the artifact could potentially be a JAR file, and if you are using Docker, the build artifact will be a Docker image.

Deployment: Depending on the setup, the pipeline may go ahead and deploy the application or wait for some manual input from a member of the team to deploy the application.

Remember the difference between continuous delivery and continuous deployment. Continuous Integration is essentially the practice of conducting your tests on a non-developer system as soon as someone pushes the code into a source repository such as GitHub. This practice helps team members integrate their work in such a way that it is verified by an automated build to identify errors as soon as possible. This results in quicker deployment to production.

This section will take that knowledge further and introduce a branching workflow that will help you set up a CI pipeline.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.63.136