2022-04-22 05:47:42 +00:00
|
|
|
|
# 使用说明
|
|
|
|
|
1) 在`build.gradle`中进行配置。
|
|
|
|
|
```groovy
|
|
|
|
|
buildscript {
|
|
|
|
|
repositories {
|
|
|
|
|
mavenLocal()
|
|
|
|
|
mavenCentral()
|
|
|
|
|
}
|
|
|
|
|
dependencies {
|
2022-05-26 07:33:04 +00:00
|
|
|
|
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.5.0"
|
2022-04-22 05:47:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//....
|
|
|
|
|
task deploy(dependsOn: ["xxx"]) {
|
|
|
|
|
doLast {
|
|
|
|
|
org.bdware.ypkdeploy.HTTPTool.batchRun("./xxx/deployconfig.json", true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
2) 配置`./xxx/deployconfig.json`文件。
|
|
|
|
|
参数说明:
|
|
|
|
|
|
2022-05-26 07:33:04 +00:00
|
|
|
|
`agentAddress`为运行了bdagent的服务端的ip:port
|
2022-04-22 05:47:42 +00:00
|
|
|
|
|
|
|
|
|
`privateKey/publicKey`为有部署权限的一组SM2KeyPair
|
|
|
|
|
|
|
|
|
|
`ypkPath`是待部署的ypk路径。
|
|
|
|
|
|
|
|
|
|
`deployconfig.json`配置示例:
|
|
|
|
|
```json
|
|
|
|
|
{
|
2022-05-26 07:33:04 +00:00
|
|
|
|
"agentAddress": "192.168.x.x:18000",
|
2022-04-22 05:47:42 +00:00
|
|
|
|
"privateKey": "5895c18430dd...",
|
|
|
|
|
"publicKey": "04d1924329f72ced14...",
|
|
|
|
|
"ypkPath": "/path/to/todeploy.ypk",
|
|
|
|
|
"killBeforeStart": "ContractName",
|
|
|
|
|
"createParam": {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|