Using CodeArts
This section describes the basic operation process of CodeArts.
![](https://support.huaweicloud.com/intl/en-us/qs-devcloud/en-us_image_0000001353799162.png)
Prerequisites
- You have purchased CodeArts. For details, see Purchasing CodeArts.
- To deploy applications on a host, you need to prepare a host with an EIP. You can use an existing host or purchase a Huawei Cloud ECS.
Configuring a Project
CodeArts Req is the basis for using services on CodeArts. You need to create a project, add project members, and add work items based on your project plan.
- Create a project.
- Log in to the CodeArts console.
- Click
and select a region.
- Click Access Service.
- Click Create Project.
- Click Scrum, enter a project name, and click OK.
- Add a project member.
- Go to the created project, and choose
In the upper right of the list, click Add Members or Invite via Links.
You can add members in any of the following ways:
- Add users in your enterprise
- Import users from other projects
- Invite users from other enterprises
- Import users from agencies
Figure 2 Adding members
from the navigation pane.
- Go to the created project, and choose
- Create a work item.
- Click a project, choose Work Items tab. , and click the
- Click Create Work Item, select a work item type, and enter information such as the title, priority, and handler.
For more operations on CodeArts Req, see CodeArts Req User Guide.
Configuring a Code Repository
The code repository is based on Git to manage versions of project code. Therefore, you need to install the Git client locally in advance.
- Install and configure the Git client.
- Download the installation package from the Git website and install the Git client with the default configurations on the local host.
- Run Git Bash and enter the following commands to configure the username and email address:
1 2
git config --global user.name "<name>" git config --global user.email "<email_address>"
- Generate a pair of SSH keys: The generated key is stored in ~/.ssh/id_rsa.pub.
1
ssh-keygen -t rsa -C "email_address"
- Display the key content.
cat ~/.ssh/id_rsa.pub
- Create a code repository.
- Go to the created project and choose .
- Click New Repository.
- Select Common, Template, or Import, and click Next.
- Enter the basic information such as the repository name, and click OK.
- After a code repository is created, click the repository name on the repository list page to view the files in the repository.
- Clone or push code.
- Click the username in the upper right corner of the page and choose This Account Settings from the drop-down list.
- In the navigation bar, choose .
- Click Add SSH Key, enter the name, enter the key generated in Installing and Configuring the Git Client, agree to statements, and click OK.
- Return to the CodeArts Repo page and click the name of the repository to be cloned.
- Click Clone/Download to copy the repository SSH download link.
- Run Git Bash and enter the following command to clone the cloud repository to your local address:
1
git clone repository_SSH_URL
- After editing the code locally, enter the following commands in sequence in Git Bash to save the code and push it to the code repository:
1 2 3
git add . git commit -m "commit_message" git push origin master
- Return to CodeArts Repo to view the updated file.
For more operations on CodeArts Repo, see CodeArts Repo User Guide.
Configuring a Pipeline
CodeArts Pipeline integrates with CodeArts Check, CodeArts Build, and CodeArts Deploy tasks. You can flexibly configure tasks in the pipeline as required. The pipeline is optional.
- CodeArts Check performs static and security checks. The code check is optional.
- CodeArts Build compiles the source code of software into a target file and packs the configuration file and resource file. Build is optional. For some projects, such as PHP and Node.js frontend code, you do not need to configure build tasks.
- CodeArts Deploy deploys a software package or code to a VM or container. Deployment is optional. For some projects, such as mobile app development, this deployment mode is not required.
- Create a code check task.
- Go to the created project and choose .
- Click Create Task, select the code repository to check, and click New next to the repository name.
- Enter the created task, go to the Overview tab page and click Start Check.
- After the task is successfully executed, you can view the check result, issues, and suggestions.
For more operations on CodeArts Check, see CodeArts Check User Guide.
- Create a build task.
- Go to the created project and choose in the navigation bar.
- Click Create Task and configure task information as required.
- Basic information: Configure the following information and click Next.
Table 1 Basic information Item
Suggestion
Task Name
Enter a custom name.
Code Source
Select Repo.
Source Code Repository
Select the code repository created in Configuring a Code Repository.
Branch
Select a repository branch as required.
- Build Template: You can select a built-in or Blank Template and click Next.
- Basic information: Configure the following information and click Next.
- Configure the build actions, parameters, execution plan. Click Create and Run.
- After the task is complete, you can view the build result and logs.
For more operations on CodeArts Build, see CodeArts Build User Guide.
- Create and deploy an application.
- Go to the created project. In the navigation bar, choose Prerequisites to the cluster. , create a host cluster, and add the hosts prepared in
- Go to the created project and choose from the navigation bar.
- Click Create Application and configure task information as required.
- Basic information: Enter a custom application name and click Next.
- Select a deployment template. You can select a built-in or Blank Template. Then click OK.
- Configure the deployment actions, parameters, and environments as required, and click Save & Deploy.
- After the application is successfully deployed, you can view the deployment result, logs, and error information on the page.
For more operations on CodeArts Deploy, see CodeArts Deploy User Guide.
- Configure a pipeline.
- Go to the created project and choose from the navigation bar.
- Click the Pipelines tab, click Create Pipeline, and configure pipeline information.
- Basic information: Configure the following information and click Next.
Table 2 Pipeline basic information Item
Suggestion
Project
Enter a custom name.
Pipeline Source
Select Repo.
Repository
Select the code repository created in Configuring a Code Repository.
Default Branch
Select a repository branch as required.
- Template: Select a built-in or Blank Template. Then click Confirm.
- Basic information: Configure the following information and click Next.
- Configure the task orchestration, parameters, and execution plan as required, and click Save and Run.
- After the task is successfully executed, click it to view details.
For more operations on CodeArts Pipeline, see CodeArts Pipeline User Guide
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