Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project config “.backportrc.json” #29

Merged
merged 20 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"semi": true
}
],
"no-underscore-dangle": "off",
"no-use-before-define": ["error", { "functions": false }],
"one-var": ["error", { "initialized": "never", "uninitialized": "always" }],
"no-console": 0,
"import/no-commonjs": 0,
"arrow-body-style": 0
},
"plugins": ["prettier"],
"extends": ["eslint:recommended", "prettier"]
"extends": ["airbnb-base", "prettier"]
}
2 changes: 2 additions & 0 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
instrumentation:
includeAllSources: true
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Jest",
"type": "node",
"request": "launch",
"args": ["--runInBand"],
"args": ["--runInBand", "${file}"],
"port": 9229,
"address": "localhost",
"stopOnEntry": false,
Expand Down
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backport",
"version": "2.0.1",
"version": "2.1.1-beta",
"main": "./src/cli/index.js",
"bin": {
"backport": "./src/cli/index.js"
Expand All @@ -15,35 +15,41 @@
"precommit": "lint-staged"
},
"lint-staged": {
"*.js": [
"prettier --write",
"git add"
]
"*.js": ["prettier --write", "git add"]
},
"repository": {
"type": "git",
"url": "git+https://github.com/sqren/backport.git"
},
"jest": {
"setupFiles": ["./test/setup.js"]
},
"dependencies": {
"axios": "^0.17.0",
"chalk": "^2.3.0",
"es6-promisify": "^5.0.0",
"find-up": "^2.1.0",
"inquirer": "^4.0.0",
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"mkdirp": "^0.5.1",
"nock": "^9.0.22",
"ora": "^1.3.0",
"strip-json-comments": "^2.0.1",
"yargs": "^10.0.3"
},
"devDependencies": {
"@types/jest": "^21.1.8",
"babel-eslint": "^8.0.2",
"eslint": "^4.11.0",
"eslint-config-prettier": "^2.7.0",
"eslint": "^4.12.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-prettier": "^2.3.1",
"husky": "^0.14.3",
"jest": "^21.2.1",
"lint-staged": "^5.0.0",
"prettier": "^1.8.2"
"lint-staged": "^6.0.0",
"nock": "^9.1.4",
"prettier": "^1.8.2",
"typescript": "^2.6.2"
}
}
63 changes: 37 additions & 26 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,26 @@ npm install -g backport

| Option | Description | Accepts |
| ------------------- | ----------------------------------------- | --------------------------- |
| --multiple | Backport multiple commits and/or versions | boolean |
| --multiple | Backport multiple commits and/or branches | boolean |
| --multiple-commits | Backport multiple commits | boolean (defaults to false) |
| --multiple-versions | Backport to multiple versions | boolean (defaults to true) |
| --sha | Supply a commit sha to backport | string |
| --multiple-branches | Backport to multiple branches | boolean (defaults to true) |
| --own | Only show own commits | boolean (defaults to true) |
| --config | Show configuration file | |
| --show-config | Show configuration | |
| --sha | Commit sha to backport | string |
| --help | Show help | |
| -v, --version | Show version number | |

### Configuration

#### Global Config

The first time you run `backport` a skeleton configuration file will be created
in `/<homedir>/.backport/config.json`. You need to update the config file with
your Github username and a Github Access Token (can be created
[here](https://github.com/settings/tokens/new)).

<details>
<summary>View config sample</summary>
<summary>View "config.json" sample</summary>

```js
{
Expand All @@ -54,33 +56,42 @@ your Github username and a Github Access Token (can be created
// Github username, eg. kimchy
"username": "",

// Override project-specific setting
"projects": []
}
```

</details>

#### Project-specific config

Add `.backportrc.json` to the root of your project with the following structure:

<details>
<summary>View ".backportrc.json" sample</summary>

```js
{
"upstream": "elastic/kibana",

// You can pre-select branches you use often
"branches": [
{ "name": "6.x", "checked": true },
{ "name": "6.1", "checked": true },
"6.0"
]

// Only allow picking own commits to backport
"own": true,

// Backport multiple commits
"multipleCommits": false,

// Backport to multiple versions
"multipleVersions": true,

// Repositories and the versions that will be available in backport cli
"repositories": [
{
"name": "elastic/elasticsearch",
"versions": ["6.x", "6.1", "6.0"]
},
{
"name": "elastic/kibana",

// You can pre-select versions you use often
"versions": [
{ "name": "6.x", "checked": true },
{ "name": "6.1", "checked": true },
"6.0"
]
"labels": ["backport"]
}
]
// Backport to multiple branches
"multipleBranches": true,

// Labels will be added to the PR
"labels": ["backport"]
}
```

Expand Down
Loading