-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
69 lines (53 loc) · 1.97 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
#
# Created by Szabó Gergely (Gerviba)
# https://github.com/Gerviba/webschop
#
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
version := $(shell cat $(mkfile_dir)pom.xml | grep '<version>' | head -2 | tail -1 | cut -d \> -f 2 | cut -d \< -f 1)
.PHONY: all
all: install
install:
./mvnw clean install
test:
./mvnw test
version:
@echo $(version)
run:
package:
./mvnw clean package spring-boot:repackage
docker-build: package
cp target/schpincer.jar docker/schpincer-latest.jar
docker build --file=docker/Dockerfile --tag=schpincer:latest --rm=true .
deploy: docker-build
docker tag schpincer registry.k8s.sch.bme.hu/schpincer/schpincer:$(version)
docker tag schpincer registry.k8s.sch.bme.hu/schpincer/schpincer:latest
docker push registry.k8s.sch.bme.hu/schpincer/schpincer:$(version)
docker push registry.k8s.sch.bme.hu/schpincer/schpincer:latest
@echo
@echo VERSION: $(version) | STATUS: DONE
@echo
docker-run:
docker run -d --name=schpincer --publish=80:80 \
--volume=$(mkfile_dir)docker/application-docker.properties:/opt/schpincer/application.properties \
--volume=schpincer-permanent-storage:/permanent/external/ \
--volume=schpincer-lucene-cache:/tmp/schpincer/search/ \
--network="host" \
schpincer:latest
docker-run-test:
docker run --name=schpincer --publish=8080:8080 \
--volume=$(mkfile_dir)docker/application-docker.properties:/opt/schpincer/application.properties \
--volume=$(mkfile_dir)test/external:/permanent/external/ \
--volume=$(mkfile_dir)docker/temp/schpincer/search:/tmp/schpincer/search/ \
--network="host" \
schpincer:latest
docker-stop:
docker stop schpincer
docker-remove:
docker rm schpincer || true
docker-volume-create:
docker volume create --name schpincer-permanent-storage
docker volume create --name schpincer-lucene-cache
new-publish:
docker build -t harbor.sch.bme.hu/org-kir-dev/sch-pincer -f docker/standalone-Dockerfile .
docker push harbor.sch.bme.hu/org-kir-dev/sch-pincer