Skip to content

Commit

Permalink
fix(e2e): replace docker-compose w/ docker compose (backport #3614) (#…
Browse files Browse the repository at this point in the history
…3616)

Refs actions/runner-images#10384



---

#### PR checklist

- [ ] ~~Tests written/updated~~
- [ ] ~~Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)~~
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #3614 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
  • Loading branch information
mergify[bot] and melekes authored Aug 5, 2024
1 parent e9bd8a9 commit 9de925c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ build_c-amazonlinux:
#? localnet-start: Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
docker-compose up
docker compose up -d
.PHONY: localnet-start

#? localnet-stop: Stop testnet
localnet-stop:
docker-compose down
docker compose down
.PHONY: localnet-stop

#? build-contract-tests-hooks: Build hooks for dredd, to skip or add information on some steps
Expand Down
2 changes: 1 addition & 1 deletion docs/networks/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ To change the number of validators / non-validators change the `localnet-start`
```makefile
localnet-start: localnet-stop
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi
docker-compose up
docker compose up -d
```

The command now will generate config files for 5 validators and 3
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/pkg/infra/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,21 @@ services:
// ExecCompose runs a Docker Compose command for a testnet.
func ExecCompose(ctx context.Context, dir string, args ...string) error {
return exec.Command(ctx, append(
[]string{"docker-compose", "-f", filepath.Join(dir, "docker-compose.yml")},
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yml")},
args...)...)
}

// ExecCompose runs a Docker Compose command for a testnet and returns the command's output.
func ExecComposeOutput(ctx context.Context, dir string, args ...string) ([]byte, error) {
return exec.CommandOutput(ctx, append(
[]string{"docker-compose", "-f", filepath.Join(dir, "docker-compose.yml")},
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yml")},
args...)...)
}

// ExecComposeVerbose runs a Docker Compose command for a testnet and displays its output.
func ExecComposeVerbose(ctx context.Context, dir string, args ...string) error {
return exec.CommandVerbose(ctx, append(
[]string{"docker-compose", "-f", filepath.Join(dir, "docker-compose.yml")},
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yml")},
args...)...)
}

Expand Down

0 comments on commit 9de925c

Please sign in to comment.