shipit-local v0.5.5
#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
.
- Emit event
- 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
.
- Emit event
- deploy:publish
- Update symlink (Uses
ln -s
on *nix systems andmklink
on Windows) - Emit event
deploy:published
.
- Update symlink (Uses
- deploy:cleanup
- Remove old releases
- Emit event
deploy:cleaned
- deploy:prepare
- Rollback
- rollback:prepare
- Emit event
rollback:prepare
- Locate previous release
- Emit event
- rollback:rollback
- Update symlink (Uses
ln -s
on *nix systems andmklink
on Windows) - Emit event
deploy:published
.
- Update symlink (Uses
rollback:cleanup
- Delete old release if
deleteOnRollback
istrue
- Emit event
rollback:cleaned
- Delete old release if
- rollback:prepare
##License MIT