2020-08-25 12:31:48 +02:00
|
|
|
|
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
* Windows:
|
|
|
|
* [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-windows)
|
|
|
|
* make
|
|
|
|
* macOS:
|
|
|
|
* [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-mac)
|
|
|
|
* make
|
|
|
|
* Linux:
|
2022-03-11 12:47:50 +01:00
|
|
|
* [Docker 20.10 or later](https://docs.docker.com/engine/install/)
|
2020-08-25 12:31:48 +02:00
|
|
|
* make
|
|
|
|
|
|
|
|
### Building the CLI
|
|
|
|
|
|
|
|
Once you have the prerequisites installed, you can build the CLI using:
|
|
|
|
|
|
|
|
```console
|
|
|
|
make
|
|
|
|
```
|
|
|
|
|
2022-08-12 15:05:52 +02:00
|
|
|
This will output a `docker-compose` CLI plugin for your host machine in
|
|
|
|
`./bin/build`.
|
2020-08-25 12:31:48 +02:00
|
|
|
|
|
|
|
You can statically cross compile the CLI for Windows, macOS, and Linux using the
|
|
|
|
`cross` target.
|
|
|
|
|
|
|
|
### Unit tests
|
|
|
|
|
|
|
|
To run all of the unit tests, run:
|
|
|
|
|
|
|
|
```console
|
|
|
|
make test
|
|
|
|
```
|
|
|
|
|
|
|
|
If you need to update a golden file simply do `go test ./... -test.update-golden`.
|
|
|
|
|
2022-07-04 15:53:08 +02:00
|
|
|
### End-to-end tests
|
2022-11-29 16:52:22 +01:00
|
|
|
To run e2e tests, the Compose CLI binary needs to be built. All the commands to run e2e tests propose a version
|
2022-07-04 15:53:08 +02:00
|
|
|
with the prefix `build-and-e2e` to first build the CLI before executing tests.
|
2020-08-25 12:31:48 +02:00
|
|
|
|
2022-07-04 15:53:08 +02:00
|
|
|
Note that this requires a local Docker Engine to be running.
|
|
|
|
|
|
|
|
#### Whole end-to-end tests suite
|
|
|
|
|
|
|
|
To execute both CLI and standalone e2e tests, run :
|
|
|
|
|
|
|
|
```console
|
|
|
|
make e2e
|
|
|
|
```
|
|
|
|
|
2024-09-07 23:01:35 +02:00
|
|
|
Or if you need to build the CLI, run:
|
2022-07-04 15:53:08 +02:00
|
|
|
```console
|
|
|
|
make build-and-e2e
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Plugin end-to-end tests suite
|
|
|
|
|
|
|
|
To execute CLI plugin e2e tests, run :
|
2020-08-25 12:31:48 +02:00
|
|
|
|
|
|
|
```console
|
2021-08-31 18:53:24 +02:00
|
|
|
make e2e-compose
|
2020-08-25 12:31:48 +02:00
|
|
|
```
|
|
|
|
|
2022-07-04 15:53:08 +02:00
|
|
|
Or if you need to build the CLI, run:
|
|
|
|
```console
|
|
|
|
make build-and-e2e-compose
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Standalone end-to-end tests suite
|
|
|
|
|
|
|
|
To execute the standalone CLI e2e tests, run :
|
|
|
|
|
|
|
|
```console
|
|
|
|
make e2e-compose-standalone
|
|
|
|
```
|
|
|
|
|
|
|
|
Or if you need to build the CLI, run:
|
2022-08-12 15:05:52 +02:00
|
|
|
|
2022-07-04 15:53:08 +02:00
|
|
|
```console
|
|
|
|
make build-and-e2e-compose-standalone
|
|
|
|
```
|
2021-08-30 15:58:38 +02:00
|
|
|
|
2020-08-25 12:31:48 +02:00
|
|
|
## Releases
|
|
|
|
|
|
|
|
To create a new release:
|
2022-11-29 16:52:22 +01:00
|
|
|
* Check that the CI is green on the main branch for the commit you want to release
|
2024-09-07 23:01:35 +02:00
|
|
|
* Run the release GitHub Actions workflow with a tag of form vx.y.z following existing tags.
|
2020-08-25 12:31:48 +02:00
|
|
|
|
2021-08-31 18:53:24 +02:00
|
|
|
This will automatically create a new tag, release and make binaries for
|
2020-08-25 12:31:48 +02:00
|
|
|
Windows, macOS, and Linux available for download on the
|
2021-08-31 18:53:24 +02:00
|
|
|
[releases page](https://github.com/docker/compose/releases).
|