For EDAS developers, if you are using a WAR or JAR package to deploy an application, you can use the Cloud Toolkit Maven plug-in to deploy applications to Alibaba Cloud EDAS.
In the pom.xml file of the project, add the following<build>
dependency.
<build>
<plugins>
<plugin>
<groupId>com.alibaba.cloud</groupId>
<artifactId>toolkit-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
</plugins>
</build>
Query the latest version from the official central repository of Maven.
Create an. edas_config.yaml file under the root directory of the project. If the packaged project is a Maven submodule, create the file in the submodule directory. The file contains the following content:
env:
region_id: cn-beijing
app:
app_id: eb20dc8a-0000-567-1234-5f6a54550453
Among the preceding configuration items, region_id indicates the region ID of the application instance, while app_id indicates the application ID. The values of the preceding configuration items are examples. Replace them with your actual application values. For information about other configuration items, see "More configuration items."
Create an account file and configure Access Key ID and Access Key Secret in yaml format. To view Access Key ID and Access Key Secret, log on to the Alibaba Cloud user information management system. The following provides a configuration example:
access_key_id: 123456
access_key_secret: 7891011
Go to the root directory (or the submodule directory if multiple Maven modules are used) and run this packaging command:
mvn package toolkit:deploy --proudct=edas -Daccess_key_file= {Account file path}
After this command is run, the following message is displayed, indicating that you have successfully deployed the application in EDAS:
Configuration items for deploying applications are classified as follows:
The currently supported configuration items are listed in the following table.
For example, an application whose ID is eb20dc8a-e6ee-4f6d-a36f-5f6a54550453 is deployed in Beijing. The group ID is 06923bb9-8c5f-4508-94d8-517b692f30b9, and the deployment package version is 1.2. In this case, the configuration is as follows:
env:
region_id: cn-beijing
app:
app_id: eb20dc8a-e6ee-4f6d-a36f-5f6a54550453
package_version: 1.2
group_id: 06923bb9-8c5f-4508-94d8-517b692f30b9
For example, we want to deploy the application whose ID is eb20dc8a-e6ee-4f6d-a36f-5f6a54550453 and upload the deployment package to our own bucket named release-pkg in Beijing. The file object name is my.war, the OSS account ID is ABC, and the OSS account key is 1234567890. In this case, the configuration is as follows:
env:
region_id: cn-beijing
app:
app_id: eb20dc8a-e6ee-4f6d-a36f-5f6a54550453
oss:
region_id: cn-beijing
bucket: release-pkg
key: my.war
access_key_id: ABC
access_key_secret: 1234567890
.edas_config.yaml
file in the root directory of the packaged project as the configuration file. If the packaged project is a submodule of the Maven project, the configuration file is under the root directory of the submodule by default, but not under the root directory of the entire Maven project.-Dedas_config=xxx
parameter.When deploying an application with this plug-in, you must provide an Alibaba Cloud Access Key for application deployment. Currently, the plug-in supports multiple configuration methods. If duplicate configuration methods are present, the configuration method with a higher priority overrides that with a lower priority. Configuration methods in descending order of priority:
-Daccess_key_id=xx -Daccess_key_secret=xx
.<plugin>
<groupId>com.aliyun</groupId>
<artifactId>edas-maven-plugin</artifactId>
<version>2.30.0</version>
<configuration>
<accessKeyId>abc</accessKeyId>
<accessKeySecret>1234567890</accessKeySecret>
</configuration>
</plugin>
-Daccess_key_file={account file path
. Example:access_key_id: abc
access_key_secret: 1234567890
.aliyuncli
sub-directory under the current Home directory and creates the credentials
file in the .aliyuncli
sub-directory to store your account information. Here, we use the Mac system as an example and assume the system user is "jack", so the following information is stored in the /Users/jack/.aliyuncli/credentials
file:[default]
aliyun_access_key_secret = 1234567890
aliyun_access_key_id = abc
The plug-in uses this account file as the account for deploying the application.
.aliyun
sub-directory under the current Home directory and creates the config.json
file in the .aliyun
sub-directory. Here, we use the Mac system as an example and assume the system user is "jack", so the account information is stored in the /Users/jack/.aliyun/config.json
:{
"current": "",
"profiles": [{
"name": "default",
"mode": "AK",
"access_key_id": "",
"access_key_secret": "",
"sts_token": "",
"ram_role_name": "",
"ram_role_arn": "",
"ram_session_name": "",
"private_key": "",
"key_pair_name": "",
"expired_seconds": 0,
"verified": "",
"region_id": "",
"output_format": "json",
"language": "en",
"site": "",
"retry_timeout": 0,
"retry_count": 0
}, {
"name": "",
"mode": "AK",
"access_key_id": "abc",
"access_key_secret": "xxx",
"sts_token": "",
"ram_role_name": "",
"ram_role_arn": "",
"ram_session_name": "",
"private_key": "",
"key_pair_name": "",
"expired_seconds": 0,
"verified": "",
"region_id": "cn-hangzhou",
"output_format": "json",
"language": "en",
"site": "",
"retry_timeout": 0,
"retry_count": 0
}],
"meta_path": ""
}
System.getenv("access_key_id")
and System.getenv("access_key_secret")
in the Java code.Aliware - July 20, 2020
Nick - May 7, 2019
Nick - May 6, 2019
Nick - May 7, 2019
Nick - May 10, 2019
Nick - May 17, 2019
Robotic Process Automation (RPA) allows you to automate repetitive tasks and integrate business rules and decisions into processes.
Learn MoreA PaaS platform for a variety of application deployment options and microservices solutions to help you monitor, diagnose, operate and maintain your applications
Learn MoreGain an industrial edge with Alibaba Cloud best practices
Learn MoreAlibaba Cloud (in partnership with Whale Cloud) helps telcos build an all-in-one telecommunication and digital lifestyle platform based on DingTalk.
Learn MoreMore Posts by Nick(倪超)