Authored by 姜枫

fix bug

... ... @@ -43,22 +43,23 @@ const p = {
let deploy = project.deploy[env];
deploy.env = env;
deploy.name = envs[env];
let targets = [];
deploy.target.forEach(async(host) => {
let promises = deploy.target.map( (host) => {
console.log('read host :' + host);
let info = await DeployInfo.findOne({
return await DeployInfo.findOne({
projectId: project._id,
host: host,
env: env
});
targets.push({
}).then((info) => {
return {
host: host,
hostFm: host.replace(/\./g, '-'),
info: info
})
};
});
});
let targets = await Promise.all(promises);
console.log('targets: ', targets);
await ctx.render('action/project_index', {
... ...