-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdeploy
More file actions
38 lines (28 loc) · 849 Bytes
/
deploy
File metadata and controls
38 lines (28 loc) · 849 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
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# Exit if any failures - see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
export NODE_ENV=production
cd /var/www/rosetta-stone
# removes all untracked files
# Agressive - removes node_modules
# git clean -df
# Faster (keeps node_modules)
git clean -d -x -f -e node_modules -e public/css
# clears all unstaged changes
git checkout -- .
# Fetch new code and overwrite anything locally
git fetch origin
git reset --hard origin/master
# Install any dependencies
# Avoiding npm 5.0.0 to 5.4.1 due to https://github.com/npm/npm/issues/17927
# Also the yawn 'workspaces' feature is used for 'packages' dir.
yarn;
# Build MD and CSS
gulp markdown-to-json;
gulp js;
gulp sass;
# Restart service
sudo systemctl restart rosetta-stone;
# Show logs
sudo journalctl -n 60 -u rosetta-stone