fix #2 - Génération des fichiers utiles à la version production
This commit is contained in:
39
Makefile
Normal file
39
Makefile
Normal 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}
|
Reference in New Issue
Block a user