ethelo-deploy

gulp-subtree plus one important flag.


Keywords
gulp, gulpplugin, git, subtree, export, deploy
License
MIT
Install
npm install ethelo-deploy@0.1.0

Documentation

Ethelo Deploy

This is a trivial modification of gulp-subtree that adds the -f flag to 'git add', which is what we need for our purposes. You probably want gulp-subtree, not this.

Gulp-subtree docu follows:

Gulp Subtree

A little gulp module to let you push a folder to a git subtree without keeping that folder in your git history. Highly recommend to use with gulp-clean.

IMPORTANT!

In order for Gulp Subtree to work correctly, the folder you are pushing MUST NOT BE IGNORED THROUGH GIT. Often, this is the dist folder. This is because Gulp Subtree needs to be able to temporarly add it to your Git repository in order to push it. For this reason, it's recommended to pair with gulp-clean, allowing your distribution folder to be totally removed after it's been pushed.

Requirements

git subtree must be previously installed. Older versions of git (e.g. Ubuntu 12.04's standard install version) are not bundled with it. The easiest way to check is to see if git subtree throws up or not. Gulp will fail silently if the command is not available. See here for more info on how to install it.

Usage

var subtree = require('gulp-subtree');
var clean = require('gulp-clean');

gulp.task('subtree', function () {
  return gulp.src('dist')
    .pipe(subtree())
    .pipe(clean());
});

Options

Options can be passed into subtree to choose the remote, branch, and message to push with. By default, it's origin, gh-pages, and 'Distribution Commit'.

var subtree = require('gulp-subtree');
var clean = require('gulp-clean');

gulp.task('subtree', function () {
  return gulp.src('dist')
    .pipe(subtree({
      remote: 'upstream',
      branch: 'master',
      message: 'Here We Go!'
    }))
    .pipe(clean());
});