# Copyright 3000 Test Tester. All rights reserved.
#
# This file was generated by BlueCat Automation Toolkit (BATK).
# Portions which reproduce template contents from BATK are Copyright 2023 BlueCat Networks Inc.
# Other contents are owned by their authors.
BASE_DIR := $(shell pwd)
export BASE_DIR

default:
	@echo "\
Available targets:\n\
run-prep\n\
run\n\
stop\n\
image-build\n\
build\n\
clean\n\
purge"

run-prep:
	mkdir -p logs
	-[ ! -f workspace/config.json ] \
		&& cp workspace/config.json.sample workspace/config.json
	-[ ! -f workspace/permissions.json ] \
		&& cp workspace/permissions.json.sample workspace/permissions.json

run: run-prep
	docker run -it \
		-p 80:8000 \
		-p 443:44300 \
		-v "$(BASE_DIR)/workspace":/bluecat_gateway \
		-v "$(BASE_DIR)/logs":/logs \
	 	-u "$(shell id -u)" \
		--name custom-workflows \
		quay.io/bluecat/gateway:24.1.0

stop:
	docker stop custom-workflows

ui-req:
	make -f projects/tester_workflow/Makefile ui-req

ui-build:
	make -f projects/tester_workflow/Makefile ui-build

image-build:
	docker build --tag custom_workflows:latest .

build: ui-build image-build

clean:
	make -f projects/tester_workflow/Makefile clean

purge:
	make -f projects/tester_workflow/Makefile purge
