Configure a Job to Manage a Deployed Visual Application

If your visual application is deployed to a different identity domain or if your application URL includes the version, you need to add and configure steps in a build job to perform lifecycle operations. VB Studio provides these build options as Visual Application build steps that you can configure in a deployment job.

These lifecycle operations include:
  • Importing business object data to and exporting data from visual applications
  • Locking and unlocking active deployments so they can be upgraded in place
  • Rolling back upgrades to a previous version
  • Auditing and testing visual apps before deploying them
  • Undeploying visual apps when they're no longer needed

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

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 a packaging job:
  1. In the left navigator, click Builds Builds .
  2. In the Jobs tab, select the packaging job and click Configure.

    A visual app includes a default Visual-Application-Package build job that packages the visual application's sources.

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

    These options are Grunt-based commands that 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 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 Visual Application

VB Studio provides NPM packages (grunt-vb-audit, grunt-vb-test) that include the vb-audit and vb-test Grunt tasks. You can use vb-audit to audit your visual applications and use vb-test to run action chain tests you've defined in your visual application. For your convenience, VB Studio provides these Grunt tasks in Build steps, that enable you to define all the necessary arguments in one place for a build job or to include in a pipeline that simplifies automating the CI/CD lifecycle.

See Audit Your Application Using the vb-audit Grunt Task and Test Action Chains Using the vb-test Grunt Task for more information about using Grunt tasks to audit application sources and test action chains in visual applications.

Create a Build Step to Audit Your Visual Application

  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 application 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, Visual Application, and Audit.
    In the Visual Application Auditing panel:
    1. In Target Environment, select the environment associated with the workspace that was cloned to create the app.

      The values for the Username and Password fields will be populated automatically with the user credentials associated with the environment that was selected.

    2. The Application URL Root will automatically be filled in, using the name of the Git repository.
    3. The Application Version will automatically be filled in.
    4. 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 Visual Application

  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 application 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 Visual Applications Testing dialog displays.

    1. In Target, enter $BUILD_DIR that you created in the Parameters tab.
    2. 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.

    3. 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.

    4. 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 Import Data to or Export Data from a Visual Application

To import data to or export data from a visual application that has business object data with a job, you need to add the visual application Import Data or Export Data steps to a build job, along with the steps for copying or archiving the artifact that contains the data. You also need the credentials of a user who can access the Visual Builder instance where the visual application is deployed.

  1. In the left navigator, click Builds Builds.
  2. In the Jobs tab, click + Create Job.
  3. In the New Job dialog, in Name, enter a unique name.
  4. In Description, enter the job's description.
  5. In Template, select the System Default OL7 for Visual Builder template.
  6. Click Create.
    The Job Configuration page displays.
  7. Click the Steps tab.
  8. From Add Step, select Visual Application, and then select Export Data or Import Data.
  9. In Instance, select the Visual Builder instance where you want to import or export business object data.
  10. In Username and Password, enter the user's credentials who can connect to the Visual Builder instance.
  11. In Application URL Root and Application Version, enter the visual application's root URL and its version.
    You can find the application's root URL and its version from the Deployments tab of the environment where the visual application is deployed.

    Example:

  12. In Artifact, enter the name of the ZIP file to contain the business object data to import or export. For example, enter bodata.zip.
  13. Add additional steps to the job to complete the import or export operation.
    For example, to complete exporting data you need to add an after build action that archives the artifact (bodata.zip, in our example) while you typically need to copy an artifact from another job for import business object data. See Archive Artifacts and Copy Artifacts from Another Job for more information.
  14. Click Save.

Configure a Job to Lock, Unlock, or Roll Back a Deployed Visual Application

If you deployed your visual application to a different identity domain or if the application URL includes the version, you need to add and configure steps in a build job to perform lock, unlock, or rollback operations. After you create and configure the lifecycle management build steps (lock, unlock, rollback), you may want to add them, in some combination, to the pipeline you created for the packaging and deployment steps for that testing or production instance.

Tip:

If you deployed a visual application to a Visual Builder instance that's in the same identity domain as your VB Studio instance and if the URL doesn't include the application version (live, rather than the application version, appears in the application URL you're rolling back) , you can roll the application back to a previous version from your Environments page's Deployments tab, using the Rollback menu option when you've deployed your visual application more than once. You can only roll back one previous version at a time.

  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 the System Default OL7 for Visual Builder template.
  6. Click Create.
    The Job Configuration page displays.
  7. Click the Steps tab.
  8. From Add Step, select Visual Application, and then select one of the following:
    • Lock prevents users from accessing the web application in the deployed visual application when you have maintenance tasks to perform.
    • Unlock removes the lock on the web application after the maintenance tasks have been completed.
    • Rollback restores the previous version of the deployed visual application.
  9. Fill out the required fields in the respective dialogs that display:
    1. In Instance, select the Visual Builder instance where the application is deployed.
    2. In Username and Password, enter the user's credentials who can connect and undeploy from the Visual Builder instance.
    3. In Username and Password, enter the user's credentials who can connect and undeploy from the Visual Builder instance.
    4. In Application URL Root and Application Version, enter the visual application's root URL and its version.

      You can find the application's root URL and its version from the Deployments tab of the environment where the visual application is deployed.

      For example:

      Note:

      The version that you specify to roll back must be the latest version of the application. If the version isn't the latest, you'll see an HTTPS status 400 error when you run the rollback job. So, if the latest version of the application is version 2.3, that is the version you specify to roll back, not version 2.2 or any other earlier version.
  10. Click Save.

Configure a Job to Undeploy a Visual Application

You'll need the credentials of a user who can access the Visual Builder instance where the visual application is deployed to undeploy a visual application through a build job:
  1. In the left navigator, click Builds Builds.
  2. In the Jobs tab, click + Create Job.
  3. In the New Job dialog, in Name, enter a unique name.
  4. In Description, enter the job's description.
  5. In Template, select the System Default OL7 for Visual Builder template.
  6. Click Create.
    The Job Configuration page opens.
  7. Click the Steps tab.
  8. From Add Step, select Visual Application, and then select Undeploy.
  9. In Instance, select the Visual Builder instance where the application is deployed.
  10. In Username and Password, enter the user's credentials who can connect and undeploy from the Visual Builder instance.
  11. In Application URL Root and Application Version, enter the visual application's root URL and its version.
    You can find the application's root URL and its version from the Deployments tab of the environment where the visual application is deployed.

    For example:

  12. Click Save.
  13. To run a build, click Build Now.