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 a previous version. While it is rare (and discouraged), sometimes even your version controlled code can have its history altered. Using the build package helps to ensure that you are deploying the same version of your application as before. If you would rather rebuild and deploy directly from a git branch see this article.
Redeploy a Previous Build Artifact
In Visual Builder Studio switch to the Builds section and open the "package" job for your extension. The following examples use an extension called "blaine-blog", so the job is named "blaine-blog-package".
Choose a previous build
The Build History table contains summary information about the previous build runs. Locate the number for previous build you'd like to re-deploy.
If you don't know the date and time of the build you're looking for, you can find additional details for each build by clicking on the Build number.
Clicking the Changes icon will display the information for the git commit created when the extension was published.
The Summary line displays the commit message, who made the change and the timestamp of the commit.
Clicking the Commit Id will take you to the commit point for that build in the git repository where you can get more information.
Tag your builds
To make it easier to find a build next time, you can add information to the important builds.
Click the build number to open the details page then click the Configure button.
The Build Name contains the text displayed in the Build column of the Build History.
If you populate the Build Description, an * will be added to the build name and will be displayed in its hover text.
Important – Keep track of the number in original Build Name, either in the description or the Name, you will need it later.
Old builds are only retained up to the limits set in the configuration of the build job. Checking the Keep Build Forever box will exclude this job from being deleted when those limits are reached. Builds with this check will display a thumbtack icon next to the build name.
New Deploy Job
You could modify the existing "Deploy" job to pull the artifact from your selected build. But, if you forget to change it back all of your future jobs would attempt to publish this same version. It's better to create a new job.
Go to the Builds page and click the Create Job button.
The job Name is required.
A Description is optional, but it's a good idea to include a detailed description.
Check the Copy From Existing button, then choose the "deploy" job for your extension.
The Template field will be populated for you.
Click the Create button.
Choose a release
Switch to the Before Build tab. This is where you can choose which release you would like to re-deploy.
You could change Which build to 'Specific build' and hard code the value here, but in the future you would need to modify this job again each time you run it.
A better solution is to base the build choice on a job parameter.
Change Which build to Specified by build parameter.
You can use the default Parameter name or set your own.
Create a Parameter
Click on the Parameters tab.
Click Add Parameter and chose String Parameter
Enter the value you used for Parameter name on the Before Build tab.
The Description is optional, but it's a good idea to enter a detailed description.
Click Save.
Delete the current version
The deploy process has safeguards in place to make sure you don't accidentally deploy an older version. In order to deploy an older build, you need to delete the current version.
Open the Environments section of Visual Builder Studio and click on Extension Lifecycle.
Locate your application extension and click the Delete button.
A confirmation window will be displayed. Verify that you're about to delete the correct extension and click the Delete button.
Once the extension has been deleted click the Close button.
Run the new job.
Open the Builds section of Visual Builder Studio.
Locate the Re-Deploy job and click the Build button in the Actions column.
A Configure parameters window will open.
Enter the number of build you would like to re-deploy. Click Build Now.
Your new build job will run and deploy the build artifact from your selected build job.
In the future, when you need to re-deploy a previous job:
- Delete the current deployed extension under Environments.
- Get the number of the Package build job you want to re-deploy.
- Run the Re-Deploy job using the build job number.
