Help Center/ ServiceStage/ FAQs/ Continuous Delivery/ What Should I Do If I Failed to Use ServiceStage to Build a Job?
Updated on 2023-10-30 GMT+08:00

What Should I Do If I Failed to Use ServiceStage to Build a Job?

There are many causes for software engineering build failures. You can locate faults using the following methods:

Code Cannot Be Pulled

See the following figure.

The possible causes are as follows:

  • If an application is built on your own node, the node may not be bound to an EIP. For example, in the preceding figure, node 192.168.x.x is not bound to an EIP. Solution: Bind an EIP to the node. For details, see Assigning an EIP and Binding It to an ECS .
  • The authorization information has expired, the private token of the code source has low permission, or the authorization information has been removed. For example, code cannot be obtained from the code source of CodeArts. This may be because the user password used during authorization is incorrect. Solution: Authorize the repository again. For details, see Authorizing a Repository.
  • The network between the self-built code source repository and the build node is disconnected. For example, a private Bitbucket is set up on a node in cluster A and the build is performed in cluster B. However, cluster B and cluster A are in different VPCs. As a result, their network is disconnected, and code cannot be pulled up in building. Solution: Connect the network.

Built Code Depends On the Private Maven Repository

There are two solutions:

  • Add the settings.xml file to the root directory of your project, and specify the private Maven repository address in the settings.xml file. If your private Maven repository needs to be authenticated, configure your authentication information, username, and password in the settings.xml file.
  • Specify a private Maven repository in the pom.xml file of your project.

The following is an example of the paths of the settings.xml and pom.xml files:

Dockerfile for Source Code Job Building Is Incorrectly Set

For details about how to write a Dockerfile, see the official website or demo generated based on ServiceStage templates.

Project Code Depends On the CSE SDK and the CodeArts Private Maven Repository

Perform the following steps:

  1. Add the settings.xml file to the root directory of your project.
  2. Log in to the CodeArts private dependency repository and select the specified Maven private dependency repository from the repository list on the left.
  3. Click in the upper right corner and choose Configuration Guide from the shortcut menu.
  4. Click Download Configuration File to download the settings.xml file.
  5. Modify the downloaded settings.xml file as follows:

    1. Add !HuaweiCloudSDK to <mirrorOf>.
      <mirror>
           <id>z_mirrors</id>
           <mirrorOf>*,!releases,!snapshots,!HuaweiCloudSDK</mirrorOf>
           <url>https://repo.hauweicloud.com/repository/maven</url>
      </mirror>
    2. Add a Maven repository under <repositories> in <profiles>.
      <repository>
            <id>HuaweiCloudSDK</id>
            <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url>
            <releases>
      	  <enabled>true</enabled>
            </releases>
            <snapshots>
      	  <enabled>true</enabled>
            </snapshots>
      </repository>

  6. Place the modified settings.xml file in the root directory of your project and build the job.

Customizing Dockerfile When Software Package Building Job Is Created

When you select a software package, the system automatically uploads the software package to the current working directory of the image. The following shows a Dockerfile example.