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.
- 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.- In the left navigator, click Builds
.
- 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. - On the Job Configuration page, click Steps.
- Click Add Step, select Visual Application and select the option you want to add to the 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:- See Configure a Job to Audit and Test Your Visual Application for information about Audit and Test.
- See Configure a Job to Import Data to or Export Data from a Visual Application for information about Import Data and Export Data.
- See Configure a Job to Lock, Unlock, or Roll Back a Deployed Visual Application for information about Lock, Unlock, and Rollback.
- See Configure a Job to Undeploy a Visual Application for information about Undeploy.
- 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
- 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.
- 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.
- In the Steps tab, select Add
Step, Visual Application, and
Audit.
In the Visual Application Auditing panel:
- 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.
- The Application URL Root will automatically be filled in, using the name of the Git repository.
- The Application Version will automatically be filled in.
- In Options, enter
auditoutputfile=$OUTPUT_FILE
, using the parameter you defined in step 2.
- In Target Environment, select
the environment associated with the workspace that was cloned to
create the app.
- In the After Build tab, select Artifact Archiver from the Add After Build Action dropdown list.
- In the Configure Post Build Actions panel, in Artifacts
from files, enter
$OUTPUT_FILE
in the Files to archive field. - Click Save.
Create a Build Step to Test Action Chains in Your Visual Application
- 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.
- 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.
- In the Steps tab, select Add Step,
Visual Applications, and Test.
The Visual Applications Testing dialog displays.
- In Target, enter
$BUILD_DIR
that you created in the Parameters tab. - 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.
- 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.
- In Mocha Timeout, enter a number between 0 and 600,000 milliseconds.
- In Target, enter
- In the After Build tab, select Artifact
Archiver from the Add After Build Action
dropdown list.
The Configure Post Build Actions dialog displays.
- In the Configure Post Build Actions dialog, in Artifacts
from files, enter
$BUILD_DIR/build/**/*
in the Files to archive field. - 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.
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.