-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·69 lines (52 loc) · 2.09 KB
/
install
File metadata and controls
executable file
·69 lines (52 loc) · 2.09 KB
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
65
66
67
68
69
#!/bin/bash
source ./bits/bootstrap/logging
set -euo pipefail ; IFS=$'\n\t'
#-----------
# Configurations
#-----------
ELIXIR_VERSION=${ELIXIR_VERSION-v1.0.4}
ELIXIR_INTERNAL_VERSION=$(echo $ELIXIR_VERSION | cut -d'v' -f 2)
ELIXIR_MODE=${ELIXIR_MODE-docker}
ELIXIR_DISPLAY=${ELIXIR_DISPLAY-standalone} # or internal
LOG_DIR=${LOG_DIR-/var/log}
export SRC_DIR=${SRC_DIR-/var/src}
export ELIXIR_LOG_DIR=${ELIXIR_LOG_DIR-$LOG_DIR/elixir}
LAUNCHER_OWNER=${LAUNCHER_OWNER-$USER}
export LAUNCHER_DIR=${LAUNCHER_DIR-/var/local}
export ELIXIR_LAUNCHER_DIR=${ELIXIR_LAUNCHER_DIR-$LAUNCHER_DIR/elixir/$ELIXIR_VERSION}
ERLANG_VERSION=${ERLANG_VERSION-17.5-1}
#-----------
# Install Script
#-----------
if [[ "$ELIXIR_DISPLAY" == "standalone" ]]; then
notify "Install Elixir ($ELIXIR_VERSION)..."
else
notify " -- install Elixir ($ELIXIR_VERSION)..."
fi
OWNER=$LAUNCHER_OWNER ./bits/bootstrap/mkdir LAUNCHER_DIR ELIXIR_LAUNCHER_DIR $ELIXIR_LAUNCHER_DIR/src
SRC_NAME=${ELIXIR_VERSION}.tar.gz SRC_DIR=${ELIXIR_LAUNCHER_DIR}/src \
TARGET_NAME=elixir-${ELIXIR_INTERNAL_VERSION}.tar.gz \
NAME="Elixir ${ELIXIR_VERSION}" \
REMOTE_URL=https://github.com/elixir-lang/elixir/archive \
./bits/bootstrap/wget
if [[ "$ELIXIR_MODE" == "docker" ]]; then
notify " -- deploying via docker"
OWNER=$LAUNCHER_OWNER LAUNCHER_DIR=$ELIXIR_LAUNCHER_DIR BIT=elixir ./bits/docker/copydockerfile \
@ELIXIR_INTERNAL_VERSION@ $ELIXIR_INTERNAL_VERSION \
@ERLANG_VERSION@ $ERLANG_VERSION
LAUNCHER_DIR=$ELIXIR_LAUNCHER_DIR NAME=elixir VERSION=${ELIXIR_VERSION} ./bits/docker/build
NAME=elixir DIR=$ELIXIR_LAUNCHER_DIR BIT=elixir VERSION=${ELIXIR_VERSION} ./bits/docker/helpers
else
notify " -- deploying directly with bash"
TEMPLATE=./bits/elixir/files/elixir.bashfile LOCATION=${ELIXIR_LAUNCHER_DIR}/Bashfile \
./bits/docker/copyif \
@ELIXIR_VERSION@ $ELIXIR_VERSION
chmod 755 ${ELIXIR_LAUNCHER_DIR}/Bashfile
${ELIXIR_LAUNCHER_DIR}/Bashfile
fi
DIR=./bits/elixir ./bits/bootstrap/cleanup
if [[ "$ELIXIR_DISPLAY" == "standalone" ]]; then
notify "DONE, Install Elixir."
else
notify " -- DONE, Install Elixir."
fi