-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (30 loc) · 922 Bytes
/
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
IMAGE ?= devkteam/sonarqube-report
BUILD_IMAGE_TAG ?= $(IMAGE):build
NAME = sonarqube-report
CWD = $(shell pwd)
.EXPORT_ALL_VARIABLES:
.PHONY: build stop logs logs-follow clean shell test test-run test-build
default: build
build:
docker build -t $(BUILD_IMAGE_TAG) .
test-build: build test
test:
mkdir reports >/dev/null 2>&1 || true
docker run -it --rm -v $(shell pwd)/reports:/mnt/reports --env-file .env $(BUILD_IMAGE_TAG)
test-run:
mkdir reports >/dev/null 2>&1 || true
docker run -it --rm -v $(shell pwd)/reports:/mnt/reports --env-file .env $(BUILD_IMAGE_TAG) sh
shell:
docker exec -u docker -it $(NAME) bash -il
stop:
docker stop $(NAME)
logs:
docker logs $(NAME)
logs-follow:
docker logs -f $(NAME)
clean:
docker rm -vf $(NAME) >/dev/null 2>&1 || true
push:
docker tag $(BUILD_IMAGE_TAG) devkteam/sonarqube-report:latest
docker push devkteam/sonarqube-report:latest
build-push: build push