Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions functions
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ function setup_docker() {
ee_log_info1 "Installing Docker"
# Check if docker exists. If not start docker installation.
if ! command -v docker >/dev/null 2>&1; then
# Running standard docker installation.
wget --quiet get.docker.com -O docker-setup.sh
sh docker-setup.sh
# Download into TMP_WORK_DIR so setup.sh's EXIT trap cleans it up on any
# exit path, instead of leaving docker-setup.sh behind in the CWD.
wget --quiet get.docker.com -O "$TMP_WORK_DIR/docker-setup"
sh "$TMP_WORK_DIR/docker-setup"
fi

# Check if docker-compose exists. If not start docker-compose installation.
Expand Down
16 changes: 16 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ TMP_WORK_DIR="$(mktemp -d /tmp/ee-installer.XXXXXX)"
export TMP_WORK_DIR
trap 'rm -rf "$TMP_WORK_DIR"' EXIT

# Remember this script's path so it can delete itself after a successful
# install (the `ee` from `wget -qO ee https://rt.cx/ee4 && bash ee`). Only when
# run directly: BASH_SOURCE[0] equals $0 when executed, differs when sourced
# (e.g. remote-migrate), and is empty when piped (`curl ... | bash`). Resolve
# to an absolute path so a later `cd` can't strand it. EE_KEEP_INSTALLER=1 opts out.
INSTALLER_SELF=""
if [ -z "${EE_KEEP_INSTALLER:-}" ] && [ "${BASH_SOURCE[0]:-}" = "$0" ] && [ -f "${BASH_SOURCE[0]}" ]; then
INSTALLER_SELF="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/$(basename -- "${BASH_SOURCE[0]}")"
fi

function bootstrap() {
if ! command -v curl > /dev/null 2>&1; then
packages="curl"
Expand Down Expand Up @@ -80,3 +90,9 @@ function do_install() {

# Invoking the main installation function.
do_install

# Reached only on success (set -e exits earlier on failure, leaving the file
# for a retry). Remove the downloaded installer so it doesn't linger.
if [ -n "$INSTALLER_SELF" ] && [ -f "$INSTALLER_SELF" ]; then
rm -f "$INSTALLER_SELF" || true
fi