Creating a Common Job
- The software package or image package can be generated with a few clicks in job building. 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 Kubernetes Clusters.
- You have bound an elastic IP address to the build node by referring to Assigning an EIP and Binding It to an ECS.
Procedure
- Log in to ServiceStage, choose Continuous Delivery > Build, and click Create Common Job.
- Perform the following operations to set basic information:
- Enter Name.
- Specify Enterprise Project.
Provides a cloud resource management mode, in which cloud resources and members are centrally managed by project.
It is available after the enterprise center is enabled.
- (Optional) Enter a job description.
- Set the code source.
- Create authorization by referring to Authorizing a Repository and set the code source.
- Select a sample library and select a required sample.
- Set a cluster.
- Build with shared cluster
Use the shared cluster allocated by the system. The shared cluster supports Hybrid Cluster and Kunpeng Cluster.
- Build with your own cluster
If you use your own cluster to perform build task, you can deliver build task to fixed nodes through node labels. For details about how to add filter labels, see Node Management.
- Build with shared cluster
- Click Next.
- Select a build template.
The template supports compilation and archive of the binary package or Docker image at the same time. Alternatively, you can click Custom and then flow 6 to add a job directly.
- 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. Click
to delete parameters set. - Compilation parameters
Compilation parameters are set with different values. For details about parameter description, click
next to a text box. - Image parameters
In Make Docker Image, enter Task Name, Dockerfile address, Image, and Image Version.
- Image archiving parameters
In Archive to SWR Image Repository, set Task Name, Archive image, Repository Organization, and Sharing Type of the corresponding image to archive the image.
- Binary parameters
Set the following parameters in Archive to SWR Software Repository:
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
Path of the software package archived to the software repository after the build completes.
- Compilation parameters
- (Optional) Click Advanced Configuration to set the environment. To add multiple tasks, you can customize them in Advanced Configuration.
- Click Add plugin in the corresponding stage on the left. The Select task type page is displayed.
- Click select of the target task type to add a task type. Then, set task parameters in the right pane of the Build environment configuration page.
The command plug-in (Build Common Cmd) supports multiple build languages such as Java, Go, Node.js, PHP, Tomcat, and Python.
When building a Python project that complies with the WSGI standard, you need to set the main module and main module functions.
The following is an example of the main Python project and main function name:
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.
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 | Click Build Now in the Operations column of a job. |
| Branch/Tag | Click Branch/Tag in the Operations column of the target job.
|
| Edit | Choose More > Edit in the Operations column of the target job. |
| Delete | Choose More > Delete in the Operations column of the target job. |
Last Article: Overview
Next Article: Creating a Package Job
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.