Skip to main content

1. Building a Demo Application

In this tutorial, you will create a new ZCP Application for the demo application and configure a pipeline for building it.

Demo Application:​

Adding the Demo Application​

Steps to Set Up the Source Repository:

  1. In the left-side menu of the console, navigate to Dev Tools > Source.

  1. When the Source Repository Dashboard opens in a new window, click the Organizations tab.

  2. In the organization list, click dev-demo (The organization name may vary depending on the test environment).

  3. Click the + button in the top right corner and select New Migration.

  1. In the New Migration screen, enter the following details:
  • URL Address: https://github.com/cloudz-modern-platform-demo/cloud-movie-demo
  • Migration Options: Disable the Mirror option.
  • Owner: Select dev-demo (The actual organization name may differ in your test environment).
  • Repository Name: Enter cloud-movie-demo.
  1. Click the Repository Migration button at the bottom of the screen to complete cloning the sample application.

  2. Create a develop branch in the cloned sample application.

  3. Copy the Gitea repository URL of the created sample application: https://git.dev.cloudzcp.net/dev-demo/cloud-movie-demo.git (The actual Gitea URL may vary depending on your test environment)

Creating a Robot Account for Container Images​

tip

To configure a container image, a robot account must be created in the project's registry.

Steps to Create a Harbor Robot Account:

  1. In the console's left-side menu, go to Dev Tools > Images.

  2. When the Registry screen opens in a new window, select the demo project from the Projects list. (The actual project name may differ in your test environment).

  3. In the demo project screen, navigate to the Robot Accounts tab.

  4. Click the NEW ROBOT ACCOUNT button.

  5. Enter the following details:

  • Name: cloud-movie
  • Expiration time: Select Never.

Then click ADD:

  1. The Name and Token of the created robot account will be displayed.

Since the Token value will not be displayed again, click EXPORT TO FILE at the bottom to save it as a separate file.

Creating the Demo Application​

Steps to Create a Demo Application:

  1. In the console's left-side menu, go to Applications.

  2. Click the Create Application button at the top of the screen:

  1. Select From Git Repository:

  1. Fill in the Application section as follows:
  • Name: Enter cloud-movie
  1. Configuring the Source Repository

a. Enter the following details in the Source Repository section:

In the Git Repository field, enter: https://git.dev.cloudzcp.net/dev-demo/cloud-movie-demo.git (The actual repository name may vary in your test environment).

You can either manually enter the Git Repository URL or copy it directly from the previously created Gitea Repository.

b. Click the Manage button next to the Secret field to create a secret for the source repository.

c. In the Secret popup window, click the Add button at the top.

d. Enter the following details:

  • Name: cloud-movie-secret
  • Username: Your user ID
  • Password: Your password

e. Click Save to complete the setup and close the popup window.

f. In the Secret field, select the newly created cloud-movie-secret.

g. Click Test Connection to verify the connection.

  1. Configuring the Container Image

a. Enter the following details in the Container Image section:

  • Check Yes for the Image Build option
  • If unchecked, only the application build will be performed without an image build.

b. In the Image Repository field, enter: dev-registry.dev.cloudzcp.net/demo/cloud-movie (The actual repository name may vary in your test environment).

c. Click the Manage button next to the Secret field to create a secret for the image registry.

d. In the Secret popup window, click the Add button at the top.

e. Enter the following details (the actual robot account name may vary in your test environment):

  • Name: cloud-movie-robot
  • Username: The robot account name (e.g., robot-skccproject+cloud-movie)
  • Password: The token value from the previously created robot account

f. Click Save to complete the setup and close the popup window.

g. In the Secret field, select the newly created cloud-movie-robot.

h. Click Test Connection to verify the connection.

  1. Review all the inputs and click Save to create the ZCP Application.

Creating Build Pipelines​

Steps to Create a Build Pipeline:

  1. Click the Build Pipeline tab.

  1. The demo application requires two pipelines: develop and production.

  2. First, create the develop pipeline with the following settings:

  • Enter develop in the Pipeline Name field.
  • Enter develop in the Branch field (do not check the checkbox). Checking the box allows selecting a branch as an input each time the pipeline runs.
  • Select maven for Build Tool.
  • Select jdk-8 for JDK Version.
  • Enter clean package in the Maven Goals field.
  • Select Disabled for SonarScanning.
  • Enter develop in the Auto Tagging > Tag Prefix field.
  • Click Save to create the pipeline.

Running Each Pipeline​

Steps to Run a Pipeline:

  1. In the Applications menu, click the Overview tab.

  2. Navigate to the Build Pipeline tab, where the two created pipelines will be listed.

  1. Start the develop pipeline:
  • Click Run in the Actions column for the develop pipeline.
  1. When the Run button is clicked, the console starts building the source code and pushing it to the registry.
  • The build logs can be viewed in real-time in the Build Log popup window.
info

Once the build is complete, the Result field in the popup window will display Success or Failed.

After both pipelines are built, the build results can be viewed in the Overview tab, as shown below.