-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.stage
45 lines (27 loc) · 1.33 KB
/
Makefile.stage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.PHONY: help
SSH_ALIAS=mycoin.stage
SSH_USER=mycoin
WEB_DIR=/var/www/mycoin.odotalk.com/htdocs
WEB_USER=www-data
# DRY_RUN=--dry-run
DRY_RUN=
all: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
remotedu: ## Execute DU command in htdocs dir, just for diagnostic purpose
ssh ${SSH_ALIAS} "cd ${WEB_DIR}; du -h"
rsynca: ## execute Rsync from current dir and remote htdocs ${WEB_DIR}
rsync ${DRY_RUN} -rlcgoDvzi -e "ssh" --delete . ${SSH_ALIAS}:${WEB_DIR} --exclude-from 'exclude-list.txt'
copyenvprod:
scp .env.stage ${SSH_ALIAS}:${WEB_DIR}/.env
backupremotetickers:
ssh ${SSH_ALIAS} "mysqldump -umycoin -p db_mycoin tickers > tickers.sql"
scp ${SSH_ALIAS}:tickers.sql tickers.sql
getremotebalances: ## Update Balances from RockTrading on the SERVER
ssh ${SSH_ALIAS} "php /var/www/mycoin.odotalk.com/htdocs/artisan mycoin:getrockbalances"
fixownership: ## Execute DU command in htdocs dir, just for diagnostic purpose
ssh -t ${SSH_ALIAS} "sudo chown -R ${WEB_USER} ${WEB_DIR}/storage/*; ls -lao ${WEB_DIR}/storage"
migrate: ## Execute migrate command for DB schema
ssh ${SSH_ALIAS} "cd ${WEB_DIR}; php artisan migrate --env=stage"
buildfrontend: ## execute npm task to compile frontend assets (js and css...)
npm run production