Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // flightplan.js
- var plan = require('flightplan');
- // configuration
- plan.target('mediasnug-staging', {
- host: '85.10.199.134',
- username: 'root',
- password: 'fg8u43trgusdg',
- agent: process.env.SSH_AUTH_SOCK
- }, {
- build:'build',
- deploymentPath:'/var/www/mediasnug/'
- });
- plan.target('spinview-staging', {
- host: '85.10.199.134',
- username: 'root',
- password: 'fg8u43trgusdg',
- agent: process.env.SSH_AUTH_SOCK
- }, {
- build:'build',
- deploymentPath:'/var/www/kinsome-web-viralaccess/'
- });
- plan.target('spinview-main-staging', {
- host: '85.10.199.134',
- username: 'root',
- password: 'fg8u43trgusdg',
- agent: process.env.SSH_AUTH_SOCK
- }, {
- build:'build',
- deploymentPath:'/var/www/kinsome-web/'
- });
- plan.target('asia-staging', {
- host: '85.10.199.134',
- username: 'root',
- privateKey: '/Users/lukadragojlovic/.ssh/id_rsa',
- agent: process.env.SSH_AUTH_SOCK
- }, {
- build:'build',
- deploymentPath:'/var/www/kinsome-web-asia/'
- });
- plan.target('asia-staging-with-errors', {
- host: '85.10.199.134',
- username: 'root',
- password: 'fg8u43trgusdg',
- agent: process.env.SSH_AUTH_SOCK
- }, {
- build:'development',
- deploymentPath:'/var/www/kinsome-web-asia/'
- });
- /*plan.target('production', [ --env=development
- {
- host: 'www1.example.com',
- username: 'pstadler',
- agent: process.env.SSH_AUTH_SOCK
- },
- {
- host: 'www2.example.com',
- username: 'pstadler',
- agent: process.env.SSH_AUTH_SOCK
- }
- ]);*/
- var tmpDir = 'kinsome-web-builds/dev-spinviewsocial.com-' + new Date().getTime();
- // run commands on localhost
- plan.local(function(local) {
- local.log('Create Build');
- local.exec('npm run-script ' + plan.runtime.options.build);
- local.log('Copy files to remote hosts');
- var filesToCopy = ['build/static/js/',
- 'build/static/media/'
- ];
- // rsync files to all the target's remote hosts
- local.transfer(filesToCopy, '/home/' + tmpDir);
- });
- // run commands on the target's remote hosts
- plan.remote(function(remote) {
- remote.log('Move folder to web root');
- remote.exec('cp -R /home/' + tmpDir + '/build/static ' + plan.runtime.options.deploymentPath);
- remote.rm('-rf /home/' + tmpDir);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement