Skip to content

Commit

Permalink
Merge pull request #330 from ministryofjustice/nd-137
Browse files Browse the repository at this point in the history
lower tech debt, by consolidating logic
  • Loading branch information
jamesgreen-moj authored Apr 3, 2024
2 parents c8f9581 + 68629c0 commit 5e3d5e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,12 @@ deploy: ## Run deploy script
build-dev: ## Build dev image
$(DOCKER_COMPOSE) build

.PHONY: start-db
start-db: ## start database
$(DOCKER_COMPOSE) up -d db
./scripts/wait_for_db.sh

.PHONY: stop
stop: ## Stop and remove containers
$(DOCKER_COMPOSE) down -v

.PHONY: run
run: ## Build dev image and start dhcp container
$(MAKE) start-db
$(DOCKER_COMPOSE) up -d dhcp-primary
./scripts/wait_for_dhcp_server.sh
$(DOCKER_COMPOSE) up -d dhcp-standby
Expand All @@ -70,12 +64,10 @@ test: ## Build dev container, start dhcp container, run tests

.PHONY: shell
shell: ## Build dev image and start dhcp in shell
$(MAKE) start-db
$(DOCKER_COMPOSE) run --rm dhcp-primary sh

.PHONY: shell-test
shell-test: ## Build dev container and tests in shell
$(MAKE) start-db
$(DOCKER_COMPOSE) run --rm dhcp-test sh

.PHONY: logs
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ services:
build:
context: ./dhcp-service
depends_on:
- db
db:
condition: service_healthy
environment:
INTERFACE: eth0
DB_NAME: kea
Expand Down Expand Up @@ -104,6 +105,10 @@ services:
MYSQL_DATABASE: kea
ports:
- 3306:3306
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-uroot", "-ppassword" ]
timeout: 20s
retries: 10

networks:
default:
Expand Down
11 changes: 0 additions & 11 deletions scripts/wait_for_db.sh

This file was deleted.

0 comments on commit 5e3d5e8

Please sign in to comment.