Create and Configure Production Build Jobs

You need to set up some packaging and deployment jobs before you can deploy visual applications to your Visual Builder production instance. This topic explains how to do that.

Before you configure production build jobs, make a note of these:

  • In the production packaging job, use the Git repository's production branch to generate production artifacts.
  • In the development packaging job, if you changed the default file names of archive artifact files, get the new names and their paths. You'll need them when you configure the production packaging job.
  • If you configured the development packaging job to overwrite the application's version defined in visual-application.json, get the new version. You'll need it when you configure the production packaging job.
  • While configuring deployment build jobs, you specify whether to include the application's version in its URL. A visual application without the version in its URL is called a Live application. Usually, you deploy a live application to a production instance.
  • If you deploy a version of a visual application that's never been deployed, VB Studio overwrites the last deployed version with the new version.

    VB Studio doesn't undeploy the previously deployed version from the production instance. It continues to remain on the target instance, but is inaccessible.

  • If you want to redeploy a live application or a previously deployed version, undeploy it first, else the deploy build fails. To undeploy a previously deployed visual application version, configure a undeploy build job and run it. You can't undeploy it manually from the Environments page.
  • If you've created an application profile for production, get its name. You'll need it when you configure the production deployment job.

Create a Production Packaging Build Job

The production packaging job generates a visual application artifact that's ready to deploy.

  1. In the 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. In Template, select the System Default OL7 for Visual Builder template.
  6. Click Create.
  7. Click Configure Builds.
  8. Click the Git tab.
  9. From the Add Git list, select Git.
  10. In Repository, select the Git repository. In Branch or Tag, select the production branch.
  11. Click the Steps tab.
  12. From Add Step, select Visual Application, and then select Package.
  13. By default, the build jobs minifies the application's source code before running the build. If you don't want to minify the source files, deselect the Optimize application check box.
    Minification is a process to remove the unnecessary characters (such as blank spaces, new lines, and comments) from the source code and reduce the size of the files, making the transfer of files consume less bandwidth and storage.
  14. If you want to change the default names of the archive files, in File names, select Use custom file names.
    In Sources, specify the visual application source archive file's name and path. In Build Artifact, specify the build artifact archive file's name and path.

    You'll need both archive files to deploy the visual application.

  15. Click the After Build tab.
  16. From Add After Build Action, select Artifact Archiver.
  17. In Files to archive, enter the build artifact name. You can also use wild characters. For example, *.zip.
  18. If you want to discard old artifacts of the build, click Settings the Gear icon. In the General tab, select the Discard Old Builds check box and specify the discard options.
  19. Click Save.

Create a Production Deployment Build Job

The production deployment job deploys the visual application's artifact that was generated in the production packaging job to the Visual Builder production instance. Before you create the job, get the access credentials of a user who can connect and deploy to the Visual Builder production instance.

  1. In the 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. In Template, select the System Default OL7 for Visual Builder template.
  6. Click Create.
  7. Click Configure Builds.
  8. Click the Before Build tab.
  9. From Add Before Build Action, select Copy Artifacts.
  10. In From Job, select the production packaging job that generated the visual application's artifact.
  11. In Which Build, select Last Successful Build.
  12. Leave other fields with their default or empty values.
  13. Click the Steps tab.
  14. From Add Step, select Oracle Deployment.
  15. In Target Instance, select the Visual Builder production instance.
  16. In Username and Password, enter the user's credentials who can connect and deploy to the Visual Builder production instance.
  17. In the production packaging job, if you changed the default file names of archive artifact files, then in File names, select Use custom file names.
    In Sources and Build Artifact, enter the same file names (with path) you specified in the packaging job.

    If you didn't change the file names, use the default option.

  18. (Optional) If you configured the development deployment job to overwrite the application's default version, specify the same version in Application Version. Leave it empty to use the version defined in the application's visual-application.json file.
    If the version is already deployed, undeploy it first.
  19. Deselect the Include the application version in the URL check box.
    When deploying to a production instance, don't include the application's version in the deployed application's URL.
  20. (Optional) In Application Profile, specify the production application profile. Leave it empty to use the application's default profile.

    Your visual application accesses data from different servers for REST services and may need different security settings for different environments, such as development and production. Using application profiles, you can define different combinations of servers and security settings for each of your environments, and use them when deploying the application to an environment. This simplifies management of the visual application as you move through development to production. To learn more, see About Application Profiles.

  21. To use a clean database for the application, in Data Management, select Use clean database.
  22. Click Save.

Configure a Production Job's Privacy Setting

Mark a job as private to restrict who can see or edit a job's configuration, or run its build.

A private job must be run manually. It won't run if a non-authorized user tries to run the job directly, through an SCM/periodic trigger or a pipeline.
  1. In the left navigator, click Project Administration Project Administration.
  2. Click Builds.
  3. Click the Job Protection tab.
  4. From the jobs list, select a production job.
  5. Select the Private option.
  6. In Authorized Users, add yourself.
    Then, to add other users, select them individually or, under Groups, select a group (or groups) of users.
  7. Repeat the steps 4-6 for the deployment production job.
  8. Click Save.

A private job shows a Lock Lock icon in the jobs list on the right side of the Job Protection page, in the Jobs tab of the Builds page, and in the pipelines.

Create and Configure a Pipeline

To ensure the production deployment job runs automatically after the production packaging job, create a pipeline and set the dependency.

  1. In the left navigator, click Builds Builds.
  2. Click the Pipelines tab.
  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. On the Pipeline Configuration page, right-click the Start node and select Add New Start jobs.
  7. Click in the Select new on success job(s) field, select the packaging job and click Save.
  8. Right-click the packaging job and select Add, then Add New On Success Jobs.
  9. Click in the Select new on success job(s) field, select the deployment job, and click Save.

    Here's an example of the finalized pipeline:

  10. Click Save.

Run the Pipeline

When you're ready to deploy the visual application to the production instance, run the production pipeline.

  1. In the left navigator, click Builds Builds.
  2. Click the Pipelines tab.
  3. In development pipeline's row, click the Actions Actions menu and select Run Pipeline.

After a successful build, you'll find the deployed application's link in the Deployments tab of the Environments page.

To view the latest build log of a job, open the Builds page, click the job's name, and then click Build Log.