Authored by xuqi

Merge branch 'feature/page-cache' of http://git.yoho.cn/OPENTECH/yoho-node-ci in…

…to feature/page-cache
@@ -61,6 +61,9 @@ const p = { @@ -61,6 +61,9 @@ const p = {
61 deploy.env = env; 61 deploy.env = env;
62 deploy.name = envs[env]; 62 deploy.name = envs[env];
63 63
  64 + if (typeof deploy.target === 'string') {
  65 + deploy.target = [deploy.target];
  66 + }
64 67
65 let promises = deploy.target.map((host) => { 68 let promises = deploy.target.map((host) => {
66 console.log('read host :' + host); 69 console.log('read host :' + host);
@@ -220,6 +223,10 @@ const p = { @@ -220,6 +223,10 @@ const p = {
220 let project = await Project.findById(building.projectId); 223 let project = await Project.findById(building.projectId);
221 let targets = project.deploy[building.env].target; 224 let targets = project.deploy[building.env].target;
222 225
  226 + if (typeof targets === 'string') {
  227 + targets = [targets];
  228 + }
  229 +
223 targets.forEach(async(host) => { 230 targets.forEach(async(host) => {
224 231
225 let doc = await DeployInfo.findOne({ 232 let doc = await DeployInfo.findOne({
@@ -394,7 +401,11 @@ const p = { @@ -394,7 +401,11 @@ const p = {
394 return; 401 return;
395 } 402 }
396 403
397 - const hosts = project.deploy[env].target; 404 + let hosts = project.deploy[env].target;
  405 +
  406 + if (typeof hosts === 'string') {
  407 + hosts = [hosts];
  408 + }
398 hosts.forEach((host) => { 409 hosts.forEach((host) => {
399 var obj = { 410 var obj = {
400 'total': 0, 411 'total': 0,