From bb3e580e67f3ce66a3431418065719fba1a16ed3 Mon Sep 17 00:00:00 2001
From: Andrey Ivanov <tiburon-777@users.noreply.github.com>
Date: Mon, 22 Mar 2021 09:15:36 -0400
Subject: [PATCH] HW15 WIP

---
 hw12_13_14_15_calendar/Makefile | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/hw12_13_14_15_calendar/Makefile b/hw12_13_14_15_calendar/Makefile
index 95971ff..68278dd 100644
--- a/hw12_13_14_15_calendar/Makefile
+++ b/hw12_13_14_15_calendar/Makefile
@@ -1,11 +1,25 @@
 cdir = $(shell pwd)
 
-integration-test:
+inplace-integration-test:
 	go test -count 10 -race ./cmd/calendar/... --config ./../../configs/calendar.conf
 
 bdd:
 	docker build -t bdd --network host -f test/Dockerfile .
 
+integration-test:
+	set -e ;\
+	docker-compose -f ./cicd/dc_sup.yml up -d --build ;\
+	docker-compose -f ./cicd/dc_calendar.yml up -d --build ;\
+	docker-compose -f ./cicd/dc_sender.yml up -d --build ;\
+	docker-compose -f ./cicd/dc_sheduler.yml up -d --build ;\
+	test_status_code=0 ;\
+	docker build -t bdd --network host -f test/Dockerfile . || test_status_code=$$? ;\
+	docker-compose -f ./cicd/dc_sup.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\
+	docker-compose -f ./cicd/dc_calendar.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\
+	docker-compose -f ./cicd/dc_sender.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\
+	docker-compose -f ./cicd/dc_sheduler.yml down --rmi local --volumes --remove-orphans --timeout 60 ;\
+	exit $$test_status_code
+
 test:
 	go test -race ./internal/... ./pkg/...
 
@@ -43,7 +57,4 @@ sup-up:
 sup-down:
 	docker-compose -f ./cicd/dc_sup.yml down
 
-clean:
-	docker rmi $(sudo docker images | grep '<none>' | awk '{print $3}')
-
 .PHONY: build run test lint
\ No newline at end of file