Build-Test Automation

6 minute read

Before you use CloudBees CD for build-test automation, deployment automation, pipelines, or release management, you must create, configure, and manage these objects in the automation platform:

For build-test automation, you must create, configure, and manage these objects in the automation platform:

  • Projects—A project is an object used in CloudBees CD to organize information. A project is a container object for procedures, steps, schedules, workflows, and properties. If you use CloudBees CD for different purposes, you can use a separate project for each purpose so different projects do not interfere with each other. When you work in one project, you do not normally see information in other projects. At the same time, a project can use information defined in other projects, which allows you to create shared library projects.

  • Resources—A resource is defined as an agent machine where steps can execute. A resource has a logical name and a host name. In some situations, it is convenient to have multiple logical resources associated with the same host. A resource can also be associated with one or more pools. Each resource has a step limit that determines the maximum number of steps that can execute simultaneously on the resource. Resources can be grouped into resource pools . Multiple resources can be defined on the same machine.

  • Procedures— Procedures and steps define tasks that you want CloudBees CD to execute. A procedure consists of one or more steps. A step includes a command or script executed on a single resource and is the smallest unit of work that CloudBees CD understands. Each step specifies a resource on which it should run (either the name of a specific machine or the name of a resource pool of equivalent machines, in which case CloudBees CD picks a machine from the pool). A step can be given a time limit, and if the step does not complete within the specified time, CloudBees CD automatically aborts it.

    Steps are ordered within a procedure and normally execute sequentially. However, it is possible to mark a consecutive range of steps for parallel execution, so all steps in that range run concurrently.

    You can define parameters for procedures. Parameter values are assigned when procedures are scheduled. Parameters can be required, optional, or have default values. Parameters are used for a variety of purposes such as specifying the branch to build or the set of platforms on which to run tests. Parameter values can be used in step commands and many other places.

    Procedures can be nested. A step in one procedure can invoke another procedure instead of running a command. The invoking step provides parameters needed by the nested procedure, also referred to as a subprocedure.

  • Schedules—A schedule is used to execute procedures and determine when specific procedures run. A schedule can trigger at defined times, for example, every 2 hours from 10:00 pm to 6:00 am on Mondays, Wednesdays, and Fridays, or when modifications are checked into a particular branch of your source code control system. It is also possible to create a schedule that runs immediately and disappears after the job runs. When you create a schedule, you must provide the parameters required by the procedure that you want to invoke.

    The Continuous Integration Dashboard works with your source code management (SCM) system and provides visibility into running builds, the ability to add a project to continuous integration quickly, and easily accessed configuration pages to setup or modify a continuous integration schedule.

  • Workflows—Managing a build-test-deploy product life cycle spanning multiple procedures and projects requires a significant amount of "meta-programming" and a heavy use of properties, and the workflow feature simplifies this process. Using the workflow object, you can create build-test-deploy life cycles by defining a set of states and transitions. Any CloudBees CD project can contain a workflow.

  • When a procedure is executed or run, a job is created. A job is an object that is created each time a procedure begins to execute or run. The job keeps track of all data associated with the procedure’s execution, such as the running time of each step and any errors that may occur during the step. CloudBees CD retains job information after the job completes so you can examine what occurred.

After setting resources, procedures, and schedules, CloudBees CD automatically runs the procedures that you created using these objects and facilities:

  • Zones and Gateways—A zone (or top-level network) that you create is a way to partition a collection of agents to secure them from use by other groups. A gateway is a secured connection between two zones when you want to share or transfer information between the zones. For example, you might want a developers zone and a test zone. The CloudBees CD server is a member of the default zone, created during CloudBees CD installation.

  • Continuous Integration Builds and other schedules—Run jobs according to schedules that you define. Scheduled jobs can run at specific times or when source code changes are checked in to your source control system. CloudBees CD integrates with major source control systems. The Continuous Integration Dashboard allows you to add more projects easily and create build configurations quickly so you can visually see running builds, build status, and so on.

  • Artifact Management functionality—Using artifacts can improve performance across builds, provide better reusability of components, and improve cross-team collaboration with greater tractability. For example, instead of developers repeatedly downloading third-party packages from external sources, these components can be published and versioned as an artifact. Developers then simply retrieves a specific artifact version from a local repository, guaranteeing a consistent package from build to build.

  • Preflight build functionality —Used by developers to build and test code changes in isolation on their local machines before those changes are committed to a production build.

  • Plugin capability—CloudBees CD is built with an extensible UI, enabling easy development of plugins that include integrations with other tools, custom dashboards, and unique user experiences based on roles. "Bundled" plugins, installed during CloudBees CD installation, provide easy integration with your SCM systems, defect tracking applications, and so on.

  • Workflow functionality—Use a workflow to design and manage processes at a higher level than individual jobs. You can use workflows to combine procedures into processes to create build-test-deploy life cycles (for example). A workflow contains states and transitions that you define to provide complete control over your workflow process. The CloudBees CD Workflow feature allows you to define an unlimited range of large or small life cycle combinations to meet your needs.

  • Resource management—If a resource is overcommitted, CloudBees CD delays some jobs until others are finished with the resource. You can define pools of equivalent resources, and CloudBees CD spreads usage across the pool.

  • Recording a variety of information about each job, such as the running time and the success or failure of each step. A set of reports is available to provide even more information.

  • Powerful and flexible reporting facilities—Various statistics such as number of compiles or test errors are collected after each step and recorded in the CloudBees CD database. A variety of reports can be generated from this information.

  • Allowing you to observe jobs as they run and to cancel jobs.

  • Credentials—Use a credential, consisting of an user name and password, can be attached directly to a step or schedule at the platform level. You can also attach impersonation credentials to procedure steps, procedures, and projects before executing the job step. It allows CloudBees CD to use a specific account with special privileges on a per-job or per-step basis.

  • Workspace for each job, which is a disk area a job uses for storage—CloudBees CD also provides a facility for reclaiming space occupied by workspaces.

  • Powerful data model based on properties —Properties are used to store job input data such as the source code branch to use for the build, to collect data during a job (such as number of errors or warnings), and to annotate the job after it completes (for example, a build has passed QA).

  • Access control for users logged into the system—CloudBees CD uses this information to control their activities and integrates with Active Directory and LDAP repositories.

  • Search, sort, and filter functions to minimize viewing or "wading" through information that is of no interest to you, allowing you to access to the information you need quickly.

  • Email notifications to get important information or data to individuals or groups immediately and on a regular basis for a particular job or a specific job aspect.

  • All CloudBees CD operations and features are available from a command-line application tool (Perl API), ectool , the REST API, DSL methods, and a user interface (UI).

For more information, see Automation Platform Objects and Functionality .