Deploy to Test and Production Instances

If you're a developer who's fairly comfortable with Git and the development lifecycle, you'll probably want to set things up so you have control of moving your visual app from the development phase into test, and finally to production.

When a project is first created and configured, it's typically set up so that changes committed to the main branch automatically kick off a pipeline that packages the visual app and deploys it to whichever Visual Builder instance was named as the project's Development instance. To deploy your visual applications to other non-production instances, like a test pod or another Development environment, you'll need to create new packaging and deployment jobs and create a pipeline to run the jobs.

Note:

Before you proceed, contact your Visual Builder administrator and make sure that the Visual Builder test and production instances are properly configured and running. For example, you may want to confirm that security options are configured for each instance and the instance points to the correct database for test and production.

Set Up the Project for Testing

When your development cycles are complete, configure the VB Studio project to build and deploy visual applications to a Visual Builder test instance. This involves the following steps:

To perform this action: Do this:
1. Create an environment for the Visual Builder test instance. Your test instance can reside either in the same identity domain as your VB Studio instance or in another identity domain.
  1. Click Go to project page icon at the top left of the header to get to the VB Studio navigator.
  2. In the VB Studio left navigator, click Environments Environments.
  3. Click + Create Environment. In Environment Name and Description, enter a unique name and description, and click Create.
  4. In the Service Instances tab, click Add Instance.
  5. Locate and add your Visual Builder instance:
    • Make sure Instance Type is set to Visual Builder and Oracle Integration and Add Instance Using is set to Instance List (preferred); click Edit icon next to OCI Details, select the region and compartment where your Visual Builder is, and click Update; select your Visual Builder instance from the list; and click Add.
    • If you don't see the instance you want to add (because it's connected to a different OCI account), select the Authentication method as Visual Builder Credentials. In Base URL, enter the Visual Builder instance's URL; update the Instance Name if you want; enter the credentials of a user who can access the Visual Builder instance in Username and Password; and click Add.

      If your target instance is in a different identity domain, OAuth tokens (via three-legged OAuth flows) are used to secure programmatic access to the instance. Before any OAuth tokens can be created, you must provide authorization to acquire OAuth tokens. Click Authorize when prompted, then sign in with credentials to connect and deploy to the instance.

2. Create a new test branch in your project's Git repo.
  1. In the VB Studio left navigator, click Git Git.
  2. Click Refs, then click Branches Branches.
  3. From the Repositories drop-down list, select the repository.
  4. Click + Create Branch.
  5. In the New Branch dialog box, in Name, enter the branch name. From the Base drop-down list, select the main branch as the base branch.
  6. Click Create.
3. Create copies of your existing development packaging and deployment jobs and modify them to deploy to the test instance. Create a copy of the packaging job used for development and modify it:
  1. In the VB Studio 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. Select Copy From Existing.
  6. In Copy From, select the packaging job used for development.
  7. In Template, change the build executor template if needed.
  8. Click Create.
  9. In the Job Configuration screen, click Save.
Create a copy of the deployment job used for development and modify it:
  1. Click Jobs Overview to return to the Jobs tab. Or click Builds Builds in the VB Studio left navigator.
  2. 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. Select Copy From Existing.
  6. In Copy From, select the deployment job used for development.
  7. In Template, change the build executor template if needed.
  8. Click Create.
  9. In the Job Configuration screen, click Before Build.
  10. In From job, select the packaging job that you created for the test instance.
  11. Click Steps.
  12. In Target Instance, select the test instance.
  13. 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 indicates that this build step needs to be authorized. Click Authorize and enter credentials to access your environment's Visual Builder instance; you can also run the job manually and enter the credentials when prompted. Either way, it is recommended that you authorize your OAuth connection during initial configuration. If you skip this step, you won't be able to publish your changes from the Designer and will need to complete the required authorization before attempting to deploy changes again.

      Once authorized, the Authorization has been provided message shows.

      If the OAuth token used to authorize the connection expires during extended periods of inactivity (say, when you're away on vacation), you can click Renew Authorization to renew the token (or you can run the job manually, so you're prompted to authorize any expired OAuth tokens).

    • If you selected Use Basic, in Username and Password, enter the credentials of a user who can access the test instance.
  14. Click Save.
4. Set up a pipeline for the test instance.
  1. In the VB Studio left navigator, click Builds Builds.
  2. Click Pipelines.
  3. Click + Create Pipeline.
  4. In the Create Pipeline dialog box, in Name and Description, enter a unique name and description.
  5. Click Create.
  6. Right-click the Start node, and select Add New Start Jobs.
  7. Select the packaging job you created for the test instance and click Save.
  8. To run the deployment job after the packaging job successfully completes, right-click the packaging job, select Add, then Add New on Success Jobs.
  9. Select the deployment job you created for the test instance and click Save.
  10. Click Save on the Pipeline Configuration page.
5. Run the pipeline. In most cases, you'll want to have this pipeline automatically triggered when anyone commits to main, but you do have the option to run the pipeline manually. (As an developer working alone or with just a few others on a project, it's unlikely that this option would appeal to you, but it does exist.)
  1. Click the Pipelines tab and locate the pipeline you want to run.
  2. From the Actions Actions menu menu, click Run Pipeline.

    You can also click the pipeline name to get to the Pipeline Details page, then click Run.

Set Up the Project for Production

When you're ready to move your visual app to production, the process is similar, with a few additional steps:
To perform this action: See this:
1. Create an environment for your Visual Builder production instance.

(Optional) Confirm the instance and environment are set up correctly for deploying to a custom URL.

Set Up Additional Deployment Instances

Specify a Custom App URL

2. Create a new branch in your project's Git repo for changes that are ready for production. After creating this branch, any changes pushed to the main branch won't be added automatically to the production branch. Instead, you must create a merge request or manually push the changes to the production branch, as a means of protecting the branch against untested or unwanted additions. Create a Production Branch
3. Create and configure the production build jobs:
  • Create a packaging job
  • Create a deployment job
4. (Optional) Restrict users who can edit the production jobs or run their builds. Configure a Production Job's Privacy Setting
5. Set up the pipeline. Create and Configure a Pipeline
6. Run the pipeline. Run the Pipeline

See Set Up the Project to Deploy for Production in Administering Visual Builder Studio.