Configure a Job to Manage a Deployed Extension

VB Studio provides you with build steps that you can add to a job to perform lifecycle operations on extensions and App UIs. VB Studio provides these build options as Application Extension build steps that you can configure in a packaging job or in separate build jobs that you can add to a CI/CD pipeline.

These lifecycle operations include:
  • Auditing and testing extensions before deploying them

    The Audit, Test, and Package build steps can be in separate jobs or, for simplicity, you can add the Test and Audit (in whatever order you want) steps before the Package step in the packaging job, as we show next.

  • Deleting extensions when they're no longer needed

    Using a Delete build step in a job actually deletes an extension version. On the other hand, deleting an extension from the Manage Lifecycle Extension page deletes all versions of an extension, and is considered the recommended best practice.

Tip:

If you create a separate job for each task, after you create and configure the lifecycle management build steps, you may want to add the jobs, in some combination, to the pipeline you created for the packaging and deployment steps for that testing or production instance. By integrating these build steps in your deployment process, you'll ensure a more robust and error-free process when upgrades are done through deployment.
To configure these options in an existing packaging job:
  1. In the left navigator, click Builds Builds .
  2. In the Jobs tab, select the package job and click Configure.

    An extension created through the Edit Page in Visual Builder Studio workflow in an Oracle Cloud Application includes a default Application-Extension-Package build job that packages the application extension's sources—but whether the job is enabled or disabled depends on your extension's CI/CD Pipeline setting.

  3. On the Job Configuration page, click Steps.
  4. Click Add Step, select Application Extension and select the option you want to add to the job:
    Build options available for an application extension when you click Add Step for a packaging job

    These options automate CI/CD tasks for you. Each option has its own set of parameters. Some operations should follow a particular order. For example, the Audit and Test steps should be performed before the Package step, and all three steps must precede the Deploy step.

    See the following for more information about each option:
  5. When you're done, click Save.

Configure a Job to Audit and Test Your Extension

VB Studio provides capabilities for auditing your extensions and running action chain tests you've defined in your Oracle Cloud Application extension. For your convenience, VB Studio provides these operations in Build steps, so you can define all the necessary arguments and option overrides in one place for a build job or to include in a pipeline that simplifies automating the CI/CD lifecycle.

See Debug and Audit Your Code and Test Action Chains for more information about auditing and testing extensions.

Create a Build Step to Audit Your Extension

  1. From the Git tab on the Job Configuration page, select Git from the Add Git dropdown and then select the repository that was created for the extension in Repository.
  2. In the Parameters tab, select String Parameter from the Add Parameter dropdown list. Enter OUTPUT_FILE in Name.

    The default value is auditoutput.json.

    This parameter is used to override the default Grunt options as well as in the artifact archival.

  3. In the Steps tab, select Add Step, Application Extension, and Audit.

    In the Application Extension Auditing panel:

    1. Enter the extension's identifier in the Extension ID field and the extension's version in the Extension Version field.

      You can find these values by viewing the extension's details on the Manage Extension Lifecycle page, accessible from the Environments page.

    2. In Options, enter auditoutputfile=$OUTPUT_FILE, using the parameter you defined in step 2.
  4. In the After Build tab, select Artifact Archiver from the Add After Build Action dropdown list.
  5. In the Configure Post Build Actions panel, in Artifacts from files, enter $OUTPUT_FILE in the Files to archive field.
  6. Click Save.

Create a Build Step to Test Action Chains in Your Extension

  1. From the Git tab on the Job Configuration page, select Git from the Add Git dropdown and then select the repository that was created for the extension in Repository.
  2. In the Parameters tab, select String Parameter from the Add Parameter dropdown list. Enter BUILD_DIR in Name.

    The default value is build.

    This parameter is used when the build system executes the Grunt task behind the scenes in the step as well as in the artifact archival.

  3. In the Steps tab, select Add Step, Visual Applications, and Test.

    The Application Extension Testing dialog displays.

    1. In Karma Browser, if you select FirefoxHeadless, it requires a Build Executor template that contains the Firefox software package.

      If you select ChromeHeadless instead, it requires a custom Docker image with Chrome installed, so, you need to create that custom Docker image and then create a Build Executor template to use from that.

    2. For Karma Log Level, select Info, Debug, Warn, Error, or Disable.

      The different log levels will be generated from the tests. Debug is the default level.

    3. In Mocha Timeout, enter a number between 0 and 600,000 milliseconds.
  4. In the After Build tab, select Artifact Archiver from the Add After Build Action dropdown list.

    The Configure Post Build Actions dialog displays.

  5. In the Configure Post Build Actions dialog, in Artifacts from files, enter $BUILD_DIR/build/**/* in the Files to archive field.
  6. Click Save.

Configure a Job to Delete an Extension

If you want to delete a specific extension version that's deployed to an Oracle Cloud Applications instance, you must configure a build job and run it.

You can also use the Manage Extension Lifecycle page to delete extensions, but keep in mind that deleting an extension from that page deletes the entire extension.

Note that there can be only one active extension version at a time. The recommended best practice is to avoid deleting the active extension version because, if you delete it, the extension will become inactive as if it wasn't installed at all. You can, however, delete inactive versions without impacting the currently active deployed extension.

Before you configure and run the job, delete the extension from the DEV instance (or TEST instance, if applicable) and make sure there aren't any adverse effects. For example, let's assume you have an attribute that's hidden in both the extension's business object and the user interface. After you delete the extension, the user interface shows the attribute that's still hidden in the business object. This may cause an error.

To configure the job, make sure you have valid administrator credentials for the Oracle Cloud Applications instance where the extension is deployed.

  1. In the left navigator, click Builds Builds.
  2. In the Jobs tab, click + Create Job.
  3. In the New Job dialog box, in Name, enter a unique name.
  4. In Description, enter the job's description.
  5. In Template, select System Default OL7 for Visual Builder.
  6. Click Create.
    The Job Configuration page opens.
  7. Click the Steps tab.
  8. From Add Step, select Application Extension, and then select Delete.

    This image shows the Application Extension Delete build job page that's partially filled in.


    Description of app-ext-delete-build-step.png follows
    Description of the illustration app-ext-delete-build-step.png

  9. In Instance, select the Oracle Cloud Applications instance where the application is deployed.
  10. In the Authorization section, select Use OAuth or Use Basic to specify the type of authorization used to run this build step.
    • If you selected Use OAuth, the Authorization is required message displayed before authorization indicates that this build step needs to be authorized, either by clicking the Authorize button or by running the build manually and entering the credentials when you are prompted for them at that point. After authorization, the Authorization has been provided message and the Renew Authorization button are displayed.

    • If you selected Use Basic, in Username and Password, enter the credentials of an IDCS user who is not only an Oracle Cloud Applications user, but one who can access the Oracle Cloud Application's instance and undeploy from it. These credentials must be those of a local user, not a federated identity, and must not require multi-factor authentication.

  11. In Extension ID and Version, enter the extension ID and version of the extension you want to delete.
    You can find these items in the extension's details on the Manage Extension Lifecycle page.
    1. In the left navigator, click Environments, then click Extension Lifecycle.


      Description of mel-ui-envts.png follows
      Description of the illustration mel-ui-envts.png

    2. Find the extension you want to delete, and select Extension Details to obtain the extension ID and version.
  12. Click Save.
  13. To run a build, click Build Now.