sails-generate-archive

0.0.5 • Public • Published

sails-generate-archive

An archive generator for use with the Sails command-line interface.

This generate create a zip file (named "archiveX.X.X.zip") under a .archives folder who contains every files for a production server.

How does it works ?

The generator build all your assets files (js, css...) by lifting sails in production mode and then include all files in .tmp/public in zip file.

The generator also include all this file :

["/api", "/config", "/tasks", "/views", "/Gruntfile.js", "/app.js", "/package.json", "/.sailsrc"]

Like this all you have to do with the zip file is unzip it, make an npm install and then lift sails in production mode.

Sails will start quickly cause they only copy /assets folder in .tmp/public and it doesn't rebuild them.

How to deploy my archive ?

It's simple, first unzip your archive :

unzip archive0.0.1.zip -d myProject
cd myProject

Install dependencies :

npm install

Run your project in production :

sails lift --prod

Easy right ? :)

Why should I use this ?

If you use a server with low resources or if you deploy you project on a board like Raspberry PI. Your project will start quickly because grunt tasks don't rebuild assets.

Installation

Globally to use on every project you have (need to install sails globally too)

$ npm install -g sails-generate-archive

or for one project

$ npm install sails-generate-archive

Usage

On the command line
$ sails generate archive 

You can add file and folder if you want like this :

$ sails generate archive file1.js folder1 folder2 

Configuration

If you want to put other files in archives just add a /config/archive.js file like this :

module.exports.archive = {
    filesToArchive : ["/file1.js", "/testFolder"],
    removeFolder : true // Default to true, delete the tmp folder after ziping. You can force to false if you want to check or modify it after.
};

Development

To get started quickly and see this generator in action, ...

Also see CONTRIBUTING.md for more information on overriding/enhancing existing generators.

Questions?

See FAQ.md.

More Resources

License

MIT © 2015 balderdashy & contributors

As for Sails? It's free and open-source under the MIT License.

image_squidhome@2x.png

Package Sidebar

Install

npm i sails-generate-archive

Weekly Downloads

1

Version

0.0.5

License

MIT

Last publish

Collaborators

  • jaumard