Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Apr 22, 2019
1 parent acf55ba commit 292d6bc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 26 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,44 @@ OR
npm install -g backport
```

After installation you must update the global config in `~/.backport/config` with your Github username and a Github access token. More info [here](https://github.com/sqren/backport/blob/master/docs/getting-started.md#new-user-create-user-config)
After installation you must update the global config in `~/.backport/config.json` with your Github username and a Github access token. More info [here](https://github.com/sqren/backport/blob/master/docs/getting-started.md#new-user-create-user-config)

## Run via Docker

If you don't have Node.js or git installed locally, you can run `backport` via Docker.
The easiest way is to add the following to your bash profile, and update `BACKPORT_FOLDER` and `GITCONFIG` if needed.
The easiest way is to add the following snippet to your bash profile:

```sh
backport() {
BACKPORT_FOLDER=~/.backport
GITCONFIG=~/.gitconfig
BACKPORT_CONFIG_DIR=~/.backport
GIT_CONFIG_FILE=~/.gitconfig

docker run -it --rm -v $(pwd):/app:ro -v $BACKPORT_FOLDER:/root/.backport -v $GITCONFIG:/etc/gitconfig sqren/backport "$@"
docker run -it --rm -v $(pwd):/app:ro -v $BACKPORT_CONFIG_DIR:/root/.backport -v $GIT_CONFIG_FILE:/etc/gitconfig sqren/backport "$@"
}
```

Where:

- `BACKPORT_CONFIG_DIR`: This can be ANY empty folder on your local machine. Upon running the docker container for the first time, a `config.json` will be created automatically. This must be filled out with `username` and `accessToken` or these must be passed as CLI arguments: `backport --username <username> --accessToken <accessToken>`
- `GIT_CONFIG_FILE`: Must point to a local [`.gitconfig`](https://gist.github.com/sqren/618ab2f77ffb8b5388d675fe705ed6da) file that contains the user's name and email.

You can now use `backport` as if it was installed locally.

## Usage

Run the CLI in your project folder (eg. in the Kibana folder):
Run the CLI in your project folder (must contain a [`.backportrc.json`](https://github.com/sqren/backport/blob/master/docs/configuration.md#project-specific-configuration) file):

```
> backport
```

Follow the steps. You can use the `arrow keys` to choose options, `<space>` to select checkboxes and `<enter>` to proceed.
or run this from anywhere:

```
> backport --upstream elastic/kibana
```

The above commands will start an interactive prompt. You can use the `arrow keys` to choose options, `<space>` to select checkboxes and `<enter>` to proceed.

### Options

Expand Down
18 changes: 9 additions & 9 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration

* [User configuration](#userglobal-configuration)
* [Project configuration](#project-specific-configuration)
- [User configuration](#userglobal-configuration)
- [Project configuration](#project-specific-configuration)

### User/global configuration

Expand All @@ -22,13 +22,13 @@ A personal access token can be created here: https://github.com/settings/tokens/

Please select the necessary access scopes:

* Private repository
* repo:status
* repo_deployment
* public_repo
* repo:invite
* Public repository
* public_repo
- **Private repository**
- repo:status
- repo_deployment
- public_repo
- repo:invite
- **Public repository**
- public_repo

##### `username` (string) **required**

Expand Down
23 changes: 13 additions & 10 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting started

* [Setup for new users](#new-user-create-user-config)
* [Configure new project](#new-project-create-project-config)
- [Setup for new users](#new-user-create-user-config)
- [Configure new project](#new-project-create-project-config)

### New user: create user config

Expand All @@ -22,15 +22,18 @@ Edit `~/.backport/config.json`:

**Create access token**

You can create a new access token [here](https://github.com/settings/tokens/new). The minimum permissions depends on the type of repository:
You can create a new access token [here](https://github.com/settings/tokens/new) (password required). The minimum permissions depends on whether the repository you want to access is private or public

* Private repository
* repo:status
* repo_deployment
* public_repo
* repo:invite
* Public repository
* public_repo
- **Private repository**
- repo:status
- repo_deployment
- public_repo
- repo:invite
- **Public repository**

- public_repo

Read more about [Github Access Tokens](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)

**Use `backport`**

Expand Down

0 comments on commit 292d6bc

Please sign in to comment.