Web App Service (Web+) enables you to build an exclusive environment based on an application configuration template. In the application configuration template, you can customize basic information used by applications, such as the resources, network environment, and program path. This topic describes how to use the command-line interface (CLI) to build a deployment environment based on a Jenkins template.
PrerequisitesActivate related services and authorize roles
Step 1: Download and install the command-line tool
In Linux or macOS, run the following command to download and install the CLI:
eval "$(curl -s -L https://webplus-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/cli/install.sh)"
Step 2: Configure the command-line tool
Run the following command to use the AccessKey ID and AccessKey secret of your account to register and configure the CLI, select the region where the environment resides, and then create a folder, for example, named demo:
wpctl configure --access-key-id "$ALICLOUD_ACCESS_KEY" --access-key-secret "$ALICLOUD_SECRET_KEY" --region "$ALICLOUD_REGION" --profile demo
Step 3: Download a Jenkins template
The Wpfile file stores the configuration information used to create or update a deployment environment. Web+ creates a Jenkins template. You can run the following command to download the template and save the template in the Wpfile file:
wget http://aliwebx-sz.oss-cn-shenzhen.aliyuncs.com/docs/course/Jenkins5Wpfile -O Wpfile
Step 4: Create a deployment environment based on the Jenkins template
Run the following command to create a Web+ application and a deployment environment. After you run the following command, Web+ automatically reads the configuration template in the Wpfile file, and creates a deployment environment based on the Jenkins template.
wpctl env:apply --app WebPlusJenkins --env WebPlusJenkinsDemoEnv --create-on-absent
Step 5: Access the deployment environment
After the application and deployment environment are created, Web+ purchases the configuration resources in the template for you. It takes about 2 minutes to purchase the resources. Then, you can run the following commands to access the deployment environment:
- Run the following command to switch to the created application and deployment environment:
wpctl env:use WebPlusJenkinsDemoEnv --app WebPlusJenkins
- Run the following command to view the event list:
- Run the following command to view the environment information and obtain the application
Step 6: Install the Jenkins template environment
After accessing the deployment environment configured in the preceding steps in a
browser, you can install the Jenkins template environment. During the installation,
Jenkins will prompt you to enter the administrator password, which can be obtained
from the file
/Home/admin/. jenkins/secrets/initialAdminPassword. You can use the CLI to run the following command to query the password:
wpctl env:exec WebPlusJenkinsDemoEnv "cat /home/admin/.jenkins/secrets/initialAdminPassword"