Using a Custom Build Environment
If the tool version supported by CodeArts Build does not meet your requirements, you can use a custom image that has been uploaded to SWR.
Setting the Image Type to Public
Private images in SWR cannot be pulled by CodeArts Build during the build process. Therefore, you need to set the image type to Public before starting the build.
- Log in to SWR.
- In the navigation pane, choose My Images, click the image name to go to the image details page, and click Edit in the upper right corner.
- In the displayed dialog box, set Type to Public and click OK.
Figure 1 Editing an image
- To obtain the complete image path, click to copy the image download command. The part following docker pull is the image path.
Build on GUI
Add Use SWR Public Image when configuring build actions step. Set the parameters according to Table 1.
Parameter |
Description |
---|---|
Action Name |
Assign a custom name to the build action. The name can contain:
|
Image Address |
Enter the image path obtained in 4. |
Commands |
Configure commands, or use the default ones. If you have special build requirements, enter your custom build script in the text box. For example, if the image is used for a Maven build, configure commands for building with Maven. For an npm build, configure commands for building with npm. This rule also applies to other builds. |
Continue After Failure |
Specify whether to proceed after the current action fails by setting the parameter to either Yes or No. |
Build with Code
Modify the code in the BUILD block in Creating a YAML File for Your Code-based Build by referring to the following sample code:
1 2 3 4 5 6 7 8 |
version: 2.0 # The value must be 2.0. steps: BUILD: - swr: image: cloudbuild@ddd inputs: command: echo 'hello' ignore_fail: true |
Parameter |
Type |
Description |
---|---|---|
image |
String |
Set the image path in either of the following ways:
|
command |
String |
Configure the command. For example, if the image is used for a Maven build, configure commands for building with Maven. For an npm build, configure commands for building with npm. This rule also applies to other builds. |
ignore_fail |
String |
Whether to proceed after the current action fails.
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot