|
@@ -1,14 +1,9 @@
|
|
|
-package cn.reghao.autodop.common.mq;
|
|
|
|
|
|
|
+package cn.reghao.autodop.common.amqp;
|
|
|
|
|
|
|
|
-import cn.reghao.autodop.common.dagent.app.AppOps;
|
|
|
|
|
-import cn.reghao.autodop.common.dagent.app.DeployArgs;
|
|
|
|
|
|
|
+import cn.reghao.autodop.common.dagent.app.api.AppOps;
|
|
|
|
|
+import cn.reghao.autodop.common.dagent.app.api.data.deploy.AppDeployArgs;
|
|
|
import cn.reghao.autodop.common.dagent.machine.MachineShell;
|
|
import cn.reghao.autodop.common.dagent.machine.MachineShell;
|
|
|
-import cn.reghao.autodop.common.dagent.protocol.RPCResult;
|
|
|
|
|
-import cn.reghao.autodop.common.deploy.PackerType;
|
|
|
|
|
-import cn.reghao.autodop.common.mq.protocol.MQMessage;
|
|
|
|
|
-import cn.reghao.autodop.common.mq.protocol.MessageType;
|
|
|
|
|
-import cn.reghao.autodop.common.mq.protocol.machine.MachineMessage;
|
|
|
|
|
-import cn.reghao.autodop.common.mq.protocol.machine.MachineOps;
|
|
|
|
|
|
|
+import cn.reghao.autodop.common.dagent.app.api.data.deploy.PackerType;
|
|
|
import cn.reghao.autodop.common.utils.data.serializer.JsonConverter;
|
|
import cn.reghao.autodop.common.utils.data.serializer.JsonConverter;
|
|
|
import cn.reghao.autodop.dmaster.DmasterApplication;
|
|
import cn.reghao.autodop.dmaster.DmasterApplication;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -47,11 +42,11 @@ class RabbitProducerTest {
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
void callRemote() {
|
|
void callRemote() {
|
|
|
- DeployArgs deployArgs = new DeployArgs();
|
|
|
|
|
- deployArgs.setPackerType(PackerType.docker.name());
|
|
|
|
|
- deployArgs.setAppId("admin-sys");
|
|
|
|
|
- deployArgs.setAppPath("docker.iquizoo.com/iq3x/admin-sys:2b3dd783ec7e");
|
|
|
|
|
- deployArgs.setRunningDir("");
|
|
|
|
|
|
|
+ AppDeployArgs appDeployArgs = new AppDeployArgs();
|
|
|
|
|
+ appDeployArgs.setPackerType(PackerType.docker.name());
|
|
|
|
|
+ appDeployArgs.setAppId("admin-sys");
|
|
|
|
|
+ appDeployArgs.setAppPath("docker.iquizoo.com/iq3x/admin-sys:2b3dd783ec7e");
|
|
|
|
|
+ appDeployArgs.setRunningDir("");
|
|
|
|
|
|
|
|
MachineShell machineShell = new MachineShell();
|
|
MachineShell machineShell = new MachineShell();
|
|
|
machineShell.setType("command");
|
|
machineShell.setType("command");
|
|
@@ -65,7 +60,7 @@ class RabbitProducerTest {
|
|
|
mqMessage.setRpc(true);
|
|
mqMessage.setRpc(true);
|
|
|
mqMessage.setType(MessageType.appType.name());
|
|
mqMessage.setType(MessageType.appType.name());
|
|
|
mqMessage.setOps(AppOps.appDeployOps.name());
|
|
mqMessage.setOps(AppOps.appDeployOps.name());
|
|
|
- mqMessage.setPayload(JsonConverter.objectToJson(deployArgs));
|
|
|
|
|
|
|
+ mqMessage.setPayload(JsonConverter.objectToJson(appDeployArgs));
|
|
|
|
|
|
|
|
RPCResult rpcResult = rabbitProducer.callRemote(queueName, mqMessage);
|
|
RPCResult rpcResult = rabbitProducer.callRemote(queueName, mqMessage);
|
|
|
System.out.println(rpcResult.getResult());
|
|
System.out.println(rpcResult.getResult());
|