-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* do a prod build, upload * add curl test after install * check for jq / gh * update package-lock
- Loading branch information
Showing
4 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.DS_Store | ||
*.swp | ||
*.tar.xz | ||
*.tar.gz | ||
|
||
/.idea | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
SHELL=/bin/bash | ||
|
||
.DEFAULT_GOAL := _help | ||
|
||
# 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' | ||
|
||
|
||
|
||
# --------------------------------------- | ||
# Build & install | ||
# --------------------------------------- | ||
|
||
APP_VERSION ?= $(shell cat package.json | jq -r '.version') | ||
APP_RELEASE_DATE ?= $(shell date --iso) | ||
|
||
.PHONY: build/prod | ||
build/prod: clean | ||
build/prod: ## Build the release | ||
npm run build | ||
|
||
.PHONY: build/compress | ||
build/compress: | ||
tar cJf build.tar.xz build/ | ||
|
||
.PHONY: build/upload | ||
build/upload: | ||
jq --version | ||
gh --version | ||
if [ "${CI}" ]; then \ | ||
gh release create ${APP_VERSION} --generate-notes; \ | ||
fi | ||
if [ "${CI}" ]; then \ | ||
gh release upload ${APP_VERSION} build.tar.xz; \ | ||
fi | ||
|
||
PROJECT_NAME ?= web.2023 | ||
DEPLOY_URL ?= https://nutra.tk/ | ||
|
||
.PHONY: install/prod | ||
install/prod: ## Install the release on prod (pulls latest tag) | ||
git pull | ||
test -n "${APP_VERSION}" | ||
wget https://github.com/nutratech/${PROJECT_NAME}/releases/download/${APP_VERSION}/build.tar.xz | ||
tar xf build.tar.xz | ||
rm -f build.tar.xz | ||
rm -rf /var/www/app/* && mv build/* /var/www/app/ | ||
curl -fI ${DEPLOY_URL} | ||
|
||
|
||
|
||
# --------------------------------------- | ||
# Clean | ||
# --------------------------------------- | ||
|
||
CLEAN_LOCS_ROOT ?= build/ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ${CLEAN_LOCS_ROOT} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.