runas-plugin-scm-git
Runas plugin for SCM operations (Git implementation)
Last updated 5 months ago by apecr .
Original npm · Tarball · package.json
$ cnpm install runas-plugin-scm-git 
SYNC missed versions from official npm registry.

SCM operations for runas (Git implementation)

Hook (stages: config)

Any step can configure this plugin to perform a number of SCM operations.

1. Install plugin

Add package dependency:

npm install --save runas-plugin-scm-git

Add plugin on steps/$stepName/config.json plugins:

{
  "plugins: [
    [...]
    "scm"
  ]
}

2. Add git requirement to the step

{
  "requirements": {
    [...]
    "git": {}
  }
}

3. Configure plugin in config.json

Example:

{
  "scm": {
    "operation": "checkout",
    "repos": [{
      "repo": "ssh://git@globalrepos.com/ctool/runas-plugin-scm-git.git",
      "folder": "projects/tools"
    }],
    "jobs": 10
  }
}
  • operation Any of the operations supported by the plugin (see below)
  • repos A list of repos in which the operation will be performed. Each repo must be an object containing the fields required by the operation (see below)
  • jobs Number of jobs executed in parallel

Addons

this.scmClone

Executes git clone ${options.repo}. If present, sets current working directory to ${options.folder}. If not, works in the cwd.

Param Description
options object containing the fields repo and folder
returns a Promise with the complete child_process object result of the execution

this.scmPull

Executes git pull --rebase. If present, sets current working directory to ${options.folder}. If not, works in the cwd.

Param Description
options object containing the field folder
returns a Promise with the complete child_process object result of the execution

this.scmCheckout

Checks whether the ${options.repo} exists in ${options.folder} or not, and executes either a scmPull (if exists) or a scmClone (if not).

Param Description
options object containing the fields repo and folder
returns a Promise with the complete child_process object result of the execution

this.scmUpdate

Alias for scmPull.

this.scmAdd

Executes git add --all in the folder ${options.folder} (if not present, in the cwd).

Param Description
options object containing the field folder
returns a Promise with the complete child_process object result of the execution

this.scmCommit

Executes git commit -m ${options.message} in the folder ${options.folder} (if not present, in the cwd).

Param Description
options object containing the fields message and folder
returns a Promise with the complete child_process object result of the execution

this.scmPush

Executes git push -u origin ${options.branch} in the folder ${options.folder} (if not present, in the cwd). If ${options.branch} is not present, it will use the value master.

Param Description
options object containing the fields branch and folder
returns a Promise with the complete child_process object result of the execution

this.scmFetch

Executes git fetch -p in the folder ${options.folder} (if not present, in the cwd).

Param Description
options object containing the fields branch and folder
returns a Promise with the complete child_process object result of the execution

Current Tags

  • 0.1.1-beta.0                                ...           beta (5 months ago)
  • 0.1.1                                ...           latest (5 months ago)

3 Versions

  • 0.1.1                                ...           5 months ago
  • 0.1.1-beta.0                                ...           5 months ago
  • 0.1.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |