spm-deploy

deploy a module with scp.

npm install spm-deploy
1 downloads in the last day
28 downloads in the last week
102 downloads in the last month

spm-deploy

deploy a module with scp.


Install

Install spm-deploy with npm:

$ npm install spm-deploy -g

Gruntfile.js

An example of a Gruntfile:

module.exports = function(grunt) {
  var path = require('path');
  var pkg = grunt.file.readJSON('package.json');

  grunt.initConfig({
    pkg: pkg,
    target: grunt.option('target') || 'dev',
    password: grunt.option('password') || 'alipaydev',

    scp: {
      options: {
        username: 'admin',
        password: '<%= password %>',
        host: 'assets.<%= target %>.alipay.net'
      },
      assets: {
        files: [{
          cwd: 'dist',
          src: '**/*',
          dest: '/home/admin/wwwroot/assets/<%= pkg.family %>/<%= pkg.name %>/<%= pkg.version %>'
        }]
      }
    }
  });

  grunt.loadGlobalTasks('spm-deploy');
  grunt.registerTask('deploy', ['scp']);
};

You can put the gruntfile in your package directory, or use a remote gruntfile.

remote gruntfile

Assign a remote gruntfile in ~/.spm/spmrc:

[user]
gruntfile = /path/to/Gruntfile.js

It can be a local path or an online path:

[user]
gruntfile = http://www.example.com/Gruntfile.js

Usage

You need a Gruntfile to make it work.

$ spm deploy -h

Changelog

Aug 14th, 2013 0.2.4

Delete deploy info file as a task.

Jul 30th, 2013 0.2.3

  1. Collection deploy information
  2. Fix on commandline and Gruntfile

Jul 17th, 2013 0.2.2

Check dist directory.

Jun 18th, 2013 0.2.1

Drop peer dependencies.

May 14th, 2013 0.2.0

Remember password of a target.

April 15th, 2013 0.1.4

Use spm-grunt as the bridge.

April 9th, 2013 0.1.3

  • Add filter for grunt tasks
  • Add log for grunt scp

April 8th, 2013 0.1.2

  • Fix password error

April 3rd, 2013 0.1.1

  • Fix scripts for windows.
  • Add username option.

April 2nd, 2013 0.1.0

First version.

npm loves you