Creating a Source Code Job
The software package or image package can be generated with a few clicks in a build job. In this way, the entire process of source code pull, compilation, packaging, and archiving is automatically implemented.
- Images built in the x86-system jobs are ones of the x86 system.
- Images built in the Arm-system jobs are ones of the Arm system.
Prerequisites
- A cluster has been created. For details, see Creating a CCE Cluster.
- An EIP has been bound to the build node. For details, see Assigning an EIP and Binding It to an ECS.
Procedure
- Log in to ServiceStage, choose Continuous Delivery > Build, and click Create Source Code Job.
- Configure basic information.
- Enter Name.
- (Optional) Enter Description.
- Set Code Source.
- Create authorization by referring to Authorizing a Repository and set the code source.
- Click Samples and select a required sample.
- Select a cluster from the Cluster drop-down list.
- (Optional) Specify Node Label to deliver the build job to a fixed node based on the node label. For details about how to add a node label, see Adding a Node Label.
- Click Next.
- Select a build template.
- Select an archive mode.
- Not archived: No Docker build job is added or archived.
- Archive binary package: No Docker build job is added and binary packages are archived.
- Archive image compilation: Docker build job is added and Docker images are archived.
- Set mandatory parameters.
To delete a parameter setting, click on the parameter setting page.
- Build parameters
Compilation parameters are set with different values. For details about parameter description, click a text box or next to it.
- Image parameters
On the page, enter Job Name, Dockerfile Path, Image Name, and Image Tag.
- Image archiving parameters
On the page, enter Job Name, Archive Image, Repository Organization, and Type of the corresponding image to archive the image.
- Binary parameters
On the page, set the following parameters.
Parameter
Description
Task Name
Task name.
Sharing Type
Repositories are classified into public repositories and private repositories.
- Public repositories are isolated from each other. Tenants in the same system can resources.
- Private repositories are isolated by tenants. Users under the current tenant share resources. Other tenants cannot access resources of the current tenant.
Repository Organization
Namespace of a repository.
Software Repository
Name of a software repository.
Name
Name of the archived software package after the build completes.
Software Package Version
Version of the archived software package.
Build Package Path
Address of the binary software package generated after the compilation and build are complete. For example, ./target/xxx.jar in the Java project.
- Build parameters
- (Optional) Click Advanced Configuration to set the environment.
To add multiple tasks, you can customize them in Advanced Configuration.
- Click Add Plug-in in the corresponding stage on the left. The Select Job Type page is displayed.
- Click Select of the target task type to add a task type. Then, configure task parameters in the right pane of the Environment Configurations page.
When the Build Common Cmd plug-in is added to the compilation process, pay attention to the following:
- Exercise caution when inputting sensitive information in the echo, cat, or debug command, or encrypt sensitive information to avoid information leakage.
- When Language is set to Python and Python Framework Type is set to a Python project that complies with the WSGI standard, you need to set Main Python Module and Function of the Main Python Module. The following is an example of the main Python module and main function:
Main Python Module: If the entry point file of the Python project is server.py, the main module name is server.
Function of the Main Python Module: If the application function name of the Python project entry point file server.py is app=get_wsgi_application(), the function name of the main module is app.
- Click Build to save the settings and start the build.
Click Save to save the settings (not to start the build).
Related Operations
After an application component is successfully built, you can manage it on ServiceStage. For details, see Deployment Mode.
Maintenance
Operation |
Description |
---|---|
Query details/build history |
|
Build Now |
Select the target build project and click Build Now in the Operation column. |
Branch/Tag |
Select the target build project created based on source code and click Branch/Tag in the Operation column.
|
Edit |
Select the target build project you create and choose More > Edit in the Operation column to edit the build project. |
Delete |
|
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