Certified Jenkins Engineer (CJE) - capabdou/guide-devops GitHub Wiki

CI/CD

image

Continuous Integration (CI)

This is a sofware development practice in which members of a team integrate their work frequently, at least daily, leading to multiple integrations per day.

image

image

image

image

Continuous Delivry (CD)

This is a software development discipline where software is build in a manner that allows for deploying to customers at any time.

image

Continuous Deployment

This extends Continuous Delivery by automating the deployment process so that code is automatically deployed to production after it passes automated testing

image

About the difference between continuous integration is small integration steps, very frequent code commits.

Continuous delivery is we are continually delivering code that is a candidate to be pushed to production.

Continuous deployment is we are continually deploying the code to production systems in an automated fashion.

This is a wonderful, wondurful way to deliver software.

It makes everything very easy for the parties involved.

What is a Job?

Jobs in Jenkins

What is a Build?

A build is the result of a single execution of a project

image

Build Steps

A single task within a project

image

Build Triggers

A criteria for starting a new pipeline run or build

image

Artifacts and Repositories

This refers to immutable files that are generated during a build or a pipeline run. These are archived on the Jenkins master for later retrieval.

A single build can have multiple artifacts associated with it. These can include jar files, war files, configuration files, and other generated assets.

Artifacts are maintained in a repository. This can be on the Jenkins master or in a Source Control Manager (SCM).

Repositories hold items that need to be retrieved. These items can include source code artifacts and configuration files.

Build Tools

This are the software that actually performs the build portion of the pipeline.

Build tools can include Maven, Ant, and shell scripting.

Configuration varies by build tool, but the processes are similar:

  1. Start Jenkins and install required plugins.
  2. Perform global configuration steps.
  3. Create a Job / Pipeline that utilizes the build tool
  4. Update the tools configuration files: POM, XML, .config etc.

Source Control

Source Code Manger (SCM)

A Source Code Manager (SCM) is software that is used to tract changes in code.

Changes in code, revisions, are timestamped and include the identity of the person that made the change.

Changes can be tracked or rolled back as needed. Version of the code can be compared, stored, and merged with other versions.

Some examples are Git, Subversion, Mercurial, and Perforce.

Cloud based SCM's such as Git-Hub or Gitlab can be leveraged as offsite repositories for code.

Jenkins changelogs are used for tracking changes in builds.

Hangling Code from Source Control

image

image

image

Checking in Code to Source Control

Checking in code is the process of pushing changes to a repository.

Checking in code is the same as a code commit.

As part of the CI methodology, code should be checked in often.

All code commits should have a descriptive message that indicates what changes the commit includes.

Testing and notifications

Testing

Testing is a process of checking code to ensure that it is working as designed, or that is output is what is expected.

Types of Tests

Unit Test

In this type of test individual components (classes, mothods, modules) are tested to ensure that outputs are as expected.

Smoke Test

More generalized than a unit test, this type of test checks the main functionality of the software to ensure that it is stable enough for further testing:

Does it load?

Does it crash when the save button is clicked?

Do the menus work?

Verification / Functional Test

Verification testing seeks to answer the question "Did we satisfy the build requirements?"

Automated Verification testing is used to streamline this process.

Functional testing checks a specific function of the software. This seeks to answer "Does this feature work," or "can a user do this?"

Acceptance Test

This is the handoff test of the sofware to the client. It is normally done by the client to ensure that the software meets their expectations.

Notifications

Notifications are critical to an automated process; they give you active feedback to the status of processes within the project.

If a build fails, or if you need to manually approve a deployment, you can configure a notication to be sent.

Types of notifications include E-mail, SMS, and several types of instant messaging that are configurable via plugins.