|
@@ -0,0 +1,41 @@
|
|
|
|
+clientPath = './'
|
|
|
|
+serverPath = './server/'
|
|
|
|
+targetPath = '/srv/www/simple-calorie-tracker'
|
|
|
|
+
|
|
|
|
+host = 'mightyserver'
|
|
|
|
+
|
|
|
|
+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}/
|
|
|
|
+
|
|
|
|
+deploy-server: ensure-target-directories
|
|
|
|
+ rsync -vzruc --delete-before -e ssh ./{dist,nginx} ${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
|
|
|
|
+ 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
|
|
|
|
+
|
|
|
|
+
|