Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. // flightplan.js
  2. var plan = require('flightplan');
  3.  
  4. // configuration
  5. plan.target('mediasnug-staging', {
  6. host: '85.10.199.134',
  7. username: 'root',
  8. password: 'fg8u43trgusdg',
  9. agent: process.env.SSH_AUTH_SOCK
  10. }, {
  11. build:'build',
  12. deploymentPath:'/var/www/mediasnug/'
  13. });
  14.  
  15. plan.target('spinview-staging', {
  16. host: '85.10.199.134',
  17. username: 'root',
  18. password: 'fg8u43trgusdg',
  19. agent: process.env.SSH_AUTH_SOCK
  20. }, {
  21. build:'build',
  22. deploymentPath:'/var/www/kinsome-web-viralaccess/'
  23. });
  24.  
  25. plan.target('spinview-main-staging', {
  26. host: '85.10.199.134',
  27. username: 'root',
  28. password: 'fg8u43trgusdg',
  29. agent: process.env.SSH_AUTH_SOCK
  30. }, {
  31. build:'build',
  32. deploymentPath:'/var/www/kinsome-web/'
  33. });
  34.  
  35. plan.target('asia-staging', {
  36. host: '85.10.199.134',
  37. username: 'root',
  38. privateKey: '/Users/lukadragojlovic/.ssh/id_rsa',
  39. agent: process.env.SSH_AUTH_SOCK
  40. }, {
  41. build:'build',
  42. deploymentPath:'/var/www/kinsome-web-asia/'
  43. });
  44.  
  45. plan.target('asia-staging-with-errors', {
  46. host: '85.10.199.134',
  47. username: 'root',
  48. password: 'fg8u43trgusdg',
  49. agent: process.env.SSH_AUTH_SOCK
  50. }, {
  51. build:'development',
  52. deploymentPath:'/var/www/kinsome-web-asia/'
  53. });
  54.  
  55. /*plan.target('production', [ --env=development
  56. {
  57. host: 'www1.example.com',
  58. username: 'pstadler',
  59. agent: process.env.SSH_AUTH_SOCK
  60. },
  61. {
  62. host: 'www2.example.com',
  63. username: 'pstadler',
  64. agent: process.env.SSH_AUTH_SOCK
  65. }
  66. ]);*/
  67.  
  68. var tmpDir = 'kinsome-web-builds/dev-spinviewsocial.com-' + new Date().getTime();
  69.  
  70. // run commands on localhost
  71. plan.local(function(local) {
  72. local.log('Create Build');
  73. local.exec('npm run-script ' + plan.runtime.options.build);
  74.  
  75. local.log('Copy files to remote hosts');
  76. var filesToCopy = ['build/static/js/',
  77. 'build/static/media/'
  78. ];
  79. // rsync files to all the target's remote hosts
  80. local.transfer(filesToCopy, '/home/' + tmpDir);
  81. });
  82.  
  83. // run commands on the target's remote hosts
  84. plan.remote(function(remote) {
  85. remote.log('Move folder to web root');
  86. remote.exec('cp -R /home/' + tmpDir + '/build/static ' + plan.runtime.options.deploymentPath);
  87. remote.rm('-rf /home/' + tmpDir);
  88. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement