Authored by 姜枫

fix bug

... ... @@ -204,16 +204,25 @@ const p = {
let targets = project.deploy[building.env].target;
targets.forEach(async(host) => {
let info = {
let doc = await DeployInfo.findOne({
projectId: project._id,
host: host,
env: building.env,
building: building.buildTime,
state: 'waiting'
};
info._id = await DeployInfo.insertOrUpdate(info);
let deploy = new Deploy(project, building);
deploy.deploy(info);
env: building.env
});
if (doc.state !== 'running') {
let info = {
projectId: project._id,
host: host,
env: building.env,
building: building.buildTime,
state: 'waiting'
};
info._id = await DeployInfo.insertOrUpdate(info);
let deploy = new Deploy(project, building);
deploy.deploy(info);
}
});
await Operation.action(ctx.session.user, 'PROJECT_DEPLOY', '项目分发部署', {_id: buildingId, project: project.name, branch: building.branch, env: building.env});
... ...