This repository was archived by the owner on Nov 15, 2024. It is now read-only.
forked from pluralsight/hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (40 loc) · 1.3 KB
/
Makefile
File metadata and controls
47 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Makefile for building and running Docker containers
# Define variables
DOCKER_IMAGE_NAME = hydra-publish-test
DOCKERFILE = Dockerfile.new
PORT_MAPPING = -p 8088:8088
ENV_FILE = .env
# Target to build the Docker image
build:
sbt clean compile
sbt universal:packageBin
ls -a
unzip ingest/target/universal/*.zip -d ps-publish
ls -a
mv ps-publish/hydra-ingest*/* ps-publish
rm -rf ps-publish/hydra-ingest*
cd ps-publish/bin
docker build -t $(DOCKER_IMAGE_NAME) -f $(DOCKERFILE) .
# Target to run the Docker container
run:
docker run -d $(PORT_MAPPING) --env-file $(ENV_FILE) --name ${DOCKER_IMAGE_NAME} $(DOCKER_IMAGE_NAME)
# Target to stop and remove the Docker container
stop:
docker stop $(DOCKER_IMAGE_NAME)
docker rm $(DOCKER_IMAGE_NAME)
# Target to clean up all containers and images
clean:
docker stop $(DOCKER_IMAGE_NAME) || true
docker rm $(DOCKER_IMAGE_NAME) || true
docker rmi $(DOCKER_IMAGE_NAME) || true
rm -rf ps-publish
# Target to show available targets
help:
@echo "Available targets:"
@echo " build - Build the Docker image"
@echo " run - Run the Docker container"
@echo " stop - Stop and remove the Docker container"
@echo " clean - Clean up all containers and images"
@echo " help - Show this help message"
# By default, show the help message
.DEFAULT_GOAL := help