|
@@ -1,5 +1,4 @@
|
|
|
clientPath = './'
|
|
|
-serverPath = './server/'
|
|
|
targetPath = '/srv/www/simple-calorie-tracker'
|
|
|
|
|
|
host = 'mightyserver'
|
|
@@ -8,34 +7,27 @@ all: build
|
|
|
|
|
|
setup:
|
|
|
npm i --prefix ${clientPath}
|
|
|
- npm i --prefix ${serverPath}
|
|
|
|
|
|
build:
|
|
|
npm run build --prefix ${clientPath}
|
|
|
|
|
|
ensure-target-directories:
|
|
|
- ssh ${host} mkdir -p ${targetPath}/
|
|
|
+ ssh ${host} mkdir -p ${targetPath}
|
|
|
+
|
|
|
+deploy-web: ensure-target-directories
|
|
|
+ rsync -vzruc --delete-before -e ssh ./dist ${host}:${targetPath}/
|
|
|
|
|
|
deploy-server: ensure-target-directories
|
|
|
- rsync -vzruc --delete-before -e ssh ./{dist,nginx} ${host}:${targetPath}/
|
|
|
+ rsync -vzruc --delete-before -e ssh ./{nginx, docker-compose.yml} ${host}:${targetPath}/
|
|
|
ssh ${host} mkdir -p ${targetPath}/log
|
|
|
|
|
|
build-and-deploy: build deploy-server
|
|
|
|
|
|
-prepare-docker-compose:
|
|
|
- rsync -vzruc --delete-before -e ssh ./docker-compose.yml ${host}:${targetPath}/
|
|
|
-
|
|
|
stop-server:
|
|
|
ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down
|
|
|
|
|
|
-start-server: prepare-docker-compose
|
|
|
+start-server: deploy-server
|
|
|
ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml up -d --build
|
|
|
|
|
|
-restart-server: stop-server deploy-server start-server
|
|
|
-
|
|
|
stop-and-clean:
|
|
|
ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down --rmi local --remove-orphans -v
|
|
|
-
|
|
|
-redeploy: stop-and-clean deploy-server start-server
|
|
|
-
|
|
|
-
|