-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 1.31 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
include make.conf
# Variables from make.conf:
#
# DOCKER_REPO
SHELL := /bin/bash
APPNAME := calendar-kiosk
REQS := sassc msgfmt
K := $(foreach r, ${REQS}, $(if $(shell command -v ${r} 2> /dev/null), '', $(error "${r} not installed")))
LANGUAGES := $(wildcard language/*/LC_MESSAGES)
JAVASCRIPT := $(shell find public -name '*.js' ! -name '*-*.js')
VERSION := $(shell cat VERSION | tr -d "[:space:]")
COMMIT := $(shell git rev-parse --short HEAD)
default: clean compile package
clean:
rm -Rf build/${APPNAME}*
for f in $(shell find public/css -name '*-*.css' ); do rm $$f; done
for f in $(shell find data/Themes -name '*-*.css' ); do rm $$f; done
compile:
cd ${LANGUAGES} && msgfmt -cv *.po
cd public/css && sassc -t compact -m screen.scss screen-${VERSION}.css
cd data/Themes/COB/public/css && sassc -t compact -m screen.scss screen-${VERSION}.css
for f in ${JAVASCRIPT}; do cp $$f $${f%.js}-${VERSION}.js; done
test:
vendor/phpunit/phpunit/phpunit -c src/Test/Unit.xml
package:
[[ -d build ]] || mkdir build
rsync -rl --exclude-from=buildignore . build/${APPNAME}
cd build && tar czf ${APPNAME}-${VERSION}.tar.gz ${APPNAME}
dockerfile:
docker build build/${APPNAME} --platform=linux/amd64 -t ${DOCKER_REPO}/${APPNAME}:${VERSION}-${COMMIT}
docker push ${DOCKER_REPO}/${APPNAME}:${VERSION}-${COMMIT}