Skip to content

Commit

Permalink
add VERSION option to update target in Makefile + some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vpeil committed Jun 13, 2019
1 parent 408cb0f commit 3f3a85c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
.SUFFIXES:

.PHONY: generate update cover test tidy

usage:
@echo "usage: [ NETWORK_TEST=1 ] make TARGET"
@echo
@echo "targets:"
@echo " generate"
@echo " update"
@echo " update [ VERSION=<version> ]"
@echo " tidy"
@echo " test"
@echo " cover [ FILE=<path> ]"

generate:
carton exec bin/librecat generate forms
carton exec bin/librecat generate departments
carton exec -- bin/librecat generate forms
carton exec -- bin/librecat generate departments

update:
git checkout master
git pull --tags origin master
ifeq ($(strip $(VERSION)),)
echo "No VERSION specified; checking out HEAD of master branch"
else
git chekcout $(VERSION)
endif
carton install
carton exec bin/librecat generate forms
carton exec bin/librecat generate departments
./index.sh reindex
carton exec -- bin/librecat generate forms
carton exec -- bin/librecat generate departments
carton exec -- bin/librecat index switch
echo "Update complete!"

# Explicit need -j 1 parallel tests will put databases in an
Expand All @@ -35,7 +41,7 @@ else
endif

test:
prove -l -j 1 -r t
carton exec -- prove -l -j 1 -r t

tidy:
tidyall -r lib t

0 comments on commit 3f3a85c

Please sign in to comment.