fix #2 - Génération des fichiers utiles à la version production

This commit is contained in:
2018-09-04 12:43:46 +02:00
parent ce890c07fd
commit 58d6ed6032
4 changed files with 104 additions and 0 deletions

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
APP := $(shell head -n 1 "shard.yml"|cut -d ':' -f 2|tr -d ' ')
VERSION := $(shell sed '2!d' "shard.yml"|cut -d ':' -f 2|tr -d ' ')
DEST = /tmp/${APP}
all: build
bin:
mkdir -p bin
bin/${APP}:
crystal build src/${APP}.cr -o bin/${APP} --release --stats
bin/amber:
crystal build lib/amber/src/amber/cli.cr -o bin/amber --stats
build: bin bin/${APP} bin/amber
dependencies:
shards install
${DEST}:
mkdir -p ${DEST}
${APP}-${VERSION}.tar.gz: build ${DEST}
mkdir -p ${DEST}/config/environments/ ${DEST}/src/locales
cp -r bin/ ${DEST}/
cp -r db/ ${DEST}/
cp -r public/ ${DEST}/
cp -r src/locales ${DEST}/src/locales
cp config/environments/.production.enc ${DEST}/config/environments/
tar cvfJ "${APP}-${VERSION}.tar.xz" -C /tmp/ ${APP}
rm -rf ${DEST}
extract: ${APP}-${VERSION}.tar.gz
clean:
rm -f bin/amber
rm -f bin/${APP}
rm -rf ${DEST}