-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
49 lines (40 loc) · 1.35 KB
/
justfile
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
set dotenv-load := false
IS_PROD := env_var_or_default("IS_PROD", "")
COMPOSE_FILE := "--file=docker-compose.yml" + (
if IS_PROD != "true" {" --file=docker-compose.override.yml"} else {""}
)
DC := "docker-compose " + COMPOSE_FILE
INTEGRATION_TEST_PATH := "./integration"
# Show all available recipes
default:
@just --list --unsorted
# Create the .env file from the template
dotenv:
@([ ! -f .env ] && cp .env.example .env) || true
# Build the containers
build: dotenv
{{ DC }} build
# Spin up all (or one) service
up service="": dotenv
{{ DC }} up -d {{ service }}
# Tear down containers
down:
{{ DC }} down
# Pull all docker images
pull:
{{ DC }} pull
# Pull and deploy all images
deploy:
-git pull
@just pull
@just up
test-int test_path="":
@echo "Starting up spd-lookup services for integration testing"
{{ DC }} up -d
-while ! {{ DC }} logs --tail 1 api | grep -E 'starting server on port [0-9]{1,6}' ; do sleep 1s; done
@echo "spd-lookup services started, beginning integration testing"
@echo "***************************************"
-go test -v -tags=integrations {{ INTEGRATION_TEST_PATH }} -count=1 -run={{ test_path }}
@echo "spd-lookup integration testing completed, removing services"
@echo "***************************************"
{{ DC }} down