2023-10-10 08:07:46 +00:00
|
|
|
project := dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral
|
|
|
|
|
2023-10-10 08:54:22 +00:00
|
|
|
# docker images
|
|
|
|
|
2023-10-10 09:08:32 +00:00
|
|
|
####
|
|
|
|
# orchestra image tag
|
|
|
|
####
|
|
|
|
|
2023-10-10 08:54:22 +00:00
|
|
|
orchestra_branch := `git -C django-orchestra branch --show-current`
|
|
|
|
orchestra_commit := `git -C django-orchestra log -1 --format=%h`
|
|
|
|
orchestra_tag := ${orchestra_branch}__${orchestra_commit}
|
2024-01-19 11:20:50 +00:00
|
|
|
orchestra_tag := latest
|
2023-10-10 08:54:22 +00:00
|
|
|
orchestra_image := ${project}/orchestra:${orchestra_tag}
|
|
|
|
|
2023-10-10 09:08:32 +00:00
|
|
|
####
|
|
|
|
# musician image tag
|
|
|
|
####
|
|
|
|
|
2023-10-10 08:54:22 +00:00
|
|
|
musician_branch := `git -C django-musician branch --show-current`
|
|
|
|
musician_commit := `git -C django-musician log -1 --format=%h`
|
2023-10-31 10:00:08 +00:00
|
|
|
musician_tag := ${musician_branch}__${musician_commit}
|
2024-01-19 11:20:50 +00:00
|
|
|
musician_tag := latest
|
2023-10-10 08:54:22 +00:00
|
|
|
musician_image := ${project}/musician:${musician_tag}
|
|
|
|
|
2024-01-19 11:20:50 +00:00
|
|
|
####
|
|
|
|
# devicehub image tag
|
|
|
|
####
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
|
|
|
|
devicehub_branch := `git -C devicehub-teal branch --show-current`
|
|
|
|
devicehub_commit := `git -C devicehub-teal log -1 --format=%h`
|
|
|
|
devicehub_tag := ${devicehub_branch}__${devicehub_commit}
|
|
|
|
devicehub_tag := latest
|
|
|
|
devicehub_image := ${project}/devicehub:${devicehub_tag}
|
|
|
|
|
2024-04-03 11:18:36 +00:00
|
|
|
postgres_tag := latest
|
|
|
|
postgres_image := ${project}/postgres:${postgres_tag}
|
|
|
|
|
2023-10-10 09:08:32 +00:00
|
|
|
####
|
|
|
|
# idhub image tag
|
|
|
|
####
|
2023-10-10 08:54:22 +00:00
|
|
|
|
2024-03-06 17:54:20 +00:00
|
|
|
# src https://stackoverflow.com/questions/33479645/substitute-character-in-makefile-variable-after-evaluation
|
|
|
|
idhub_branch_raw := $(shell git -C IdHub branch --show-current)
|
|
|
|
idhub_branch := $(subst /,-,$(idhub_branch_raw))
|
|
|
|
|
2023-10-31 10:00:08 +00:00
|
|
|
idhub_commit := `git -C IdHub log -1 --format=%h`
|
|
|
|
idhub_tag := ${idhub_branch}__${idhub_commit}
|
2024-01-19 11:20:50 +00:00
|
|
|
idhub_tag := latest
|
2023-10-10 09:08:32 +00:00
|
|
|
idhub_image := ${project}/idhub:${idhub_tag}
|
2023-10-10 08:07:46 +00:00
|
|
|
|
2023-12-12 13:35:17 +00:00
|
|
|
.PHONY: idhub_build
|
|
|
|
idhub_build:
|
2024-01-19 11:20:50 +00:00
|
|
|
docker build -f docker/idhub.Dockerfile -t ${idhub_image} -t ${project}/idhub:${idhub_branch}__latest .
|
2024-01-23 08:00:27 +00:00
|
|
|
.PHONY: orchestra_build
|
|
|
|
orchestra_build:
|
|
|
|
docker build -f docker/orchestra.Dockerfile -t ${orchestra_image} -t ${project}/orchestra:latest .
|
|
|
|
.PHONY: musician_build
|
|
|
|
musician_build:
|
|
|
|
docker build -f docker/musician.Dockerfile -t ${musician_image} -t ${project}/musician:latest .
|
2024-04-03 11:18:36 +00:00
|
|
|
.PHONY: devicehub_build
|
|
|
|
devicehub_build:
|
|
|
|
# thanks src https://stackoverflow.com/questions/1789594/how-do-i-write-the-cd-command-in-a-makefile
|
|
|
|
cd devicehub-teal; \
|
|
|
|
docker build -f docker/devicehub.Dockerfile -t ${devicehub_image} -t ${project}/devicehub:latest .
|
|
|
|
.PHONY: postgres_build
|
|
|
|
postgres_build:
|
|
|
|
# thanks src https://stackoverflow.com/questions/1789594/how-do-i-write-the-cd-command-in-a-makefile
|
|
|
|
cd devicehub-teal; \
|
|
|
|
docker build -f docker/postgres.Dockerfile -t ${postgres_image} -t ${project}/postgres:latest .
|
2023-12-12 13:35:17 +00:00
|
|
|
|
2023-10-10 08:07:46 +00:00
|
|
|
docker_build:
|
2023-11-24 11:33:55 +00:00
|
|
|
docker build -f docker/orchestra.Dockerfile -t ${orchestra_image} -t ${project}/orchestra:latest .
|
2024-01-19 11:20:50 +00:00
|
|
|
docker build -f docker/musician.Dockerfile -t ${musician_image} -t ${project}/musician:latest .
|
2023-12-12 13:35:17 +00:00
|
|
|
$(MAKE) idhub_build
|
2023-10-31 10:00:08 +00:00
|
|
|
@printf "\n##########################\n"
|
|
|
|
@printf "\nimage: ${orchestra_image}\n"
|
|
|
|
@printf "\nimage: ${musician_image}\n"
|
|
|
|
@printf "\nimage: ${idhub_image}\n"
|
|
|
|
@printf "\ndocker images built\n"
|
|
|
|
@printf "\n##########################\n\n"
|
2023-10-10 08:07:46 +00:00
|
|
|
|
|
|
|
docker_publish:
|
|
|
|
docker push ${orchestra_image}
|
|
|
|
docker push ${musician_image}
|
2023-10-31 10:00:08 +00:00
|
|
|
docker push ${idhub_image}
|
2023-10-10 08:07:46 +00:00
|
|
|
|
|
|
|
.PHONY: docker
|
|
|
|
docker:
|
|
|
|
$(MAKE) docker_build
|
|
|
|
$(MAKE) docker_publish
|
2023-11-03 12:52:44 +00:00
|
|
|
|
|
|
|
docker_down:
|
|
|
|
docker compose down -v
|