X

The Visual Builder Cloud Service Blog

Automate Visual Application's CI/CD with Visual Builder Studio

Shay Shmeltzer
Director of Product Management - Oracle

Oracle Visual Builder Studio offers an improved experience for packaging and deploying Visual Applications. We now offer declarative built-in tasks that let you package and optimize your app, deploy it (either stage or live version), and manage the data stored in the app. These declarative tasks are based on an updated set of Grunt tasks available for Visual Builder, which can also be leveraged in other CI/CD platforms.

One of the nice features of Visual Builder Studio is that it automatically creates a CI/CD pipeline for your app when you create a workspace for a new or imported app. In this blog we explain what is actually being created, so you can implement additional CI/CD flows either in VBStudio or outside.

Packaging the App

The first build step we use is the package option for Visual Application - this step processes the code from your git repository, and creates zip files that contain an optimized version of your app ready to be deployed. Under the hood we are using the vb-process-local grunt task to achieve this. We then archive the resulting artifact so they can be picked up by the next build step - the deploy step.

Package Step

Deploying the App

The deploy build job uses an Oracle Deployment step, that works together with the environments defined in your VBStudio project, to pick up the optimized app and deploy it to a target Visual Builder server. You'll see that this step allow you to specify whether the app should be in stage or publish/live mode, and indicate if you want a new database schema or to keep the existing data in the business objects used. This steps uses the vb-deploy grunt task to deploy the artifacts created before.

Deploy Step

Once the jobs are in place you can streamline their execution by including them as part of a pipeline:

Deployment pipeline

Using Grunt Directly

In the video I'm also showing how you can use the same grunt tasks as part of a shell script to do deployment. You can use this approach if you want to package and deploy directly from your machine, or from external CI/CD systems.

The script used is:

npm install
grunt vb-archive:sources --sources-zip-path=build/sources.zip vb-process-local vb-package vb-archive:optimized --optimized-zip-path=build/built-assets.zip
grunt vb-deploy --url=https://yourserver/ic/builder/ --username=youruser --password=$pass

To learn more about the grunt tasks Visual Builder provides, see our grunt tasks doc.

Here is a demo of the end-to-end flow:

Once your app is deployed, you might need to load data into the business objects that it uses - which are going to be empty initially. You can learn more about doing this with the import data build tasks described in this blog.

Join the discussion

Comments ( 3 )
  • Muhammad N Ahmed Wednesday, November 11, 2020
    Shay, This great info. I been stumbling over it from a couple of days now. Thanks for your all your videos. Please keep 'em coming.
  • Vamsi Friday, December 11, 2020
    Hi Shay,
    Regarding the grunt commands to package and deploy the app, the command is working as expected for the very first time when the target VBCS environment does not contain the application with the ID specified in the vb-deploy command.
    But from the second run, the deployment is failing with an error since the application is already present. If I change the application ID, the deployment goes fine again.
    So the solution seems to first delete the application from the target and then deploy the app. Is this the correct approach? If yes, let me know if it is possible to do with grunt commands itself.

    Thanks,
    Vamsi.
  • Shay Shmeltzer Sunday, December 13, 2020
    Vamsi - once an application is deployed in production (without a version number) to redeploy you'll need to update the version number of the application in the application settings. Then when you deploy it will replace the existing app in place deploying the new version.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.