shipit-clab-deploy
Shipit deployment tasks for ContactLab UI applications.
Inspired by shipit-deploy.
Features:
- deploy local
dist
directory to remote servers; - easy rollback.
Install
$ npm install -D @contactlab/shipit-clab-deploy
Or
$ yarn add -D @contactlab/shipit-clab-deploy
Usage
shipitfile.js
Example const path = require('path');
const clabDeploy = require('@contactlab/shipit-clab-deploy');
module.exports = shipit => {
clabDeploy(shipit);
shipit.initConfig({
staging: {
servers: 'user@myserver.com',
from: path.resolve('.', 'dist'),
deployTo: '/var/www/html',
releasesDir: 'releases',
currentDir: 'current',
keepReleases: 10
}
});
};
To deploy on staging (in the /var/www/html
directory), you must use the following command:
$ shipit staging deploy
You can rollback to the previous releases with the command:
$ shipit staging rollback
Options
String
from: Default: dist
Define the path of the directory which will be deployed.
String
deployTo: Required
Define the remote path where the from
directory will be deployed. A new directory for the specific release is created under releasesDir
folder and is sym-linked to currentDir
.
String
releasesDir: Default: releases
Define the name of the directory under which every release is placed.
String
currentDir: Default: current
Define the name of the directory (symlink to the last release) under which the current release is placed.
Number
keepReleases: Default: 5
Number of releases to keep on the remote server.
Dependencies
Local
- git 1.7.8+
- rsync 3+
- OpenSSH 5+
Remote
- GNU coreutils 5+
- GNU findutils 4.4.2+
Contributing
This package uses conventional-changelog in order to autogenerate a CHANGELOG.md
file from commits.
Commits messages should follow the conventional commits standard and the Angular guidelines.
If you want to contribute:
- open a new issue;
- fork the repo or create a new branch from
master
with a reference to the issue *; - write some code;
- create a pull request from your repo/branch to
master
; - merge the PR - admin only;
- run
npm version [major|minor|patch]
onmaster
(this will also run the changelog generator) - admin only; - add a new git tag (annotation = package version) - admin only;
- push with
--follow-tags
flag - admin only.
* a good naming convention: feature/ISSUE_ID-description or fix/ISSUE_ID-description
License
Released under the Apache 2.0 license.