A set of tasks for Shipit used for yarn specific tasks on deploy.
Heavily inspired by the shipit-npm extension by callerc1. It started as a fork of his repository.
Features:
- Triggered on the
updated
orfetched
event from shipit-deploy - Has a direct pass through task to yarn cli
- Works via shipit-cli and grunt-shipit
npm install shipit-yarn --save-dev # or yarn add -D shipit-yarn
Run: (This triggers the yarn
task on the deploy updated
or
fetched
event. No additional config necessary.)
shipit staging deploy
Or you can run the tasks separatly :
shipit staging yarn:init yarn:install
shipit staging yarn:run --cmd "update"
Type: Boolean
Default: true
A Boolean to determine whether to run the task in local workspace or on the remote.
Type: Array
or String
Default: []
An array or string specifying yarn args passed to the yarn install cmd.
Type: Array
or String
Default: []
An array or string specifying yarn flags passed to the yarn install cmd.
Type: String
,Boolean
Default: updated
or fetched
(depending on yarn.remote
value)
An event name that triggers yarn:install
. Can be set to false to prevent the
yarn:install
task from listening to any events.
yarn install cmd.
Type: String
Default: yarn
Determine which package manager should be used. Can be yarn
, npm
or best
(try with yarn and fallback to npm if
yarn is unavailable).
Type: String
Default: ''
(empty string)
A string specifying the command to be run by the
yarn:cmd
task (e.g. 'run build'
) overridden if the --cmd
argument is set on the command line.
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
require('shipit-yarn')(shipit);
shipit.initConfig({
default: {
yarn: {
remote: true,
installFlags: ['--production']
}
}
});
};
- yarn
- yarn:init
- Emit event "yarn_inited".
- yarn:install
- Runs yarn install (with any Args
yarn.installArgs
or Flagsyarn.installFlags
defined in options) - Emit event "yarn_installed"
- Runs yarn install (with any Args
- yarn:run
- Runs yarn command.
- yarn:init
- on Event "deploy" (shipit-deploy initialized)
- Runs yarn:init
- on Event "yarn_inited"
- Runs yarn:install (Triggered on the
updated
orfetched
event from shipit-deploy or by a customyarn.triggerEvent
as mentioned above.)
- Runs yarn:install (Triggered on the
MIT