-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·30 lines (25 loc) · 754 Bytes
/
deploy
File metadata and controls
executable file
·30 lines (25 loc) · 754 Bytes
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
#!/bin/bash
# Script to deploy code in our environment. See ecosystem.config.js for the details of the environment.
if [ "$#" -ne 1 ]
then
echo "This script takes one argument, production|development|debug"
exit 1
fi
# Check the environment
ENV=$1
if [[ "$ENV" != "production" && "$ENV" != "development" && "$ENV" != "debug" ]]
then
echo "Invalid environment."
exit 2
fi
# Sort out some things which have on occasion blocked deployment
git checkout -- package-lock.json && \
git checkout -- static/sw.js && \
git checkout -- nuxt.config.js && \
git reset --hard HEAD && \
git pull && \
npm install && \
nice npm run build && \
php ./mungeindex.php > /tmp/a.a && cp /tmp/a.a .nuxt/index.js
# Now deploy.
pm2 --force deploy $ENV update --force