Skip to content

Commit

Permalink
del deploy/install-prod and _check-git-up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
gamesguru committed Apr 18, 2024
1 parent c949dc0 commit 905b3a2
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL=/bin/bash
# NOTE: must put a <TAB> character and two pound "\t##" to show up in this list. Keep it brief! IGNORE_ME
.PHONY: _help
_help:
@grep -h "##" $(MAKEFILE_LIST) | grep -v IGNORE_ME | sed -e 's/##//' | column -t -s $$'\t'
@grep -h "##" $(MAKEFILE_LIST) | grep -v IGNORE_ME | grep -v ^# | sed -e 's/##//' | column -t -s $$'\t'



Expand All @@ -18,7 +18,7 @@ format: ## format SQL with pg_format
# TODO: what about import.sql? It gets formatted too ugly
# TODO: what about Python files?
pg_format -L -s 2 -w 100 sql/tables.sql >sql/tables.fmt.sql
mv sql/tables.fmt.sql sql/tables.sql\
mv sql/tables.fmt.sql sql/tables.sql



Expand All @@ -33,6 +33,7 @@ DB_XZ_FILE ?= sql/dist/usda.sqlite3-${DB_VERSION}.tar.xz
.PHONY: build
build: clean
build: ## Build the release (compressed XZ file)
test "${DB_VERSION}"
./sql/build.sh ${DB_VERSION}
du -h ${DB_XZ_FILE}

Expand Down Expand Up @@ -68,27 +69,6 @@ deploy/delete:
- git tag -d v${DB_VERSION}


REMOTE_HEAD ?= origin/master
PROJECT_NAME ?= usda-sqlite

.PHONY: _check-git-up-to-date
_check-git-up-to-date:
git branch --show-current
git fetch
# Check that we are in sync with ${REMOTE_HEAD}
git diff --quiet ${REMOTE_HEAD}


.PHONY: deploy/install-prod
deploy/install-prod: _check-git-up-to-date
deploy/install-prod: ## Install (on prod VPS)
# Check the version string was extracted from package.json
test -n "${DB_VERSION}"
# Download ${DB_VERSION}
curl -sSLO https://github.com/nutratech/${PROJECT_NAME}/releases/download/${DB_VERSION}/${DB_XZ_FILE}
tar xf ${DB_XZ_FILE}



# ---------------------------------------
# Clean & extras
Expand All @@ -104,5 +84,5 @@ check-vars: ## display all computed vars (won't show passed in)
$(foreach v, $(.VARIABLES), $(if $(filter file, $(origin $(v))), $(info $(v)=$($(v)))))

.PHONY: extras/cloc
extras/cloc:
extras/cloc: ## count lines of code
cloc HEAD --exclude-dir=usda.svg

0 comments on commit 905b3a2

Please sign in to comment.