[Product Evaluation Officer] HUAWEI CLOUD CodeArts Product Experience


foreword

HUAWEI CLOUD CodeArts is a distributed application development platform based on the serverless architecture. It can quickly build, deploy, and manage distributed applications, supports multiple programming languages, including Java, Python, and Node.js, and provides rich development tools and APIs, which simplifies the developer's writing process and improves development efficiency. . HUAWEI CLOUD CodeArts also has the characteristics of elastic scaling, high availability, security and reliability, which can meet the application requirements in different scenarios.

1. HUAWEI CLOUD CodeArts product experience

1. Software development production line use process

1.1 Configuration items

1. Enter the console, select软件开发生产线 CodeArts

Console URL: https://console.huaweicloud.com/console/?region=cn-north-4#/home

insert image description here
2. Click to use now
insert image description here
3. Create a new project
insert image description here

4. Add project members
insert image description here
5. Create work items
insert image description here

1.2 Configure the code repository

1. Install and configure the Git client

Download the installation package from the Git official website , and use the default configuration to install the Git client to the local computer.

Run Git Bash, enter the following command line in Git Bash to configure the user name and mailbox.

git config  --global user.name "您的名字"
git config  --global user.email "您的邮箱"

insert image description here

Enter the following command line to generate a pair of SSH keys. The generated key is usually saved in "~/.ssh/id_rsa.pub".

ssh-keygen -t rsa -C "[email protected]"
dir C:\Users\Happy/.ssh/
type C:\Users\Happy/.ssh/id_rsa.pub

insert image description here
2. Create a code warehouse

Select Common New, Create New by Template, or Import External Warehouse as required, enter basic information such as the Warehouse name as prompted on the page, and click OK.
insert image description here
3. Clone/push code

Click the user name in the upper right corner of the page, and select "Personal Settings" from the drop-down list.

insert image description here
Click Code Hosting > SSH Key Management.
insert image description here
Click Add SSH Key, enter the title, paste the key generated in the installation and configuration of the Git client into the text box, check the consent statement, and click OK.
insert image description here

After adding the key, iu can configure the pipeline to run Git Bash, enter the following command line, and clone the cloud warehouse to the local.

git clone 您仓库的SSH下载链接

After editing the code locally, enter the following command lines in Git Bash to save the code and push it to the code repository.

git add .
git commit -m "您对本次提交备注的信息"
git push origin master

insert image description here

1.3 Configuration pipeline

1. Create a code inspection task

  1. Enter the created project and click Code > Code Check in the navigation bar.
  2. Click "New Task", select the code warehouse to be checked on the page, and click "New Task" after the warehouse name.
  3. After the task is successfully created, go to the Overview page and click Start Check to start the task.
  4. After the task is successfully executed, you can view the inspection results, problem list, modification suggestions, etc.

insert image description here

2. Create a build task

  1. Enter the created project, click "Continuous Delivery > Compile and Build" in the navigation bar
  2. Click New Task and configure task information as required.
  3. Configure the build steps, parameters, and execution plan as required, and click Create and Execute.
  4. After the task is executed, you can view the build results and build logs on the page.

insert image description here
3. Create and deploy applications

  1. Enter the created project, select "Settings > General Settings > Basic Resource Management" in the page navigation bar, create a new host cluster, and add the hosts prepared in the prerequisites to the cluster.
  2. Enter the created project, and select Continuous Delivery > Deployment in the page navigation bar.
  3. Click New Application and configure application information as required.
  4. Configure deployment steps, parameters, environment, and other information as required, and click Save and Deploy.
  5. After the application is successfully deployed, you can view the deployment results, deployment logs, error messages, etc. on the page.
    insert image description here

4. Configure the pipeline

  1. Enter the created project and click Continuous Delivery > Pipeline in the navigation bar.
  2. Select the Pipeline tab, click New Pipeline, and configure the pipeline information based on the actual situation.
  3. Configure task arrangement, parameters, and execution plan as required, and click Save and Run.
  4. After the task is successfully executed, you can click each task to view its execution details.

insert image description here

2. Use the software development production line to quickly build projects (ECS articles)

2.1 Prerequisites

  1. Purchased software development production line
  2. Purchased ECS

2.2 New project

The project is the basis for using the software to develop the services of the production line, and the subsequent operations can only be completed after the project is created.

  1. Log in to the software development production line and click New Project.
  2. Select "Scrum", enter the project name "Demo", and click "OK".
    insert image description here

2.3 Create a new code warehouse

1. Choose to create a new template

insert image description here

2. Select the template "Java Web Demo" and click "Next"

insert image description here
3. Enter the code warehouse name "Web-Demo", click "OK"

insert image description here

2.4 Check code

Through the code inspection service, you can perform static inspection on the code to control the quality of the code.

insert image description here

2.5 Build and archive the package

Through the compilation and construction service, the source code of the software can be compiled into an object file, and the configuration file and resource file can be packaged and archived into the software release library.

Click Start Task in the row for the task. If a pop-up window appears, please confirm that the parameter settings are correct, and then click OK.

insert image description here

Click Product Repository > Software Release Repository on the navigation bar to enter the software release repository. In the warehouse with the same name as the project name, enter the folder with the same name as the build task and the folder with the same name as the build number in sequence, and you can find the generated software package "demoapp.jar".
insert image description here

2.6 Deploying build packages

Through the deployment service, the software package in the software release library can be deployed to the virtual machine and started to run.

1. Configure the target host

Click New Host Cluster, enter the cluster name "hosts", select the operating system "Linux", turn off the "Use Proxy Access" switch, and click "Save".

insert image description here
Click Add Target Host, configure the following information in the pop-up box, check the consent statement, and click Add.
insert image description here
When the value in the "Connectivity Verification" column is displayed as "Success", it means that the host has been added.

Select the Deployment Steps tab to configure the deployment steps.
insert image description here

Click Continuous Delivery > Deployment on the navigation bar to enter the deployment service. The automatically created application "Web-Demo-deploy" is displayed on the page. Select "Edit" in the drop-down list to enter the edit page. Select the "Environment Management" tab to configure the host environment.

insert image description here
Select "Edit" in the drop-down list to enter the edit page.
insert image description here
Click Save and Deploy. If a pop-up window appears, please confirm that the parameter settings are correct, and then click OK.
insert image description here

insert image description here
View deployment results

insert image description here

2.7 Configure the pipeline

Click Continuous Delivery > Pipeline in the navigation bar to enter the pipeline service. The automatically created pipeline "Web-Demo-pipeline" is displayed on the "Pipeline" page.
insert image description here
Select the Task Orchestration tab and configure the pipeline.
insert image description here
Click Continuous Delivery > Pipeline in the navigation bar to enter the pipeline service. The automatically created pipeline "Web-Demo-pipeline" is displayed on the "Pipeline" page.
insert image description here
Enter the deployment service, edit the deployment steps, and check "Enable" in "Stop SpringBoot Service".
insert image description here
Enter the code repository, search for and open the file "TestController.java".

Click to change "hello world" to "hello world Yugong", enter the submission information and click "OK".

insert image description here
Return to the pipeline page, you can see that the pipeline is running.

insert image description here
When the page is displayed, revisit the page "http://IP:8080/test", and the access result will change to the content shown in the figure below.

insert image description here

3. Use the software development production line to quickly build projects (CCE articles)

3.1 Prerequisites

  1. Purchased software development production line
  2. A CCE cluster has been purchased

3.2 New project

The project is the basis for using the software to develop the services of the production line, and the subsequent operations can only be completed after the project is created.

  1. Log in to the software development production line and click New Project.
  2. Select "Scrum", enter the project name "Demo", and click "OK".
    insert image description here

3.3 Create a new code warehouse

1. Choose to create a new template

insert image description here

2. Select the template "Java Web Demo" and click "Next"

insert image description here
3. Enter the code warehouse name "Web-Demo", click "OK"

insert image description here

3.4 Prepare Dockerfile

A Dockerfile is a text file used to build an image, which contains the instructions and instructions needed to build the image.

1. Click the warehouse name to enter the code warehouse, click "New" above the file list, and select "New File" in the drop-down list

insert image description here
2. Enter the file name Dockerfile, and enter the following command line for file details

FROM openjdk:8-alpine
ADD target /demo
COPY ./target/demoapp.jar /demo
CMD ["java","-jar","/demo/demoapp.jar"]

insert image description here
3. Build and push the image

Click "New Task" to configure the task information.
insert image description here
Build the basic information of the task.
insert image description here
Build template: select "Blank Build Template" and click "Next".

insert image description here
Configure the build step, click "Click to add build step", find "Maven Build" in the step list, and click "Add".
insert image description here
Click Add Step, find Create Image and Push to SWR Repository in the step list, and click Add.
insert image description here
Configure image information
insert image description here
. After completing the configuration, click Create and Execute.
insert image description here
Log in to the container image service console , and select "My Images" in the left navigation bar of the page.
insert image description here

3.5 Create load

Log in to the Cloud Container Engine console , click the cluster purchased in the preparations, and enter the details page.
On the left side of the page, select Workload, click Create Workload, complete the configuration by referring to the table below, and click Create Workload.

Guess you like

Origin blog.csdn.net/aa2528877987/article/details/131739010