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:
    • Select Visual Builder under Instance Type and Instance List (preferred) under Add Instance Using; 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, specify the authorization type to run this build step. With Use OAuth selected by default, you'll see the Authorization is required message, indicating that this build step needs a one-time authorization to handle OAuth requests to your test environment's Visual Builder instance. Click Authorize and enter credentials to access your 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.

    Once authorized, the Authorization has been provided message shows.

    Note:

    OAuth is the recommended authorization type. Use Basic authentication only if you run into issues with setting up an OAuth connection. To use Basic authentication, select Use Basic, then enter the credentials of a user who can access the test instance in Username and Password.

    OAuth tokens (access and refresh) are cycled during regular use. A refresh token is used to obtain an access token whenever a user accesses the target instance. This refresh token is typically valid for seven days. (The token expiration time is set in the IDCS resource app and may be different based on your security requirements.) If the user authenticates with the target instance within the seven-day period, the active refresh token generates a new access token and a new refresh token. This cycle continues indefinitely as long as the refresh token stays valid. If the refresh token expires during extended periods of inactivity (say, when you're away on vacation), click Renew Authorization (or run the job manually, so you're prompted to authorize any expired OAuth tokens).

  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. To deploy to the test instance, specify the test branch when you click Publish in the Designer. Depending on how you configured the packaging job, deploying to the test branch can automatically trigger the pipeline.

Or, you can manually run the pipeline. (As a 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.)

To manually run the pipeline:

  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 URL for Your App

2. Create a new production branch in your project's Git repo for changes that are ready for production. After this branch is created, 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, specifically the packaging and deployment jobs. Create and Configure Production Build Jobs
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.