Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deploy HTML site with Flightplan

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

npm install flightplan

If your project is not currently a git repository, make it one:

git init
git add -A
git commit -m "first commit"

Create your flightplan.js file (changing the host and username)

var plan = require('flightplan');

// configuration
plan.target('production', [
  {
    host: 'willsawesomesite.com',
    username: 'willster',
    port: 2222,
    agent: process.env.SSH_AUTH_SOCK
  },
]);

// run commands on localhost
plan.local(function(local) {
  // uncomment these if you need to run a build on your machine first
  // local.log('Run build');
  // local.exec('gulp build');

  local.log('Copy files to remote hosts');
  var filesToCopy = local.exec('git ls-files', {silent: true});
  // rsync files to all the destination's hosts
  local.transfer(filesToCopy, '~/www/');
});

###Hate typing in your password all the time? See how to setup passwordless SSH:

@ghost

This comment has been minimized.

Copy link

ghost commented Jan 14, 2015

Great tutorial. I will use this in the future.

@koenverburg

This comment has been minimized.

Copy link

koenverburg commented Feb 5, 2015

Great tut, but cant get flightplan to move the files to "~/var/www".
I'm trying with the remote command but cant get them to work this is my flightplan.js https://github.com/CreativeKoen/maceo/blob/development/flightplan.js

@amonmoce

This comment has been minimized.

Copy link

amonmoce commented Apr 24, 2015

Excellent ... akuna matata!!!

@marciofmjr

This comment has been minimized.

Copy link

marciofmjr commented Oct 22, 2015

Amazing !!!

@labanino

This comment has been minimized.

Copy link

labanino commented Feb 9, 2016

Woohoo! Thanks man!

@adegbengaagoro

This comment has been minimized.

Copy link

adegbengaagoro commented Jul 5, 2016

I have a server with multiple domains on it. How can I target a very nested folder as my production folder for the website e.g.

Server

  • Domain 1
  • Domain 2
  • Domain 3
    • sites
      • Year-1
      • Year-2
      • Year-3

The folder I want to target is Domain 3/sites/Year-3

Thanks and looking forward to your response

@pbellot77

This comment has been minimized.

Copy link

pbellot77 commented Mar 24, 2017

I'm following the instructions to use flight plan but I'm getting a connection refused. I'm I using the wrong port or is there something else I need to do on hostgator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.