This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
config
64 lines (48 loc) · 2.64 KB
/
config
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
APP="phoenix_website" # name of your release
USERNAME="phoenix" # user name on the App Server where the app will be deployed
BUILD_HOST="elixir-build-server.lunarlogic.io" # host where to build the release
BUILD_USER="builder" # local user at build host
BUILD_AT="/tmp/edeliver/$APP/builds" # build directory on build host
STAGING_HOSTS="phoenix-website-staging.lunarlogic.io" # staging / test hosts separated by space
STAGING_USER=$USERNAME # local user at staging hosts
PRODUCTION_HOSTS="phoenix-website.lunarlogic.io" # deploy / production hosts separated by space
PRODUCTION_USER=$USERNAME # local user at deploy hosts
DELIVER_TO="/home/$USERNAME" # deploy directory on production hosts
# If you need to generate the $APP.config file for the first time or when you updated structure of the config/config.exs or config/prod.exs
# then please comment out LINK_SYS_CONFIG and then build app on the build server:
# $ mix edeliver build release --branch=master --verbose
# After it you will find the compiled package in .deliver/releases
# Find it and unpack. You will find the $APP.config file in path looking like this:
# .deliver/releases/phoenix_website_0.0.1+28-1aaac9f-deployment.release/releases/0.0.1+28-1aaac9f-deployment/sys.config
# Copy the content of sys.config and put it on your App Server and replace FILL_IN_HERE with your credentails:
# /home/phoenix/phoenix_website/phoenix_website.config
#
# We had to comment out LINK_SYS_CONFIG to be able to generate the sys.config file.
# Once we did that now you can again uncomment LINK_SYS_CONFIG.
# Now you can build app again and deploy to App Server. Thanks to that the new compiled package will contain sysmlink called sys.config to
# /home/phoenix/phoenix_website/phoenix_website.config file.
# When the package will be deployed to staging/production then symlink will work because there will be file phoenix_website.config
# you've just created.
#
# If you like you can learn more at:
# https://github.com/edeliver/edeliver/wiki/Use-per-host-configuration#use-different-configurations-on-different-deploy-hosts
LINK_SYS_CONFIG="$DELIVER_TO/$APP/$APP.config"
AUTO_VERSION=commit-count+git-revision+branch-unless-master
pre_erlang_get_and_update_deps() {
if [ "$TARGET_MIX_ENV" = "prod" ]; then
__sync_remote "
# fail if any command fails (recommended)
set -e
cd '$BUILD_AT'
# required by the phx.digest task
mkdir -p priv/static
mix deps.get
cd '$BUILD_AT/assets'
npm install
$BUILD_AT/assets/node_modules/.bin/brunch build --production
cd '$BUILD_AT'
APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD phx.digest $SILENCE
"
fi
}