IntelliJ IDEA plugin use cases

4 minute readExtensibilityDeveloper productivity

Manage CloudBees CD/RO jobs, pipelines, or releases

The following examples illustrate how to use the CloudBees CD/RO Manager features to:

  • To Abort, Force Abort, or Delete a job, pipeline, or release within IntelliJ IDEA.

  • Access the object related Job details, Pipeline runs, Release runs, or My work features within the CloudBees CD/RO.

  • Respond to CloudBees CD/RO manual task within IntelliJ IDEA. Supported task:

    • Primary approval for pipeline and stage tasks.

    • Retry a job, pipeline, or stage task.

    • Execute manual workflow transitions, such as a process or job waiting for manual retry.

Access object management features by opening an IntelliJ project. Then select CloudBees CloudBees CD/RO Manager icon.

If the logo logo or CloudBees CD/RO plugin is not visible, then you must install the CloudBees CD/RO plugin. Refer to Create CloudBees CD/RO IntelliJ IDEA plugin configurations.
Manager
Figure 1. CloudBees CD/RO Manager

Use the information below to interact with CloudBees CD/RO objects.

  1. Choose a plugin feature or action

  2. Choose data to view.

    • Reload the object display by selecting the refresh Refresh icon.

    • Select an Object Type to view. Options are:

      • Job

      • Pipeline

      • Release

      • Work item

    • Select the object initiator from the Launched by menu.

    • Select the number of objects to display from the Show menu.

    • Modify plugin visibility options by selecting the CloudBees CloudBees CD/RO icon or Three-dots CloudBees CD/RO three-dots icon.

    • Display or hide the plugin Manager by selecting the CloudBees CloudBees CD/RO icon.

  3. Access object actions by right-clicking the object name and selecting an action. Options are:

    • Navigation CloudBees CD/RO specific features. Options are:

    • Ability to Abort, Force Abort, or Delete object, job, pipeline, or release.

    • Respond to a work item.

Create an applications pipeline, releases, or environment

Use these steps to create CloudBees CD/RO objects using DSL.

  1. Open a project file in IntelliJ.

  2. Right-click on the Intellij project folder where the DSL will be located.

  3. Select File from the New menu.

  4. Enter a name for the new object. Include .dsl file extension.

    New file
    Figure 2. New file
  5. Press the Enter key. The new file is displayed in the IntelliJ editor and as a Current File menu option.

  6. Enter CloudBees CD/RO object attributes in DSL format.

    To use the enabled autocomplete feature for CloudBees CD/RO API commands and objects:

    1. Add the import and auto-complete commands to lines 1 and 2 of the DSL file.

      import com.electriccloud.client.groovy.ElectricFlow ElectricFlow ef = new ElectricFlow()
    2. Use ef. to access a list of available API commands or objects.

  7. Validate and save script to CloudBees CD/RO server.

    Run and debug configurations can be modified for each script. Refer to Configure DSL script run and debug settings.
    • Select the script from the Current File menu. Then select the Run Run icon.

    • Right-click on the object page in the editor or the file name in the project browser. Then select Run and the object name preceded by CloudBees CloudBees logo.

Use DSL to modify CloudBees CD/RO objects

Use these steps to edit a CloudBees CD/RO application, pipeline, release, or environment.

  1. Open a project file in IntelliJ.

  2. Select the CloudBees CloudBees CD/RO Manager icon.

  3. Select the generate Generate DSL icon. The CloudBees CD/RO - Generate DLS screen displays.

  4. Use the left navigation to locate and select an object to be copied or modified.

  5. Select Generate to save the object to an IntelliJ project location.

  6. Change the object file extension from .groovy to .dsl.

    Manager
    Figure 3. CloudBees CD/RO - Generate DSL
  7. Select Save to convert the Groovy file to DSL and open DSL in the IntelliJ editor.

  8. Modify the product object in the IntelliJ editor.

    1. Add the import and auto-complete commands to lines 1 and 2 in the dsl file.

      import com.electriccloud.client.groovy.ElectricFlow ElectricFlow ef = new ElectricFlow()
    2. Use ef. to access a list of available API commands or objects.

  9. Save changes.

    • Generate, validate, and save changes to CloudBees CD/RO server.

      1. Right-click on the object page in the editor or the file name in the project browser.

      2. Select Run.

      3. Select the object name preceded by CloudBees CloudBees logo.

    • Save changes locally in the same manner as other IntelliJ project files.

Validate YAML or Groovy DSL scripts

Use these steps to evaluate DSL scripts.

  1. Open a project file in IntelliJ.

  2. Select the CloudBees CloudBees CD/RO Manager icon.

  3. Select the evalDSL EvalDSL DSL icon. The Evaluate DSL tab displays.

  4. Enter DSL script text.

    1. Add the import and auto-complete commands to lines 1 and 2 in the DSL file.

      import com.electriccloud.client.groovy.ElectricFlow ElectricFlow ef = new ElectricFlow()
    2. Use ef. to access a list of available API commands or objects.

  5. Select execute to evaluate the script.

  6. Select Execute. The script evaluation results are displayed in the plugin Console.

    Save the script as detailed in the Create an applications pipeline, releases, or environment section.