forked from moira-alert/web2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (56 loc) · 1.55 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
GIT_TAG := $(shell git describe --always --tags --abbrev=0 | tail -c+2)
GIT_COMMIT := $(shell git rev-list v${GIT_TAG}..HEAD --count)
VERSION := ${GIT_TAG}.${GIT_COMMIT}
IMAGE_NAME := kontur/moira-web2
RELEASE := 1
VENDOR := "SKB Kontur"
URL := "https://github.com/moira-alert/web2.0"
LICENSE := "GPLv3"
.PHONY: default build test prepare clean tar rpm deb packages docker_image docker_push docker_push_release
default: test build tar
build:
npm run build
test: prepare
npm run lint
prepare:
npm install
clean:
rm -rf build
tar:
mkdir -p build/root/var/www/moira || true
cp -rf favicon.ico build/root/var/www/moira/
cp -rf config.json.example build/root/var/www/moira/
cp -rf dist/* build/root/var/www/moira/
tar -czvPf build/moira-web2-${VERSION}-${RELEASE}.tar.gz -C build/root .
rpm:
fpm -t rpm \
-s "tar" \
--description "Moira Web2" \
--vendor ${VENDOR} \
--url ${URL} \
--license ${LICENSE} \
--name "moira-web" \
--version "${VERSION}" \
--iteration "${RELEASE}" \
-p build \
build/moira-web2-${VERSION}-${RELEASE}.tar.gz
deb:
fpm -t deb \
-s "tar" \
--description "Moira Web2" \
--vendor ${VENDOR} \
--url ${URL} \
--license ${LICENSE} \
--name "moira-web" \
--version "${VERSION}" \
--iteration "${RELEASE}" \
-p build \
build/moira-web2-${VERSION}-${RELEASE}.tar.gz
packages: clean tar rpm deb
docker_image:
docker build -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
docker_push:
docker push ${IMAGE_NAME}:latest
docker_push_release:
docker push ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}:${VERSION}