Sometimes, despite your best efforts, you may need to roll back a published extension to a previous version.  Fortunately Visual Builder Studio has the tools to make it safe and easy.

If you're not familiar with the publish / package / deploy process in Oracle's Visual Builder, you may want to read this article before you continue.

When you rollback an application, it's best to use the actual build package that was deployed in the previous version.  If you do not have the previous artifact you can create a new build package to deploy from a git branch.  If you would rather deploy a previous build package see this article.

Redeploy from a git branch

Choose a branch

At the top of the Oracle Visual Builder page, click on your git repository name/branch to display the git operations.

Switch git branch

Click Switch Branch then expand the branch list to see the available branches in your workspace git repository.

Choose git branch

Some of the branches will be named <user name>-<timestamp>, these are the branches that were created for you each time you published a release.  If you don't know the when the release you are looking for was published you can select a branch, switch to it and use Visual Builder's preview feature to find the branch you want.

Once you've found the branch you'd like to publish, open the git options and click Switch Branch again.  Select the branch you'd like to re-publish.

 

New git branch

Check the New branch from selected box, enter a descriptive name and click the Switch button.  This will create a new branch with your new name.  This branch only exists in the local git repository for your workspace.

Push the new branch

Open the git operations and click Push.

Push button

In the Push window, click Push Branch.

Push to remote git repository

This will push the new branch to the Oracle Visual Builder Studio git repository for your extension.

Switch to Visual Builder Studio

You can switch to Visual Builder Studio by clicking the arrow in the upper left corner next to your workspace name.

Arrow to switch to Visual Builder Studio

Once you're in Visual Builder Studio you can find the build jobs in the Builds section.  Click on name of the "package" job for your extension.  The following examples use an extension called "blaine-blog", so the job is named "blaine-blog-package".

Visual Builder Studio build jobs for publishing from Visual Builder

You are going to configure this job to ask for the git branch you want to deploy when you run it manually.  When you use the publish button in Visual Builder, everything will function as it normally does.

Modify the Package Job

Click the Configure button.

Job configure button

Create a Parameter

Click on the Parameters tab.

VBS Add Build Number Parameter

Click Add Parameter and chose String Parameter

Git branch parameter

The name is required.  Use a descriptive name.

Set the Default Value to "main".

The Description is optional, but it's a good idea to enter a detailed description.

Modify Git Options

Switch to the Git tab.

Git configuration

Change the value in Branches to use the value of the parameter you created above by setting it to $<parameter name>.  Use the name of the parameter you created in the previous step.

The default value of the parameter is set to 'main' so this job will still trigger anytime the main branch changes.

Click Save

Run the Job

Open the Builds section of Visual Builder Studio.

Locate the "package" job for your extension and click the Build button in the Actions column.

VBS Build Action Button

A Configure parameters window will open.

Git branch parameter value

 

Enter the GIT_BRANCH you would like to deploy.

Click Build Now.

Your new build job will run and create a build artifact using the git branch you entered in the parameter.  Once the job finishes it will automatically trigger the deploy job as it normally would.

To verify that it's building from the correct git branch, open the build log.

Build Log Button

Look for "Checking out branch…"

Build log git checkout entry

In the future, when you need to deploy a different git branch:

  1. Create a new git branch or choose an exiting branch.
  2. Run the "package" job manually.
  3. Enter the name of the git branch you'd like to deploy.