0.5.5 • Published 9 years ago

shipit-local v0.5.5

Weekly downloads
18
License
MIT
Repository
github
Last release
9 years ago

#shipit-local

shipit-local is a set of tools that aids in making releases and deploying them locally. Its intended to help with the automation of creating releases from branches on a stage server.

This package is not compatible with shipit-deploy or other packages that rely on servers being defined.

##Dependencies

  • node/npm - but lets be honest if you dont have these already what are you doing here?
  • git 1.7.8+

##Features

  • Works on both Windows and *nix platforms
  • Easy command line usage with overridable config options

##Install

npm install --save shipit-local

##Usage

####Example shipitfile.js

module.exports = function (shipit) {
  require('shipit-local')(shipit);

  shipit.initConfig({
    default: {
      deployTo: '/var/www',
      repositoryUrl: 'https://github.com/user/repo.git',
      updateSubmodules: false,
      keepReleases: 1,
      deleteOnRollback: false
    }
  });
};

To deploy the master branch from your repository:

shipit master deploy

You can rollback a particular branch by using:

shipit master rollback

Rollback will only work if there is a previous release to roll back to.

###Advanced Usage You can override all of the available config options by passing them in on the command line:

shipit master deploy --deployTo=/var/www/overriden

This will now override the deployTo option and set it to the value passed it.

##Options

####deployTo Type: String

Defines a path where branches should be created at. EX: If you use /var/www then when you run shipit master deploy your master branch will be deployed to /var/www/master/releases/<timestamp> and linked to /var/www/master/current

####deployToStructure Type: Number

Default: 0

Option for deployTo structure:

  • 0 - Use as is
  • 1 - Append branch name
  • 2 - Append repo name
  • 3 - Append branch then repo name
  • 4 - Append repo then branch name

####repositoryUrl Type: String

Git URL of the project repository.

####branchNameAlias Type: String

Default: The first argument passed to shipit

A string to replace the provided branch with. Say you want to deploy master but you want to alias that as 1.0.0-rc1. This is how you would do that. Only works with deployToStructure 1,3,4

####repoNameAlias Type String

Default: Parsed from the repo URL

A string to replace the repo name with. Similar to branchNameAlias but for the repo name. Only works with deployToStructure 2,3,4

####updateSubmodules Type: Boolean

Default: false

Whether or not after updating the repository to also update submodules.

####deleteOnRollback Type: Boolean

Default: false

Whether or not to delete the old release when rolling back to a previous release.

####keepReleases Type: Number

Default: 1 (The current one does not count toward this number)

Number of releases to keep besides the current one in each branch's releases directory. If set to 0 or less than zero this will not use a releases directory and symlink the current, instead all work will be kept and updated in the current folder.

####gitConfig Type: Object

Custom git configuration settings for the cloned repo.

####copyPreviousRelease Type: Boolean

Default: false

If set to true will copy the previous release directy then perform the git updates on it. By default this is set to false and a clean directory is used.

##Workflow Tasks

  • Deploy
    • deploy:prepare
      • Emit event deploy:prepare.
      • Create new release directory.
      • Emit event deploy:prepared.
    • deploy:fetch
      • Initialize repository.
      • Add remote.
      • Fetch repository.
      • Checkout commit-ish.
      • Merge remote branch in local branch.
      • Emit event deploy:fetched.
    • deploy:build
      • Emit event deploy:build.
    • deploy:publish
      • Update symlink (Uses ln -s on *nix systems and mklink on Windows)
      • Emit event deploy:published.
    • deploy:cleanup
      • Remove old releases
      • Emit event deploy:cleaned
  • Rollback
    • rollback:prepare
      • Emit event rollback:prepare
      • Locate previous release
    • rollback:rollback
      • Update symlink (Uses ln -s on *nix systems and mklink on Windows)
      • Emit event deploy:published.
    • rollback:cleanup

      • Delete old release if deleteOnRollback is true
      • Emit event rollback:cleaned

##License MIT

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago