From e189925de72e84364e3ddac495ef9509a1841194 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Fri, 22 Apr 2022 14:10:09 +0800 Subject: [PATCH] add deploy task --- backend/build.gradle | 14 ++++++++++++-- backend/deployconfig.json | 10 ++++++++++ build.gradle | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 backend/deployconfig.json diff --git a/backend/build.gradle b/backend/build.gradle index 4630380..bd7bf50 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -1,6 +1,11 @@ buildscript { + repositories{ + mavenCentral() + mavenLocal() + } dependencies { - classpath files("buildlibs/simple-ypk-packer-0.3.0.jar") + classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0" + classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0" } } plugins { @@ -69,7 +74,7 @@ task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) { } def reltivePath = "./backend" //reltivePath="." -def currVersion = "0.1.0" +def currVersion = "1.1.0" task grepCP (dependsOn:["copyJar"]){ doLast { org.bdware.datanet.YPKPacker.grepCPLibWithFilter("${reltivePath}/cplibs/libs","${reltivePath}/build/output/libs","${reltivePath}/grepcp.list") @@ -87,4 +92,9 @@ task buildYPK(dependsOn: ["buildZip"]) { doLast { org.bdware.datanet.YPKPacker.staticPack("${reltivePath}/build/contractexample.zip", "${reltivePath}/build/contractexample-${currVersion}.ypk") } +} +task deploy(dependsOn: ["buildYPK"]){ + doLast { + org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true) + } } \ No newline at end of file diff --git a/backend/deployconfig.json b/backend/deployconfig.json new file mode 100644 index 0000000..4031206 --- /dev/null +++ b/backend/deployconfig.json @@ -0,0 +1,10 @@ +{ + "host": "ip", + "privateKey": "e85ce2f4d8...", + "publicKey": "04da01345770b7e09d4774bf6cd67bf90b32eaa09f517c79b2d1f9b8a926", + "ypkPath": "./backend/build/contractexample-1.1.0.ypk", + "killBeforeStart": "ContractID/ContractName", + "createParam": { + }, + "agentPort": 21030 +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 66ac7ba..4b9ae9a 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'idea' } -def currVersion = "1.0.0" +def currVersion = "1.1.0" ext.projectIds = ['group': 'org.bdware.sc.contractexample', 'version': currVersion] tasks.withType(JavaCompile) {