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.
Click Switch Branch then expand the branch list to see the available branches in your workspace git repository.
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.
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.
In the Push window, click Push Branch.
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.
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".
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.
Create a Parameter
Click on the Parameters tab.
Click Add Parameter and chose String 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.
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.
A Configure parameters window will open.
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.
Look for "Checking out branch…"
In the future, when you need to deploy a different git branch:
- Create a new git branch or choose an exiting branch.
- Run the "package" job manually.
- Enter the name of the git branch you'd like to deploy.
