{"id":18383058,"url":"https://github.com/timkelty/shipit-captain","last_synced_at":"2025-07-26T11:36:07.153Z","repository":{"id":57358488,"uuid":"38901717","full_name":"timkelty/shipit-captain","owner":"timkelty","description":"Run Shipit tasks from Gulp, or any task runner. Includes Inquirer.js prompts, CLI arguments, customized logging, and more.","archived":false,"fork":false,"pushed_at":"2016-11-13T05:14:38.000Z","size":3326,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T22:06:32.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timkelty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-10T20:55:43.000Z","updated_at":"2021-12-19T02:00:51.000Z","dependencies_parsed_at":"2022-09-06T22:21:34.989Z","dependency_job_id":null,"html_url":"https://github.com/timkelty/shipit-captain","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/timkelty/shipit-captain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fshipit-captain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fshipit-captain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fshipit-captain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fshipit-captain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timkelty","download_url":"https://codeload.github.com/timkelty/shipit-captain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fshipit-captain/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267161269,"owners_count":24045472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:09:55.365Z","updated_at":"2025-07-26T11:36:07.077Z","avatar_url":"https://github.com/timkelty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shipit-captain \n\n\u003e Run [Shipit](https://github.com/shipitjs/shipit) tasks from Gulp, or any task runner. Includes [Inquirer.js](https://github.com/SBoudrias/Inquirer.js) prompts, [CLI arguments](https://github.com/bcoe/yargs), customized logging, and more.\n\n![shipit-captain demo](docs/demo.gif)\n\n## Why?\nShipit comes with its own [CLI](https://github.com/shipitjs/shipit#launch-command), but I wanted to integrate Shipit tasks into our existing task workflow, be it Gulp, Grunt, or anything else.\n\n`shipit-captain` will let you easily do things like [set default environments](https://github.com/shipitjs/shipit/issues/38), log confirmation prompts, and easily integrate into Gulp tasks.\n\n## Install\n\n```sh\n$ npm install --save shipit-captain\n```\n\n## Usage\n\nYou can organize your config files any way you like. Below is my preference, as it still allows `shipit-cli` commands to work, as well as those intended for `shipit-captain`. The only requirement is you must separate your `shipit.config` exports.\n\n### Example `shipitfile.js`\n```js\nmodule.exports = require('./config/shipit').init;\n```\n\n### Example `config/shipit.js`\n\n```js\nvar config = {\n  default: {\n    workspace: '/tmp/github-monitor',\n    deployTo: '/tmp/deploy_to',\n    repositoryUrl: 'https://github.com/user/repo.git',\n    ignores: ['.git', 'node_modules'],\n    keepReleases: 2,\n    deleteOnRollback: false,\n    key: '/path/to/key',\n    shallowClone: true\n  },\n  staging: {\n    servers: 'user@myserver.com'\n  }\n};\nmodule.exports.config = config;\nmodule.exports.init = function(shipit) {\n  require('shipit-shared')(shipit);\n  shipit.initConfig(config);\n}\n```\n\n### Example `gulpfile.js`\n```js\nvar gulp = require('gulp');\nvar shipitCaptain = require('shipit-captain');\n\n// With no options, will run shipit-deploy task by default.\ngulp.task('shipit', function(cb) {\n  shipitCaptain(shipitConfig, cb);\n});\n\n// Run other after Shipit tasks are completed \ngulp.task('myTask', ['shipit'], function(cb) {\n  console.log('Shipit tasks are done!');\n  cb();\n});\n\n// Pass options \nvar options = {\n  init: require('config/shipit').init,\n  run: ['deploy', 'clean'],\n  targetEnv: 'staging',\n}\n\ngulp.task('deploy', function(cb) {\n  shipitCaptain(shipitConfig, options, cb);\n});\n// \n\n```\n\n## API\n\n### captain(shipitConfig, [options], [cb])\n\n------\n\n#### shipitConfig\n\n`@param {object} shipitConfig`\n\n\u003e The config object you would normally pass to `shipit.initConfig`.\n\n##### Gulp example:\n\n```bash\ngulp shipit -e production\n```\n\n------\n\n#### options.run\n\n`@param {string|string[]} [options.run=[]]`\n\n\u003e A string or array of strings of Shipit tasks to run. If not set, user will be prompted for a task to run from all available tasks.\n\n\u003e Users may set `options.run` manually, or by passing the `-r` or `--run` argument via the CLI. If set via CLI, comma-separate multiple tasks names.\n\n##### Gulp example:\n\n```bash\ngulp shipit --run deploy,myOtherTask\n```\n\n------\n\n#### options.availableEnvs\n\n`@param {string[]} [options.availableEnvs]`\n \n\u003e By default this will be set to any environments defined in `shipitConfig`. This shouldn't normally need to be set.\n\n------\n\n#### options.confirm\n\n`@param {boolean} [options.confirm=true]`\n \n\u003e Set to `false` to bypass the confirmation prompt.\n\n------\n\n#### options.logItems\n\n`{function} [options.logItems(options, shipit)]`\n\n##### Gulp example:\n\n```js\nvar options = {\n  logItems: function(options, shipit) {\n    return {\n      'Environment': options.targetEnv,\n      'Branch': shipit.config.branch,\n    };\n  },\n};\n\ngulp.task('shipit', function(cb) {\n  shipitCaptain(shipitConfig, options, cb);\n});\n\n```\n\n------\n\n#### options.init\n\n`{function} [options.init(shipit)]`\n\nRequire Shipit plugins or anything else you would have in your [`shipitfile`](https://github.com/shipitjs/shipit#example-shipitfilejs).\n\n`shipit.initConfig` will be called automatically if it has not already been called.\n\n##### Gulp example:\n\n```js\nvar options = {\n  init: function(options, shipit) {\n    require('shipit-deploy')(shipit);\n    require('shipit-shared')(shipit);\n  }\n};\n\ngulp.task('shipit', function(cb) {\n  shipitCaptain(shipitConfig, options, cb);\n});\n```\n\n------\n\n#### cb\n\n`{function} cb`\n\nOptional callback function, called when all Shipit tasks are complete.\n\n```js\nvar gulp   = require('gulp');\nvar shipitCaptain = require('shipit-captain');\n\ngulp.task('shipit', function(cb) {\n  shipitCaptain(shipitConfig, cb);\n});\n```\n\n## License\n\nMIT © [Tim kelty](http://fusionary.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkelty%2Fshipit-captain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkelty%2Fshipit-captain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkelty%2Fshipit-captain/lists"}