Before you build a pipeline, you must configure your Android, or H5 application. This step grants code permissions and assigns administrators. Android applications also support certificate hosting and code scanning.
Prerequisites
A project and an application have been created. For more information, see Quick Start.
Procedure
Log on to the EMAS console, select the Cloud Build product, and click Enter.
You are directed to the welcome page for Cloud Build. Select Application, and then click Configure Application.
Configure the application.
For Android applications:
Configure the code repository. For more information, see Configure a code repository.
(Optional) Configure a certificate. For Android, see Configure a certificate (Android).
(Optional) Configure personnel. For more information, see Configure personnel.
(Optional) Configure code scanning rules. For more information, see Configure code scanning rules.
For HarmonyOS applications:
Configure the code repository. For more information, see Configure a code repository.
(Optional) Configure a certificate. For HarmonyOS, see Configure a certificate (HarmonyOS).
(Optional) Configure personnel. For more information, see Configure personnel.
For H5 applications:
Configure the code repository. For more information, see Configure a code repository.
(Optional) Configure personnel. For more information, see Configure personnel.
(Optional) Configure code scanning rules. For more information, see Configure code scanning rules.
After you complete the configuration, a build pipeline is automatically created, and you are redirected to the Pipeline List page.
On the Configure Certificate page, click Skip to bypass this step.
On the Configure Personnel page, click Ignore to bypass this step.
You can configure these settings later on the Application Configuration page. For more information, see Manage applications.
Configure a code repository
On the Application Configuration page, configure the parameters for the Code Repository. Cloud Build supports multiple code sources. This topic uses GITLAB as an example.
Option |
Description |
Notes |
Code source |
The type of code repository. Options include GITHUB/GITEE/GITLAB/Apsara Devops Codeup/Bitbucket/Coding/Generic GIT. |
- |
Account |
The logon account for the code repository. For example, your GITHUB logon account. |
This parameter applies to GITHUB/GITEE. |
Namespace |
The namespace where the application resides in the code repository. For example, the namespace for your application in GITHUB. |
|
Code repository |
The address of the code repository. The address can start with ssh://, https://, or git@. For example: ssh://gitlab.xx.com/xx/devops_anroid_demo.git gi*@gitlab.xx.com:xx/devops_anroid_demo.git |
|
Code access permission |
The access permission for the code repository.
Note
You must set the code access permission in advance. If it is not set, click the Code Access Permission button to set it. For more information, see Add code access permissions. |
This parameter applies to GITLAB/Apsara Devops Codeup/Bitbucket/Coding/Generic GIT. |
Default branch |
The name of the default branch for builds. |
- |
Click Test Connection to verify the connection to the code repository.
Click Next to configure the certificate.
Configure a certificate (Android)
On the Configure Application page, click the designated area to select the Keystore file, or drag the Keystore file to the area to upload it.
Configure the certificate parameters.
Option |
Description |
Keystore password |
Enter the password for the Keystore file. |
Key alias |
Specify the name of the certificate. |
Key password |
Enter the password for the certificate. |
Click Next to configure administrators.
Configure a certificate (HarmonyOS)
HarmonyOS application certificates consist of two parts: a .p12 certificate file and a .cer certificate file with a .p7b profile. For more information about certificate concepts, see the official HarmonyOS website.
Configure a Key Store certificate
On the Configure Application page, click the designated area to select the .p12 file, or drag the .p12 file to the area to upload it.
Enter the .p12 certificate password and certificate alias.
Configure a debug or release certificate and profile
On the Configure Application page, click the designated area to select the .cer file, or drag the .cer file to the area to upload it.
Enter the correct expiration date for the .cer certificate. The expiration date must match the one displayed in the certificate management section of Huawei AppGallery Connect. Debug certificates are typically valid for one year, and release certificates are usually valid for three years.
Upload one or more .p7b files. The .p7b file must correspond to the .cer file. Ensure that the .cer and .p7b certificates are correctly associated. Otherwise, a signing error will occur during the build process.
Configure personnel
On the Configure Application page, select the administrator accounts to add.
You must add users in advance. If you have not yet added users, select Manage Personnel via RAM from the drop-down list to add them. For more information, see Grant permissions to RAM users.
The application creator is the administrator of the application by default.
An administrator can add multiple entries.
Configure code scanning rules
On the Code Scanning Rules tab, configure the Rule Level and Action based on the filter criteria.
(Optional) Rule Level: Each rule has a default level. You can reconfigure the rule levels as needed. The options are Fatal, Critical, General, and Info.
(Optional) Action: By default, all code scanning rules are enabled. You can disable specific scanning rules as needed.
The system automatically identifies the ruleset based on the application type. The rulesets are as follows:
Android static code scanning ruleset
The scan engine uses Android Lint, a static code analysis tool developed by Google and included in the Android software development kit (SDK). It detects potential errors and performance issues in Android applications. For more information about its functions, usage, configuration, and rules, see the Android Lint tool documentation.
H5 static code scanning ruleset
This ruleset uses scan engines such as ESLint, Stylelint, and HTMLHint. ESLint analyzes JavaScript code, Stylelint analyzes CSS and style sheet code, and HTMLHint analyzes HTML code. As static analysis tools, they can detect potential issues, errors, and style violations in code, which helps developers improve code quality and readability. Developers can also customize rules and configure them to suit their project's specific requirements. For more information, see the official ESLint documentation, official Stylelint documentation, and official HTMLHint documentation.