This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
86 lines (68 loc) · 2.27 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright SecureKey Technologies Inc.
#
# SPDX-License-Identifier: Apache-2.0
DOCKER_OUTPUT_NS ?= ghcr.io
# Namespace for the did method image
DID_METHOD_REST_IMAGE_NAME ?= trustbloc/driver-did-trustbloc
DID_METHOD_CLI_IMAGE_NAME ?= trustbloc/did-method-cli
# Tool commands (overridable)
ALPINE_VER ?= 3.12
GO_VER ?= 1.16
.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: bdd-test
bdd-test: clean did-method-cli did-method-rest-docker generate-test-keys
@mkdir -p ./test/bdd/fixtures/wellknown/jws
@scripts/check_integration.sh
.PHONY: did-method-rest
did-method-rest:
@echo "Building did-method-rest"
@mkdir -p ./.build/bin
@cd cmd/did-method-rest && go build -o ../../.build/bin/did-method main.go
.PHONY: did-method-cli
did-method-cli:
@echo "Building did-method-cli"
@mkdir -p ./.build/bin
@cd cmd/did-method-cli && go build -o ../../.build/bin/cli main.go
.PHONY: generate-config-hash
generate-config-hash: did-method-cli
@echo "Generate config hash"
@scripts/generate_config_hash.sh
.PHONY: did-method-rest-docker
did-method-rest-docker:
@echo "Building did method docker image"
@docker build -f ./images/did-method-rest/Dockerfile --no-cache -t $(DOCKER_OUTPUT_NS)/$(DID_METHOD_REST_IMAGE_NAME):latest \
--build-arg GO_VER=$(GO_VER) \
--build-arg ALPINE_VER=$(ALPINE_VER) .
.PHONY: did-method-cli-docker
did-method-cli-docker:
@echo "Building did method cli docker image"
@docker build -f ./images/did-method-cli/Dockerfile --no-cache -t $(DOCKER_OUTPUT_NS)/$(DID_METHOD_CLI_IMAGE_NAME):latest \
--build-arg GO_VER=$(GO_VER) \
--build-arg ALPINE_VER=$(ALPINE_VER) . || (echo "build failed $$?"; exit 1)
.PHONY: generate-test-keys
generate-test-keys:
@mkdir -p -p test/bdd/fixtures/keys/tls
@docker run -i --rm \
-v $(abspath .):/opt/workspace/trustbloc-did-method \
--entrypoint "/opt/workspace/trustbloc-did-method/scripts/generate_test_keys.sh" \
frapsoft/openssl
.PHONY: clean
clean: clean-build
.PHONY: clean-build
clean-build:
@rm -Rf ./.build
@rm -Rf ./coverage.txt
@rm -Rf ./test/bdd/fixtures/keys/tls
@rm -Rf ./test/bdd/docker-compose.log