Visual Builder Studio is not only the place where Fusion app extensions are developed – it is also the platform that takes care of publishing those extensions using build pipelines. This post will walk you through the steps to manually create a package and deploy pipeline, similar to the one created by default, for cases where you started developing using a scratch repository. You can find more information about the publishing process here.
If you were to create a new workspace with a git repository, then the pipeline will be created for you as explained below. But in some cases you might not be sure that you will be using the code – so you start from scratch – we'll cover this in the second part.
- Open the Workspaces section.
- Click New.
- Choose New Application Extension.
- Enter an extension name, the id and workspace names will auto populate to match.
- Chose your development environment. If you don't have one, speak to your administrator to set one up.
- Under Git Repository choose Create new repository.
- Name your repository.
- Enter a name for the git branch you want to start working on.
- Click Create.
Publish from a Scratch Repository
If you chose to create an extension using Scratch Repository, it would not create a Git repository in Visual Builder Studio. Without a Git repository a build deploy pipeline would not have any code to build from, so no pipeline is created.
In order to proceed with building the pipeline you will need a git repository in Visual Builder Studio.
If you used a scratch repository and built an extension that you would like to publish, you can create the missing Git repository by pushing the scratch repository up to Visual Builder Studio.
Open the Visual builder workspace.
- Click on Scratch Repository.
- Click Push.
- Give it a name, a detailed Description and a Commit Message.
- Click Push Repository.
Switch to Visual Builder Studio by clicking the arrow in the upper left corner next to your workspace name.
Open the Git section to review your Git repository.
Now that you have a Git repository, you can create the build jobs and pipeline.
Package Build Job
The package job is the first one in the pipeline. It will collect the needed components from the git repository and package them into a build artifact that will be deployed later in the pipeline.
- Open the builds section.
- Click Create Job.
- Give the job a name. I would recommend something like extensionName-package.
- Enter a detailed description.
- Chose an executor Template. Preferably something similar to System Default OL7 for Visual Builder.
- Click Create.
Git Tab
This is where you link your job to the git repository for your extension.
Click Add Git, Git.
- Choose your Git repository from the drop down list.
- Check Automatically perform build on SCM commit.
- Enter main in Branches.
This will configure the Package job to watch your Git repository. If there are changes to the main branch, the job will start itself.
Steps Tab
- Switch to the Steps tab.
- Click Add Step.
- Under Application Extension choose Package.
The Build Artifact name defaults to extension.vx. You can change it if you want, but either way, save the name, you'll need it later.
After Build Tab
Once the file has been created you need to archive it for other jobs to be able to access it.
- Switch to the After Build Tab.
- Click Add After Build Action.
- Select Artifact Archiver.
- Type or paste artifact name into Files to archive.
- Click Save.
Deploy Build Job
Next you will create a build job that will deploy the packaged artifact to your Application Instance.
- Open the builds section
- Open the jobs tab
- Click Create Job
- Give the job a name. I would recommend something like extensionName-deploy.
- Enter a detailed description.
- Chose an executor Template. Preferably something similar to System Default OL7 for Visual Builder.
- Click Create.
Before Build Tab
You need to get a copy of the artifact from the previous job.
- Switch to the Before Build Tab.
- Click Add Before Build Action.
- Select Copy Artifacts.
Select the package job you created.
Steps Tab
Now that you have a copy of the packaged artifact you can deploy it to your Environment.
- Switch to the Steps tab.
- Click Add Step.
- Select Oracle Deployment.
- Choose your Target Instance. If you don't have one, speak to your administrator to set one up.
- Add the Credentials for a user with deploy permissions.
- If you changed the default name of the build artifact above, enter it in the Build Artifact field.
- Click Save.
Create a Pipeline
The package job will automatically run when the main branch in your Git repository changes. In order to trigger the deploy job, you'll need a pipeline.
- Open the Builds section.
- Open the Pipelines tab.
- Click Create Pipeline.
- Enter a name.
- Enter a detailed description.
- Check Disallow pipeline jobs to build externally when the pipeline is building. This will prevent the build jobs from being run again until the pipeline finishes.
- Click Create.
Drag the deploy and package jobs onto the design field.
- Drag the dot on the Start box to the dot on the left side of the package job.
- Drag the dot on the right side of the package job to the dot on the left side of the deploy job.
- Click Save.
Run the Pipeline
Click the Build button to run the pipeline.
Click on the name of the pipeline to watch the jobs execute.
The jobs will turn green as they complete successfully.
Open Your Extension
Once the pipeline has finished you can find a link to your extension in the Environments section.
- Switch to the Environments section.
- Click on your environment.
- Open the Deployments tab.
- Find and expand the deployment for your extension with the Active check mark.
- Click on the icon on the right side of your App UI's name.
If something goes wrong and you need to revert to a previous version of your extension, you can use one of these methods.
