Help Center/ ServiceStage/ Best Practices/ Hosting a Spring Boot Application on ServiceStage/ Deploying and Accessing Spring Boot Applications
Updated on 2024-11-15 GMT+08:00

Deploying and Accessing Spring Boot Applications

To deploy and access Spring Boot applications, perform the following steps:

  1. Creating and Deploying Spring Boot Application Components
  2. Accessing Spring Boot Applications

Creating and Deploying Spring Boot Application Components

  1. Log in to ServiceStage.
  2. Choose Application Management. The application list is displayed.
  3. Click Create Component in the Operation column of the application created in Creating an Application (for example, springGuides).
  4. In the Basic Information area, set the following mandatory parameters. Retain the default values for other parameters.

    Parameter

    Description

    Component Name

    Enter a component name, for example, spring-boot.

    Component Version

    Enter 1.0.0.

    Environment

    Select the environment created in Creating an Environment, for example, env-test.

    Application

    Select the application created in Creating an Application, for example, springGuides.

  5. In the Component Package area, set the following mandatory parameters. Retain the default values for other parameters.

    Parameter

    Description

    Stack

    Select Java.

    Source Code/Software Package

    1. Select Source code repository.
    2. Select GitHub,
    3. Authorization: Select the authorization information created in Setting GitHub Repository Authorization.
    4. Username/Organization: Select the username used to log in to GitHub in Forking Source Code.
    5. Repository: Select the name of the Spring Boot source code repository that has been forked to your GitHub account. For example, gs-spring-boot.
    6. Branch: Select boot-2.7.

  6. In the Build Job area, set the following mandatory parameters. Retain the default values for other parameters.

    Parameter

    Description

    Command

    1. Select Custom command.
    2. Enter the following command in the command text box:
      cd ./complete/;mvn clean package

    Organization

    Select the organization created in Creating an Organization.

    An organization is used to manage images generated during component building.

    Environment

    Select Use current environment to use the CCE cluster in the deployment environment to which the component belongs to build an image.

    In the current environment, masters and nodes in the CCE cluster must have the same CPU architecture. Otherwise, the component build fails.

    Figure 1 Configuring build parameters

  7. Click Next.
  8. In the Access Mode area, click to enable Public Network Access and set public network access parameters for the component by referring to the following table.

    Parameter

    Description

    Public Network Access

    Enable this option.

    Public Network Load Balancer

    By default, managed ELBs in the deployment environment to which the component belongs are selected.

    Client Protocol

    Retain the default value.

    Domain Name

    Select Bind Domain Name and enter the public domain name obtained in Preparing Resources.

    Listening Port

    Enter 8080.

  9. Click Create and Deploy.

Accessing Spring Boot Applications

  1. Click in the upper left corner to return to the Application Management page.
  2. Click the application created in Creating an Application (for example, springGuides). The Overview page is displayed.
  3. In the Component List area, locate the row that contains the component name (for example, spring-boot) configured in Creating and Deploying Spring Boot Application Components and click the access address in the External Access Address column to access the application.

    If information similar to the following is displayed, the application is successfully deployed:
    Greetings from Spring Boot!