-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (45 loc) · 1.3 KB
/
Makefile
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
48
49
50
51
52
53
#Defaults
include .env
export #exports the .env variables
IMAGE ?= tulibraries/tul-hyku
VERSION ?= 1.0.0
HARBOR ?= harbor.k8s.temple.edu
HYKU ?= ghcr.io/samvera/hyku
build: build-web build-worker
build-web:
@docker build \
--build-arg APP_PATH=./hyrax-webapp \
--target hyku-web \
--tag $(HARBOR)/$(IMAGE)/web:$(VERSION) \
--tag $(HARBOR)/$(IMAGE)/web:latest \
--file Dockerfile \
--progress plain \
--no-cache .
build-worker:
@docker build --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg APP_PATH=./hyrax-webapp \
--target hyku-worker \
--tag $(HARBOR)/$(IMAGE)/worker:$(VERSION) \
--tag $(HARBOR)/$(IMAGE)/worker:latest \
--file Dockerfile \
--progress plain \
--no-cache .
scan:
trivy image "$(HARBOR)/$(IMAGE)/web:$(VERSION)" --scanners vuln;
deploy: deploy-web deploy-worker
deploy-web:
@docker push $(HARBOR)/$(IMAGE)/web:$(VERSION) \
# This "if" statement needs to be a one liner or it will fail.
# Do not edit indentation
@if [ $(VERSION) != latest ]; \
then \
docker push $(HARBOR)/$(IMAGE)/web:latest; \
fi
deploy-worker:
@docker push $(HARBOR)/$(IMAGE)/worker:$(VERSION) \
# This "if" statement needs to be a one liner or it will fail.
# Do not edit indentation
@if [ $(VERSION) != latest ]; \
then \
docker push $(HARBOR)/$(IMAGE)/worker:latest; \
fi