Before You Begin
This 15-minute tutorial shows you how to publish your web application by merging your changes to the project's master branch using VB Studio.
Background
When the process of reviewing your HR web application is done, you are ready to publish the application and make your changes public. Publishing an application saves your application's code to a remote branch and then to the project's master branch. You can use the Commit and Push Git options in your workspace to save your changes to a remote branch (as we did in a previous tutorial), then use the Merge option to push your changes to the master. Or, you can do all of this at the click of a single Publish button, as we'll do in this tutorial.
No matter how you decide to save your changes, it's a good idea to always get your code reviewed and approved before you merge it to the project's master branch. Because the master code base is meant to be stable, it is usually protected, requiring code to be reviewed through a merge request. If your project was set up to protect the master branch, merging your changes to the master will require approval. In this tutorial, you'll create a merge request to review your changes, but for demonstration purposes, you'll merge the code to the master without approval.
Once your changes are successfully merged, VB Studio automatically deploys the web application to your Development environment and creates a permanent URL to access the application.
What Do You Need?
- Access to VB Studio
- A supported browser
- Completion of the previous tutorials
Create
a Merge Request for Approval
Now that you are ready to publish your changes to the project's master branch, let's create a merge request to let someone sign off on your changes.
- Click Workspaces
, then HR Visual Application in the Workspaces table.
- In the header, click Publish.
- In the Publish Changes dialog box, click Merge After Review.
- Enter a message for your commit, select another project
member as a reviewer, and click Publish Changes.
Description of the illustration create_mr.png Once the request to merge your changes from the hrbranch to the master branch is created, click Close. Both your reviewer and you will be notified that a new merge request has been created.
Description of the illustration create_mr_result.png - Return to the project home, then click Merge Requests
in the left navigation. For a quick summary of the merge request, click Details
.
- Click #1 Merge Request for branch 'hrbranch'. All details of the merge request, including
its current status and all previous commits, are shown:
Description of the illustration create_mr_view.png You can't create another merge request within the Designer until your changes are merged, but you can use the Commit and Push options in the header's Git repository menu to update a merge request that's pending approval.
Merge
Changes to the Master Branch
Let's assume your merge request has been approved. We're now ready to merge your changes to the project's master branch in the remote repository.
- Click Merge on the Merge Requests page.
- In the Merge dialog, enter a message, select Delete branch if you want to delete the branch after the merge, and click Create
a Merge Commit.
Description of the illustration merge_mr.png The merge request shows as Merged. If you didn't choose to delete the branch, you can do so now if you want.
Once your changes are merged, VB Studio triggers the package and deploy jobs in your pipeline to deploy your web application to the Development environment. Click Builds
to view the progress of your build jobs.
Description of the illustration merge_mr_result.png
View
the Deployed Application
After your application is successfully deployed to the Development environment, you can view it from your environment's list of deployments.
- In the left navigation, click Environments
, then Deployments.
- Expand the tutorial-hr-project that shows
the Deployed status, then
click the hrwebapp application.
Description of the illustration deployed_application.png The application opens in a new browser tab, but without any data. While you can use an empty database in your Development environment, in this tutorial, we'll import data for the application in the next step.
Import
Data to the Deployed Application
A deployed application does not automatically include its business object data, so you'll need to manually import data for the application in the Development environment. You can import the data you used in your workspace or add entirely different data, as we'll do now.
- Click this
link and download the
HR_Application.zip
file. The zip file contains CSV files of the Location, Department, and Employee business objects with more records and data. - In the Environments page,
click Actions
for the deployed tutorial-hr-project and select Import Data.
Description of the illustration deployed_application_import_data.png - In the Import Data dialog box, click the upload box, select
the
HR_Application.zip
file you previously downloaded, and click Import Data. When the import succeeds, click Close.Description of the illustration deployed_application_import_data_1.png - Refresh the hrwebapp application that you
opened previously in a browser tab.
The application displays the newly imported data. When you've finished using the application, close the browser tab.
If you now want to make changes to your application, you'll need to create a new branch off your project's master branch. You can do this in your existing workspace using the Switch Branch option in the Git repository menu. You can also clone this repository in a new workspace using the Clone From Git option on the Workspaces page and start afresh.