forked from trustbloc/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.45 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
# Copyright SecureKey Technologies Inc.
#
# SPDX-License-Identifier: Apache-2.0
AUTH_REST_PATH=cmd/auth-rest
# Namespace for the agent images
DOCKER_OUTPUT_NS ?= docker.pkg.github.com
AUTH_REST_IMAGE_NAME ?= trustbloc/hub-auth/auth-rest
# Tool commands (overridable)
ALPINE_VER ?= 3.11
GO_VER ?= 1.14
.PHONY: all
all: checks unit-test bdd-test
.PHONY: checks
checks: license lint
.PHONY: lint
lint:
@scripts/check_lint.sh
.PHONY: license
license:
@scripts/check_license.sh
.PHONY: unit-test
unit-test:
@scripts/check_unit.sh
.PHONY: auth-rest
auth-rest:
@echo "Building auth-rest"
@mkdir -p ./.build/bin
@cd ${AUTH_REST_PATH} && go build -o ../../.build/bin/auth-rest main.go
.PHONY: auth-rest-docker
auth-rest-docker:
@echo "Building auth rest docker image"
@docker build -f ./images/auth-rest/Dockerfile --no-cache -t $(DOCKER_OUTPUT_NS)/$(AUTH_REST_IMAGE_NAME):latest \
--build-arg GO_VER=$(GO_VER) \
--build-arg ALPINE_VER=$(ALPINE_VER) .
.PHONY: bdd-test
bdd-test: clean auth-rest-docker generate-test-keys
@scripts/check_integration.sh
.PHONY: generate-test-keys
generate-test-keys: clean
@mkdir -p -p test/bdd/fixtures/keys/tls
@docker run -i --rm \
-v $(abspath .):/opt/workspace/hub-auth \
--entrypoint "/opt/workspace/hub-auth/scripts/generate_test_keys.sh" \
frapsoft/openssl
.PHONY: clean
clean: clean-build
.PHONY: clean-build
clean-build:
@rm -Rf ./.build
@rm -Rf ./test/bdd/fixtures/keys/tls
@rm -Rf ./test/bdd/docker-compose.log