Multiple destinations syncing(sync local files or directories to multiple destinations).
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1bc2b34 Oct 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin almost finish 0.1.0 Oct 26, 2018
examples almost finish 0.1.0 Oct 26, 2018
src almost finish 0.1.0 Oct 26, 2018
.editorconfig copy from sclean Oct 26, 2018
.eslintignore copy from sclean Oct 26, 2018
.eslintrc.js copy from sclean Oct 26, 2018
.gitignore copy from sclean Oct 26, 2018
.npmrc copy from sclean Oct 26, 2018
.prettierignore copy from sclean Oct 26, 2018
.prettierrc.js copy from sclean Oct 26, 2018
.travis.yml copy from sclean Oct 26, 2018
CHANGELOG.md almost finish 0.1.0 Oct 26, 2018
LICENSE init May 26, 2018
README.md 0.2.0 Oct 26, 2018
jest.config.js copy from sclean Oct 26, 2018
package.json almost finish 0.1.0 Oct 26, 2018
rollup.config.js copy from sclean Oct 26, 2018

README.md

md-sync

Multiple destinations syncing(sync local files or directories to multiple destinations).

npm install md-sync --save-dev

package.json

"scripts": {
  "sync": "md-sync"
}

config

Add a md-sync.config.js file to your project root.

module.exports = [
  // first destination
  {
    src: [globs, options],
    remotePath: 'remotePath',
    server: {
      ignoreErrors: true,
      sshConfig: {
        host: 'host',
        username: 'username',
        password: 'password'
      }
    },
  },
  // second destination
  ...
];
  1. src: gulp src args
  2. remotePath: remote server path
  3. server: options for gulp-ssh

multiple server environments

If you need to support multiple server environments(test, gray, prod), you can do like this:

# package.json

"scripts": {
  "sync:test": "md-sync --env test",
  "sync:gray": "md-sync --env gray",
  "sync:prod": "md-sync --env prod"
}

With minimist.

# md-sync.config.js

const argv = require('minimist')(process.argv.slice(2));

const configs = {
  test: [
    { ... },
    ...
  ],
  gray: [
    { ... },
    ...
  ],
  prod: [
    { ... },
    ...
  ],
};

module.exports = configs[argv.env];

do syncing

npm run sync