Skip to content

Commit

Permalink
ci: migration to docker compose v2
Browse files Browse the repository at this point in the history
  • Loading branch information
cjuega committed Aug 24, 2024
1 parent d3d44b5 commit 4835373
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
SHELL := $(shell which bash)
# Test if the dependencies we need to run this Makefile are installed
DOCKER := $(shell command -v docker)
DOCKER_COMPOSE := $(shell command -v docker-compose)
.PHONY = deps
deps:
ifndef DOCKER
@echo "Docker is not available. Please install docker"
@exit 1
endif
ifndef DOCKER_COMPOSE
@echo "docker-compose is not available. Please install docker-compose"
@exit 1
endif
ifndef GITHUB_ACTIONS
yarn install --force
else
Expand All @@ -21,26 +16,26 @@ endif
# Start infrastructure containers in background
.PHONY = start_infra
start_infra:
docker-compose up -d --wait
docker compose up -d --wait

# Start infrastructure containers in background for CI
.PHONY = start_infra_ci
start_infra_ci:
ifndef GITHUB_ACTIONS
docker-compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2 kafka rabbitmq
docker compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2 kafka rabbitmq
else
docker compose up -d --wait dynamodb >/dev/null 2>&1
endif

# Start databases containers in background
.PHONY = start_database
start_database:
docker-compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2
docker compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2

# Start messaging containers in background
.PHONY = start_messaging
start_messaging:
docker-compose up -d --wait kafka kafka-ui rabbitmq
docker compose up -d --wait kafka kafka-ui rabbitmq

# Run tests
.PHONY = test
Expand All @@ -65,4 +60,4 @@ deploy:
# Clean containers
.PHONY = clean
clean:
docker-compose down --rmi local --volumes --remove-orphans
docker compose down --rmi local --volumes --remove-orphans

0 comments on commit 4835373

Please sign in to comment.