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