-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.sample
65 lines (53 loc) · 1.72 KB
/
Makefile.sample
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
54
55
56
57
58
59
60
61
62
63
64
65
# Purpose:
# Contains Docker-related tasks.
#
# Prepare (done once):
# - Copy file to 'Makefile' ($ cp Makefile.sample Makefile)
#
# Usage:
# - $ make <task>
#
# Examples:
# - $ make build
# variables
OPENJDK_TAG=11.0.13
SBT_VERSION=1.5.7
APP_NAME=pedscreen
APP_VERSION=1.2
env_build:
# environment variables for build
@printenv | grep -E '(GITHUB_ACCOUNT|GITHUB_TOKEN|BRANCH)'
env_run:
@echo
# environment variables for build
@printenv | grep -E '(CLARITY_URI|CLARITY_USER|CLARITY_PASSWORD|POSTGRES_URI|PEDSCREEN_USER|PEDSCREEN_PASSWORD)'
env: env_build env_run
build:
@echo 'Building image...'
docker build \
--no-cache \
--build-arg OPENJDK_TAG=$(OPENJDK_TAG) \
--build-arg SBT_TAG=$(OPENJDK_TAG)_${SBT_VERSION} \
--build-arg REPO_URI="https://$(GITHUB_ACCOUNT):$(GITHUB_TOKEN)@github.com/chop-dbhi/ped-screen" \
--build-arg BRANCH=$(BRANCH) \
--tag $(APP_NAME):${APP_VERSION} \
--tag ghcr.io/$(GITHUB_ACCOUNT)/$(APP_NAME) \
--tag $(APP_NAME):latest \
.
# https://docs.docker.com/engine/sbom/
sbom:
@echo 'Generating software bill of materials...'
docker sbom $(APP_NAME):${APP_VERSION}
tty:
@echo 'Starting terminal session...'
docker run -it --rm --env-file=.pedscreen/.env --entrypoint /bin/bash $(APP_NAME):latest
param:
@echo 'Running container...'
docker run --rm --env-file=.pedscreen/.env $(APP_NAME):latest
run:
@echo 'Running container...'
docker run --rm --env-file=.pedscreen/.env --volume $(PWD)/output:/app/output $(APP_NAME):latest --department_id 123456 --location_id ABCD --date_start 2020-01-01 --date_end 2020-01-31
publish:
@echo 'Publishing image to Github...'
echo $(GITHUB_TOKEN) | docker login ghcr.io -u GITHUB_ACCOUNT --password-stdin
docker push ghcr.io/$(GITHUB_ACCOUNT)/$(APP_NAME):latest