-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
69 lines (61 loc) · 1.8 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
IMG_TAG ?= latest
IMG ?= ghcr.io/internaldeveloperplatform/pocketidp:$(IMG_TAG)
PLATFORM ?= linux/amd64,linux/arm64
# Build the 5min-idp image
build:
docker buildx build --platform $(PLATFORM) -t $(IMG) .
# Ideally we could remove the next step, but docker on GHA doesn't support
# loading multi-platform builds yet
docker buildx build -t $(IMG) --load .
# Check the 5min-idp image
check-image:
docker run --rm -v $(PWD):/app $(IMG) ./image/check.sh
# Push the 5min-idp image
push:
docker buildx build --platform $(PLATFORM) -t $(IMG) --push .
# Initialize tflint
lint-init:
tflint --init
# Lint terraform directory
lint: lint-init
tflint --config ../.tflint.hcl --chdir=./setup/terraform
# Test the 5min-idp
test: build check-image
docker run --rm -i -h pocketidp --name 5min-idp \
-e HUMANITEC_ORG \
-v hum-5min-idp:/state \
-v $(HOME)/.humctl:/root/.humctl \
-v /var/run/docker.sock:/var/run/docker.sock \
--network bridge \
$(IMG) ./image/test.sh
# Run the locally built image
run-local: build
docker run --rm -it -h pocketidp --name 5min-idp \
-e HUMANITEC_ORG \
-e HUMANITEC_SERVICE_USER \
-e TLS_CA_CERT \
-e TLS_CERT_STRING \
-e TLS_KEY_STRING \
-v hum-5min-idp:/state \
-v $(HOME)/.humctl:/root/.humctl \
-v /var/run/docker.sock:/var/run/docker.sock \
--network bridge \
$(IMG)
# Run the locally built image and don't delete the state
run-local-persistent: build
docker run -it -h pocketidp --name 5min-idp \
-e HUMANITEC_ORG \
-e HUMANITEC_SERVICE_USER \
-e TLS_CA_CERT \
-e TLS_CERT_STRING \
-e TLS_KEY_STRING \
-v hum-5min-idp:/state \
-v $(HOME)/.humctl:/root/.humctl \
-v /var/run/docker.sock:/var/run/docker.sock \
--network bridge \
$(IMG)
# Re-do the Humanitec token in a running 5min-IDP
.PHONY: renew-token
renew-token:
humctl login -v9
docker cp ~/.humctl 5min-idp:/root/.humctl