Authored by xuhui

腾讯云nginx伸缩

... ... @@ -352,11 +352,56 @@ function deploy(instanceIds){
}
writeToText(">>>正在部署系统,请稍后...");
//3:根据ip部署项目,得到消息id
var messageId = deployProject(ips);
writeToText("第 3 步:项目正在部署!")
//3.1:发布项目的同时获取发布的消息,由于定时器是异步行为,故下一步骤智能在内部进行
deployProjectGetMsg(messageId,ips);
if(scalingGroupName.indexOf("nginx")){
$.ajax({
url: getUrlBasePath() + "/nginxSync/pushTask",
type: "post",
dataType: "json",
data: {
type: 1,
select: $("#cloudType").val()
},
success: function (response) {
var intervalNginx = setInterval(function () {
$.ajax({
url: "/nginxSync/getTaskLog",
type: 'POST',
dataType: 'json',
data: {
taskId: response.data.taskId
},
success: function (data3) {
console.log(data3);
var messagedata = data3.data;
var logList = messagedata.log;
if (logList != "") {
writeToText(logList);
}
//code为2 ,则结束
var code = messagedata.isFinished;
if (code == 1) {
clearInterval(intervalNginx);
writeToText("完毕..........");
}
},
error: function (e) {
requestError(url);
}
});
}, 3000);
},
error: function (e) {
requestError(url);
}
});
}else{
//3:根据ip部署项目,得到消息id
var messageId = deployProject(ips);
writeToText("第 3 步:项目正在部署!")
//3.1:发布项目的同时获取发布的消息,由于定时器是异步行为,故下一步骤智能在内部进行
deployProjectGetMsg(messageId,ips);
}
}
//发布成功和失败都执行
... ...