forked from philomena-dev/philomena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod-update.sh
36 lines (27 loc) · 993 Bytes
/
prod-update.sh
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
#!/usr/bin/env bash
# Set up environment
source ~/bin/philomena-env
echo "Deploying"
cd ~/philomena
die() {
echo "$*" 1>&2
exit 1
}
echo "Fetching deps"
mix deps.get || die "mix failed to update"
echo "Compiling assets"
npm install --prefix ./assets || die "assets install failed"
npm run deploy --prefix ./assets
mix phx.digest || die "assets compile failed"
echo "Building release"
mix release --overwrite || die "failed to generate release"
echo "Running database migrations"
_build/prod/rel/philomena/bin/philomena eval "Philomena.Release.migrate()" || die "ecto.migrate failed"
# Include a task to restart your running appserver instances here.
#
# In general, you should have many app instances configured on different
# ports using the PORT environment variable, so as to allow you to roll
# releases and deploy new code with no visible downtime.
#
# You can use a reverse proxy like haproxy or nginx to load balance between
# different server instances automatically.