Skip to content

Latest commit

 

History

History
263 lines (206 loc) · 11.2 KB

module_1.md

File metadata and controls

263 lines (206 loc) · 11.2 KB

Module 1 : Key CI/CD/Jenkins Concepts

Resources

Continuous Delivery/Continuous Integration Concepts

Definition
continuous integration TODO
continuous delivery TODO
continuous deployment TODO

Difference between CI and CD

TODO

Stages of CI and CD

The commit statg asserts that the system works at the technical level. It compiles, passes a suite of (primarily unit-level) automated tests, and runs code analysis

Automated acceptance test stages assert that the system works at the functional and nonfuctional level, that behaviorally it meets the needs of its users and the specifications of its customers.

Manual test stages assert that the system is usable and fulfills its requirements, detects any defects that have not been caught by the automated tests and verify that it provides value to its users. That might include exploratory testing environments, integration environments and user acceptence tests.

Release stage delivers the system to the users/customers. Either as packaged software or by deploying it into a production or staging environment, where staging environment is as identical as possible to the production environment.

Automated acceptance test stages assert that the system works at the functional and nonfunctional level, that behaviorally it meets the needs of its users and the specifications of the customer.

Continuous delivery versus continuous deployment

TODO

Jobs

What are jobs in Jenkins?

Synonymous with project. Projects are containers for executing buildsteps. It consists of the following elements:

  • optional SCM, such as CVS or Subversion where your source code resides.
  • optional triggers to control when Jenkins will perform builds.
  • some sort of build script that performs the build (ant, maven, shell script, batch file, etc.) where the real work happens
  • optional steps to collect information out of the build, such as archiving the artifacts and/or recording javadoc and test results.
  • optional steps to notify other people/systems with the build result, such as sending e-mails, IMs, updating issue tracker, etc.

In Jenkins 2: A user-defined model of a continuous delivery pipeline.

Types of jobs

  • Freestyle job : Freestyle build jobs are general-purpose build jobs, which provides a maximum of flexibility.
  • Maven job : The “maven2/3 project” is a build job specially adapted to Maven projects. Jenkins understands Maven pom files and project structures, and can use the information gleaned from the pom file to reduce the work you need to do to set up your project.
  • Monitor an external job: The “Monitor an external job” build job lets you keep an eye on non-interactive processes, such as cron jobs.
  • Multiconfiguration job: aka “matrix project”, lets you run the same build job in many different configurations. This powerful feature can be useful for testing an application in many different environments, with different databases, or even on different build machines
  • Copy existing job: creates a job identical to the given one, but you have to change the name.

Scope of jobs

TODO

Builds

What are builds in Jenkins?

Result of a single execution of a Project.

What are build steps, triggers, artifacts, and repositories?

  • Steps: A single task; fundamentally steps tell Jenkins what to do inside of Project.
  • Triggers: A criteria for triggering a new Build.
  • Artifacts: An immutable file generated during a Build which is archived onto the Jenkins Master for later retrieval by users.
  • Repositories: TODO: scm or mvn ?

Build tools configuration

TODO

Source Code Management

What are source code management systems and how are they used?

TODO

Cloud-based SCMs

TODO

Jenkins changelogs

TODO

Incremental updates v clean check out

TODO

Checking in code

TODO

Infrastructure-as-Code

TODO

Branch and Merge Strategies

TODO

Testing

TODO

Benefits of testing with Jenkins

TODO

Define unit test, smoke test, acceptance test, automated verification/functional tests

Definition
unit test TODO
smoke test TODO
acceptance test TODO
automated verification/functional tests TODO

Notifications

Types of notifications in Jenkins

  • Email:
  • well-known
  • easy to use and easy to configure
  • Advanced Email:
  • Email-ext plugin
  • define a more refined email notification strategy
  • Claiming Builds:
  • Claim plugin
  • lets developers indicate that they have taken ownership of the broken build, and are attempting to fix it
  • RSS-Feeds:
  • overall build results across all of your builds (or just the builds on a particular view)
  • or build results for a specific build.
  • Build Radiators:
  • commonly used in Agile circles:

An Information radiator is a display posted in a place where people can see it as they work or walk by. It shows readers information they care about without having to ask anyone a question. This means more communication with fewer interruptions. ... Agile guru Alistair Cockburn

  • IM - Jabber:
  • Jabber, an open source, XML-based instant messaging protocol
  • developers can receive real-time notification of build failures
  • --> or Jenkins can run an IM bot that listens to the chat channels and lets developers run commands on the Jenkins server via chat messages.
  • IM - IRC:
  • IRC is traditionally focused on group discussions
  • Desktop Notifiers:
  • best push notification strategies integrate smoothly into the developer’s daily work environment
  • Jenkins Tray Application plugin or Jenkins Eclipse Plugin
  • Mobile:
  • you can also monitor your builds via your iPhone or Android mobile device (e.g. Android widget Hudson Mood)
  • SMS:
  • popular among system administrators,
  • main disadvantage of this approach is arguably that it is not free, and requires the use of a third-party commercial service,
  • only notification technique capable of reaching developers when they are out of Internet range or who do not have a data-enabled smartphone.
  • Noise
  • Jenkins Sounds plugin and the Jenkins Speaks plugin
  • effective strategy for small co-located teams
  • For example, you can configure Jenkins to play one sound the first time a build fails, a different sound if the build fails a second time, and yet another sound when the build is fixed
  • EFD - Extreme Feedback Devices
  • Nabaztag --> popular WiFi-enabled robotic rabbit that can flash colored lights, play music, or even speak

Importance of notifications

There are 2 types of notifications: active and passive (or better: push and pull). The CI-server must let the right people know any new issues as fast as possible. Passive strategies like as build radiators lead to higher awareness about failing builds and care for fixing broken builds with higher priority. Active notifications encourage developers to take matters into their own hands and fix broken builds quickly.

Distributed Builds

What are distributed builds?

TODO

Functions of masters and agents

TODO

Plugins

What are plugins?

TODO

What is the plugin manager?

TODO

Jenkins Rest API

How to interact with it

TODO

Why use it?

TODO

Security

Authentication versus authorization

TODO

Matrix security

TODO

Definition of auditing, credentials, and other key security concepts

TODO

Fingerprints

What are fingerprints?

The fingerprint of a file is simply a MD5 checksum. Jenkins maintains a database of md5sum, and for each md5sum, Jenkins records which builds of which projects used. This database is updated every time a build runs and files are fingerprinted.

To avoid the excessive disk usage, Jenkins does not store the actual file. Instead, it just stores md5sum and their usages. These files can be seen in $JENKINS_HOME/fingerprints

Plugins can store additional information in these records. For example, Deployment Notification Plugin tracks files deployed on servers via chef/puppet through fingerprints.

How do fingerprints work?

When you have interdependent projects on Jenkins, it often becomes hard to keep track of which version of a file is used by which version of a dependency on that file. Jenkins supports file fingerprinting to track dependencies.

For example, suppose you have the TOP project that depends on the MIDDLE project, which in turn depends on the BOTTOM project. You are working on the BOTTOM project. The TOP team reported that bottom.jar that they are using causes an NPE, which you (a member of the BOTTOM team) thought you fixed in BOTTOM #32. Jenkins can tell you which MIDDLE builds and TOP builds are using (or not using) your bottom.jar #32.

Artifacts

How to use artifacts in Jenkins

TODO

Storing artifacts

TODO

Configuration Management (Tools such as Chef, Puppet, etc.)

Elements of software configuration management

TODO

Importance of software configuration management

TODO

Using 3rd party tools

How to use 3rd party tools with Jenkins

TODO