Code Monkey home page Code Monkey logo

shipit-assets's Introduction

shipit-assets

Asset syncing tasks for Shipit.

Features:

Install

npm install shipit-assets

Usage

Example shipitfile.js

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

  shipit.initConfig({
    default: {
      assets: {
        paths: ['public/storage'],
        options: {
          ignores: ['cache']
        },
      }
    },
  });
};

Push your local assets to remote:

shipit staging assets:push

Pull your remote assets to local:

shipit staging assets:pull

Example Gruntfile.js

grunt.initConfig({
    shipit: {
      options: {
        workspace: '/tmp/github-monitor',
        deployTo: '/tmp/deploy_to',
        repositoryUrl: 'https://github.com/user/repo.git',
        ignores: ['.git', 'node_modules'],
        keepReleases: 2,
        key: '/path/to/key',
        shallowClone: true,
        assets: {
          'paths': [
            'public/uploads',
            'backup'
          ]
        },
      },
      staging: {
        servers: '[email protected]'
      }
    }
  });

  grunt.loadNpmTasks('grunt-shipit');
  grunt.loadNpmTasks('shipit-deploy');
  grunt.loadNpmTasks('shipit-assets');

To run shipit-assets you have to call: grunt shipit:staging assets:push

Options (shipit.config.assets)

assets.paths

Type: Array

Paths to sync between remote and local. Paths are relative to project root.

assets.localPaths

Type: Array

If your local paths are mapped differently than remote, you may specify here. If specified, the array must have the same length as assets.paths. Default: assets.paths

assets.localBasePath

Type: String

If there is a sub/parent folder that the localPaths are based out of (e.g. a directory called "assets") this can be set as a prefix which all local relative paths evaluate from. Default: process.cwd() (directory from where shipit was originally launched from).

assets.remoteBasePath

Type: String

If there is a sub/parent folder that the paths are based out of (e.g. a directory called "assets") this can be set as a prefix from which all remote relative paths evaluate from. Default: deployTo/shared.

assets.options

Options to pass to shipit.remoteCopy.

Workflow tasks

  • assets:push
    • Push assets from local to remote.
    • Emit event "assetsPush".
  • assets:pull
    • Pull assets from remote to local.
    • Emit event "assetsPull".

License

MIT

shipit-assets's People

Contributors

alwinmark avatar diggy avatar jstayton avatar timkelty avatar travco avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.