2018-08-29 01:07:01 +00:00
|
|
|
SHELL := /bin/bash
|
2019-02-10 00:10:34 +00:00
|
|
|
DEVDB := postgres
|
2018-08-29 01:07:01 +00:00
|
|
|
|
|
|
|
start: ## Start Wiki.js in production mode
|
|
|
|
node wiki start
|
|
|
|
|
|
|
|
stop: ## Stop Wiki.js
|
|
|
|
node wiki stop
|
|
|
|
|
|
|
|
restart: ## Restart Wiki.js
|
|
|
|
node wiki restart
|
|
|
|
|
2018-10-08 04:17:31 +00:00
|
|
|
dev-up: ## Start Wiki.js in development mode
|
2018-08-29 01:07:01 +00:00
|
|
|
node wiki dev
|
|
|
|
|
|
|
|
build: ## Build Wiki.js client assets
|
|
|
|
webpack --profile --config dev/webpack/webpack.prod.js
|
|
|
|
|
|
|
|
watch: ## Watch client files and rebuild assets on changes
|
|
|
|
webpack --config dev/webpack/webpack.dev.js
|
|
|
|
|
|
|
|
test: ## Run code linting tests
|
|
|
|
eslint --format codeframe --ext .js,.vue .
|
|
|
|
pug-lint server/views && jest
|
|
|
|
|
|
|
|
docker-dev-up: ## Run dockerized dev environment
|
2019-02-10 23:06:03 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . up -d --remove-orphans
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec wiki yarn dev
|
2018-08-29 01:07:01 +00:00
|
|
|
|
|
|
|
docker-dev-down: ## Shutdown dockerized dev environment
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . down
|
2018-08-29 01:07:01 +00:00
|
|
|
|
|
|
|
docker-dev-rebuild: ## Rebuild dockerized dev image
|
2018-12-17 05:51:52 +00:00
|
|
|
rm -rf ./node_modules
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . build --no-cache --force-rm
|
2018-08-29 01:07:01 +00:00
|
|
|
|
2018-12-30 02:30:51 +00:00
|
|
|
docker-dev-clean: ## Clean DB, redis and data folders
|
|
|
|
rm -rf ./data
|
2019-02-10 00:10:34 +00:00
|
|
|
[[ "${DEVDB}" == "postgres" ]] && docker-compose -f ./dev/docker-postgres/docker-compose.yml -p wiki --project-directory . exec db psql --dbname=wiki --username=wikijs --command='DROP SCHEMA IF EXISTS public CASCADE; CREATE SCHEMA public' || true
|
|
|
|
[[ "${DEVDB}" == "mysql" || "${DEVDB}" == "mariadb" ]] && docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec db mysql -uroot -p'wikijsrocks' -e 'DROP SCHEMA IF EXISTS wiki; CREATE SCHEMA wiki;' || true
|
2019-02-10 18:38:54 +00:00
|
|
|
[[ "${DEVDB}" == "mssql" ]] && docker-compose -f ./dev/docker-mssql/docker-compose.yml -p wiki --project-directory . exec db /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'W1kiJSR0cks!' -Q 'DROP DATABASE IF EXISTS wiki; CREATE DATABASE wiki;' || true
|
|
|
|
[[ "${DEVDB}" == "sqlite" ]] && docker-compose -f ./dev/docker-sqlite/docker-compose.yml -p wiki --project-directory . exec wiki rm -rf /wiki/db.sqlite || true
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec redis redis-cli flushall
|
2018-12-30 02:30:51 +00:00
|
|
|
|
2019-01-26 23:35:56 +00:00
|
|
|
docker-dev-bash: ## Rebuild dockerized dev image
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . exec wiki bash
|
2019-01-26 23:35:56 +00:00
|
|
|
|
2018-08-29 01:07:01 +00:00
|
|
|
docker-build: ## Run assets generation build in docker
|
2019-02-10 00:10:34 +00:00
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . run wiki yarn build
|
|
|
|
docker-compose -f ./dev/docker-${DEVDB}/docker-compose.yml -p wiki --project-directory . down
|
2018-08-29 01:07:01 +00:00
|
|
|
|
|
|
|
help: ## Display help
|
|
|
|
@echo ''
|
|
|
|
@echo -e 'usage: \033[1mmake [command] [args...]\033[0m'
|
|
|
|
@echo ''
|
|
|
|
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
|
|
|
|
@echo ''
|
|
|
|
|
|
|
|
.PHONY: clean logs
|
|
|
|
.DEFAULT_GOAL := help
|