Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into add-rsync-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh-dixit authored Aug 30, 2019
2 parents 47e118e + fb39d5c commit a9d241a
Show file tree
Hide file tree
Showing 33 changed files with 4,097 additions and 3,723 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js

node_js:
- 6
- 8
- 10

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.28.4
Expand All @@ -18,8 +18,8 @@ notifications:
cache:
yarn: true
directories:
- ".eslintcache"
- "node_modules"
- '.eslintcache'
- 'node_modules'

addons:
ssh_known_hosts: test.shipitjs.com
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.1.0](https://github.com/shipitjs/shipit/compare/v5.0.0...v5.1.0) (2019-08-28)


### Bug Fixes

* correct peerDependencies field for shipit-deploy package ([#243](https://github.com/shipitjs/shipit/issues/243)) ([3586c21](https://github.com/shipitjs/shipit/commit/3586c21))


### Features

* **shipit-deploy:** Added config so you can rsync including the folder ([#246](https://github.com/shipitjs/shipit/issues/246)) ([64481f8](https://github.com/shipitjs/shipit/commit/64481f8))
* **ssh-pool:** Added ssh config array to remote server ([#248](https://github.com/shipitjs/shipit/issues/248)) ([ba1d8c2](https://github.com/shipitjs/shipit/commit/ba1d8c2))





# [4.2.0](https://github.com/shipitjs/shipit/compare/v4.1.4...v4.2.0) (2019-03-01)


Expand Down
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[![Tweet][twitter-badge]][twitter]

## Install shipit command line tools and shipit-deploy in your project

```
npm install --save-dev shipit-cli
npm install --save-dev shipit-deploy
Expand All @@ -25,10 +26,10 @@ Shipit provides a good alternative to Capistrano or other build tools. It is eas

**Features:**

* Write your task using JavaScript
* Task flow based on [orchestrator](https://github.com/orchestrator/orchestrator)
* Login and interactive SSH commands
* Easily extendable
- Write your task using JavaScript
- Task flow based on [orchestrator](https://github.com/orchestrator/orchestrator)
- Login and interactive SSH commands
- Easily extendable

## Deploy using Shipit

Expand Down Expand Up @@ -194,9 +195,9 @@ Type: `String` or `Array<String>`

The server can use the shorthand syntax or an object:

* `user@host`: user and host
* `user@host:4000`: user, host and port
* `{ user, host, port }`: an object
- `user@host`: user and host
- `user@host:4000`: user, host and port
- `{ user, host, port, extraSshOptions }`: an object

### Shipit Deploy configuration

Expand Down Expand Up @@ -331,36 +332,36 @@ shipit.log('hello %s', 'world')

## Dependencies

* [OpenSSH](http://www.openssh.com/) 5+
* [rsync](https://rsync.samba.org/) 3+
- [OpenSSH](http://www.openssh.com/) 5+
- [rsync](https://rsync.samba.org/) 3+

## Known Plugins

### Official

* [shipit-deploy](https://github.com/shipitjs/shipit/tree/master/packages/shipit-deploy)
- [shipit-deploy](https://github.com/shipitjs/shipit/tree/master/packages/shipit-deploy)

### Third Party

* [shipit-shared](https://github.com/timkelty/shipit-shared)
* [shipit-db](https://github.com/timkelty/shipit-db)
* [shipit-assets](https://github.com/timkelty/shipit-assets)
* [shipit-ssh](https://github.com/timkelty/shipit-ssh)
* [shipit-utils](https://github.com/timkelty/shipit-utils)
* [shipit-npm](https://github.com/callerc1/shipit-npm)
* [shipit-aws](https://github.com/KrashStudio/shipit-aws)
* [shipit-captain](https://github.com/timkelty/shipit-captain/)
* [shipit-bower](https://github.com/willsteinmetz/shipit-bower)
* [shipit-composer](https://github.com/jeremyzahner/shipit-composer)
* [shipit-bastion](https://github.com/BrokerageEngine/shipit-bastion)
* [shipit-yaml](https://github.com/davidbernal/shipit-yaml)
* [shipit-conditional](https://github.com/BrokerageEngine/shipit-conditional)
- [shipit-shared](https://github.com/timkelty/shipit-shared)
- [shipit-db](https://github.com/timkelty/shipit-db)
- [shipit-assets](https://github.com/timkelty/shipit-assets)
- [shipit-ssh](https://github.com/timkelty/shipit-ssh)
- [shipit-utils](https://github.com/timkelty/shipit-utils)
- [shipit-npm](https://github.com/callerc1/shipit-npm)
- [shipit-aws](https://github.com/KrashStudio/shipit-aws)
- [shipit-captain](https://github.com/timkelty/shipit-captain/)
- [shipit-bower](https://github.com/willsteinmetz/shipit-bower)
- [shipit-composer](https://github.com/jeremyzahner/shipit-composer)
- [shipit-bastion](https://github.com/BrokerageEngine/shipit-bastion)
- [shipit-yaml](https://github.com/davidbernal/shipit-yaml)
- [shipit-conditional](https://github.com/BrokerageEngine/shipit-conditional)

## Who use Shipit?

* [Le Monde](http://www.lemonde.fr)
* [Ghost blogging platform](https://ghost.org/)
* [Fusionary](http://fusionary.com)
- [Le Monde](http://www.lemonde.fr)
- [Ghost blogging platform](https://ghost.org/)
- [Fusionary](http://fusionary.com)

## License

Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
testEnvironment: 'node',
roots: ['packages'],
coverageDirectory: './coverage/'
coverageDirectory: './coverage/',
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.3",
"npmClient": "yarn",
"version": "4.2.0",
"version": "5.1.0",
"useWorkspaces": true
}
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,29 @@
"test": "jest --runInBand"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/node": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/node": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-preset-env": "^1.7.0",
"chalk": "^2.4.1",
"codecov": "^3.1.0",
"conventional-github-releaser": "^3.1.2",
"eslint": "^5.8.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint": "^6.2.2",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.1.0",
"eslint-plugin-import": "^2.18.2",
"glob": "^7.1.3",
"jest": "^23.6.0",
"lerna": "^3.4.3",
"micromatch": "^3.1.9",
"jest": "^24.9.0",
"jest-watch-typeahead": "^0.4.0",
"lerna": "^3.16.4",
"mkdirp": "^0.5.1",
"mock-utf8-stream": "^0.1.1",
"prettier": "^1.14.3",
"std-mocks": "^1.0.1",
"string-length": "^2.0.0"
"std-mocks": "^1.0.1"
},
"workspaces": [
"packages/*"
Expand Down
8 changes: 8 additions & 0 deletions packages/shipit-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.1.0](https://github.com/shipitjs/shipit/tree/master/packages/shipit-deploy/compare/v5.0.0...v5.1.0) (2019-08-28)

**Note:** Version bump only for package shipit-cli





# [4.2.0](https://github.com/shipitjs/shipit/tree/master/packages/shipit-deploy/compare/v4.1.4...v4.2.0) (2019-03-01)


Expand Down
28 changes: 16 additions & 12 deletions packages/shipit-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,28 @@ shipit.log('hello %s', 'world')

## Workflow tasks

When the system initializes it automatically emits events:
* Emit event "init"
* Emit event "init:after_ssh_pool"
When the system initializes it automatically emits events:

- Emit event "init"
- Emit event "init:after_ssh_pool"

Each shipit task also generates events:
* Emit event "task_start"
* Emit event "task_stop"
* Emit event "task_err"
* Emit event "task_not_found"

- Emit event "task_start"
- Emit event "task_stop"
- Emit event "task_err"
- Emit event "task_not_found"

Inside the task events, you can test for the task name.

```js
shipit.on("task_start", (event) => {
if (event.task == "first_task"){
shipit.log("I'm the first task");
}
});
shipit.on('task_start', event => {
if (event.task == 'first_task') {
shipit.log("I'm the first task")
}
})
```

## License

MIT
Expand Down
9 changes: 4 additions & 5 deletions packages/shipit-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shipit-cli",
"version": "4.2.0",
"version": "5.1.0",
"description": "Universal automation and deployment tool written in JavaScript.",
"engines": {
"node": ">=6"
Expand All @@ -26,13 +26,12 @@
},
"dependencies": {
"chalk": "^2.4.1",
"commander": "^2.15.0",
"lodash": "^4.17.10",
"commander": "^3.0.0",
"interpret": "^1.1.0",
"liftoff": "^2.5.0",
"liftoff": "^3.1.0",
"orchestrator": "^0.3.7",
"pretty-hrtime": "^1.0.0",
"ssh-pool": "^4.1.2",
"ssh-pool": "^5.1.0",
"stream-line-wrapper": "^0.1.1",
"v8flags": "^3.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shipit-cli/src/Shipit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-console */
/* eslint-disable no-console, no-underscore-dangle */
import { ConnectionPool, exec } from 'ssh-pool'
import LineWrapper from 'stream-line-wrapper'
import Orchestrator from 'orchestrator'
Expand Down
21 changes: 10 additions & 11 deletions packages/shipit-cli/src/Shipit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ describe('Shipit', () => {
expect(shipit.initSshPool).toBeCalled()
})
it('should emit a "init" event', async () => {
const spy = jest.fn()
shipit.on('init', spy)
expect(spy).toHaveBeenCalledTimes(0)
shipit.initialize()
expect(spy).toHaveBeenCalledTimes(1)
const spy = jest.fn()
shipit.on('init', spy)
expect(spy).toHaveBeenCalledTimes(0)
shipit.initialize()
expect(spy).toHaveBeenCalledTimes(1)
})

})

describe('#initSshPool', () => {
Expand All @@ -73,11 +72,11 @@ describe('Shipit', () => {
})
it('should emit a "init:after_ssh_pool" event', async () => {
shipit.config = { servers: ['deploy@my-server'] }
const spy = jest.fn()
shipit.on('init:after_ssh_pool', spy)
expect(spy).toHaveBeenCalledTimes(0)
shipit.initSshPool()
expect(spy).toHaveBeenCalledTimes(1)
const spy = jest.fn()
shipit.on('init:after_ssh_pool', spy)
expect(spy).toHaveBeenCalledTimes(0)
shipit.initSshPool()
expect(spy).toHaveBeenCalledTimes(1)
})
})

Expand Down
4 changes: 2 additions & 2 deletions packages/shipit-cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ async function asyncInvoke(env) {
const shipit = new Shipit({ environment })

try {
/* eslint-disable global-require, import/no-dynamic-import, import/no-dynamic-require */
/* eslint-disable global-require, import/no-dynamic-require */
const module = require(env.configPath)
/* eslint-enable global-require, import/no-dynamic-import, import/no-dynamic-require */
/* eslint-enable global-require, import/no-dynamic-require */
const initialize =
typeof module.default === 'function' ? module.default : module
await initialize(shipit)
Expand Down
Loading

0 comments on commit a9d241a

Please sign in to comment.