Skip to content

Commit cb3bade

Browse files
authored
update: instructions to update openapi (#350)
* Add openapi submodule instructions to README.md Add instructions for updating the influx-cli/openapi git submodule when regenerating the CLI. * update: instructions to update openapi Add instructions to update and regenerate influx-cli/openapi when changing commits.
1 parent 7af0b2a commit cb3bade

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

README.md

+33-6
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,44 @@ This repository decouples the `influx` CLI from the OSS `influxdb` codebase. Our
99
2. Enable faster turn-around on fixes/features that only affect the CLI
1010
3. Allow the CLI to be built & released for a wider range of platforms than the server can support
1111

12-
## Building
12+
## Building the CLI
1313

14-
Run `make` or `make influx` to build the CLI. The output binary will be written to `bin/$(GOOS)/influx`.
14+
Follow these steps to build the CLI. If you're updating your CLI build, see *Updating openapi* below.
15+
1. Clone this repo (influx-cli) and change to your _influx-cli_ directory.
1516

16-
### Regenerating OpenAPI client
17+
```
18+
git clone [email protected]:influxdata/influx-cli.git
19+
cd influx-cli
20+
```
21+
22+
2. Build the CLI. The `make` and `make influx` commands write the new binary to `bin/$(GOOS)/influx`.
23+
24+
```
25+
make
26+
```
27+
28+
### Updating openapi
1729

30+
If you change or update your branch, you may also need to update `influx-cli/openapi` and regenerate the client code.
31+
`influx-cli/openapi` is a Git submodule that contains the underlying API contracts and client used by the CLI.
1832
We use [`OpenAPITools/openapi-generator`](https://github.com/OpenAPITools/openapi-generator) to generate
19-
the underlying HTTP client used by the CLI. Run `make openapi` to re-generate the code. You'll need Docker
20-
running locally for the script to work.
33+
the HTTP client.
2134

22-
## Running
35+
To update, run the following commands in your `influx-cli` repo:
36+
37+
1. Update the _openapi_ Git submodule. The following command pulls the latest commits for the branch and all submodules.
38+
39+
`git pull --recurse-submodules`
40+
41+
2. With [Docker](https://docs.docker.com/get-docker/) running locally, regenerate _openapi_.
42+
43+
`make openapi`
44+
45+
3. Rebuild the CLI
46+
47+
`make`
48+
49+
## Running the CLI
2350

2451
After building, use `influx -h` to see the list of available commands.
2552

0 commit comments

Comments
 (0)