Updated on 2024-11-15 GMT+08:00

Creating a Package Job

The image package can be generated with a few clicks in a build job. In this way, the entire process of package obtainment, and image compilation and archiving is automatically implemented.

Prerequisites

  1. A cluster has been created. For details, see Buying a CCE Cluster. Create a CCE Turbo or CCE Standard cluster based on your service requirements.
    • The build job starts a build container on the cluster node to perform build-related operations. To ensure build security, you are advised to perform security hardening on CCE cluster nodes. For details, see Forbidding Containers to Obtain Host Machine Metadata.
    • The build job depends on the JDK, Golang, Maven, Gradle, Ant, or Node.js compilation tool preconfigured in the build container.
    • Different IAM users under the same account can perform operations on the same cluster. To cancel the build permission from a specific IAM user, set the servicestage:assembling:create, servicestage:assembling:modify, and servicestage:assembling:delete permissions to Deny by referring to Creating a Custom Policy.
  2. An EIP has been bound to the build node. For details, see Binding an EIP to an Instance.

Creating a Package Job

  1. Log in to ServiceStage.
  2. Choose Continuous Delivery > Build.
  3. Click Create Package Job and set basic information about the build job by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Job Name

    Unique build job name.

    Enter 1 to 64 characters. Start with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).

    *Enterprise Project

    Enterprise projects let you manage cloud resources and users by project.

    It is available after you enable the enterprise project function.

    Description

    Build job description. Enter up to 64 characters.

    *Package Source

    • SWR

      Click Select Software Package and select the corresponding software package. Upload the software package to the software repository in advance. For details, see Uploading the Software Package.

    • OBS

      Click Select Software Package and select the corresponding software package. Upload the software package to the OBS bucket in advance. For details, see Streaming Upload (PUT).

    NOTE:

    The technology stack used by the software package must be Java, Tomcat, Node.js, Python, or PHP.

    *Build Type

    • System default
      1. Select a basic image, which must be the same as the software package compilation language selected for Package Source.
      2. Set Basic Image Tag.
    • Custom Dockerfile
      Enter custom commands in the compilation box.
      NOTICE:

      Exercise caution when inputting sensitive information in the echo, cat, or debug command, or encrypt sensitive information to avoid information leakage.

    • Image

      Select a basic image, which must be the same as the software package compilation language selected for Package Source.

    *Image Class

    • Public: This is a widely used standard image that contains an OS and pre-installed public applications and is visible to all users. You can configure the applications or software in the public image as needed.
    • Private: A private image contains an OS or service data, pre-installed public applications, and private applications. It is available only to the user who created it.

    *Archived Image Address

    Archive path of the image.

    *Cluster

    Select a cluster for build. The cluster must belong to the configured enterprise project.

    If you use the selected cluster to perform a build job, you can deliver the build job to a fixed node through node labels. For details about how to add a label, see Adding a Node Label.

  4. Determine whether to execute the build:

    • If yes, click Build to save the settings and execute the build job.
    • If no, click Save to save the settings only.

Follow-Up Operations

After the build, you can manage the application component on ServiceStage. For details, see Creating and Deploying a Component Based on a Container Using UI Configurations or Creating and Deploying a Component Based on a Container Using YAML Configurations.