Skip to content

Instantly share code, notes, and snippets.

@SamuelMarks
Last active January 5, 2025 22:35
Show Gist options
  • Save SamuelMarks/510dff329e231c9d0377f84758f28804 to your computer and use it in GitHub Desktop.
Save SamuelMarks/510dff329e231c9d0377f84758f28804 to your computer and use it in GitHub Desktop.
Generated from https://github.com/SamuelMarks/deploy-sh and its example JSON
#!/bin/sh
#############################
# Toolchain(s) [required] #
#############################
export NODEJS_INSTALL_DIR="${NODEJS_INSTALL_DIR:-1}"
export NODEJS_VERSION='lts'
export PYTHON_INSTALL_DIR="${PYTHON_INSTALL_DIR:-1}"
export PYTHON_VERSION='3.10'
export RUST_INSTALL_DIR="${RUST_INSTALL_DIR:-1}"
export RUST_VERSION='nightly'
export POSTGRES_URL="${POSTGRES_URL:-1}"
export POSTGRES_VERSION='>17'
export REDIS_URL="${REDIS_URL:-1}"
export VALKEY_VERSION='*'
#############################
# Database(s) [optional] #
#############################
export AMQP_URL=0
export RabbitMQ_VERSION='*'
#############################
# WWWROOT(s) #
#############################
export WWWROOT_example_com_INSTALL="${WWWROOT_example_com_INSTALL:-1}"
#!/bin/sh
#############################
# Toolchain(s) [required] #
#############################
export NODEJS_INSTALL_DIR=0
export PYTHON_INSTALL_DIR=0
export RUST_INSTALL_DIR=0
export POSTGRES_URL=0
export REDIS_URL=0
#############################
# Database(s) [optional] #
#############################
export AMQP_URL=0
#############################
# WWWROOT(s) #
#############################
export WWWROOT_example_com_INSTALL=0
#!/bin/sh
# shellcheck disable=SC2236
if [ ! -z "${SCRIPT_NAME+x}" ]; then
this_file="${SCRIPT_NAME}"
elif [ ! -z "${BASH_VERSION+x}" ]; then
# shellcheck disable=SC3028 disable=SC3054
this_file="${BASH_SOURCE[0]}"
# shellcheck disable=SC3040
set -o pipefail
elif [ ! -z "${ZSH_VERSION+x}" ]; then
# shellcheck disable=SC2296
this_file="${(%):-%x}"
# shellcheck disable=SC3040
set -o pipefail
else
this_file="${0}"
fi
set -feu
SCRIPT_ROOT_DIR="${SCRIPT_ROOT_DIR:-$( CDPATH='' cd -- "$( dirname -- "$( readlink -nf -- "${this_file}" )")" && pwd)}"
export SCRIPT_ROOT_DIR
STACK="${STACK:-:}${this_file}"':'
export STACK
#############################
# Toolchain(s) [required] #
#############################
if [ "${NODEJS_INSTALL_DIR:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_toolchain/nodejs/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
if [ "${PYTHON_INSTALL_DIR:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_toolchain/python/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
if [ "${RUST_INSTALL_DIR:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_toolchain/rust/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
#############################
# Database(s) [required] #
#############################
if [ "${POSTGRES_URL:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_storage/postgres/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
if [ "${REDIS_URL:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_storage/valkey/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
#############################
# Database(s) [optional] #
#############################
if [ "${AMQP_URL:-0}" -eq 1 ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_lib/_storage/rabbitmq/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
#############################
# WWWROOT(s) #
#############################
if [ "${WWWROOT_example_com_INSTALL:-0}" -eq 1 ]; then
WWWROOT_NAME='example.com'
WWWROOT_VENDOR='nginx'
WWWROOT_PATH='./my_symlinked_wwwroot'
WWWROOT_LISTEN='80'
WWWROOT_HTTPS_PROVIDER='letsencrypt'
if [ "${WWWROOT_VENDOR:-nginx}" = 'nginx' ]; then
SCRIPT_NAME="${SCRIPT_ROOT_DIR}"'/_server/nginx/setup.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
fi
fi
#!/bin/sh
# shellcheck disable=SC2236
if [ ! -z "${SCRIPT_NAME+x}" ]; then
this_file="${SCRIPT_NAME}"
elif [ ! -z "${BASH_VERSION+x}" ]; then
# shellcheck disable=SC3028 disable=SC3054
this_file="${BASH_SOURCE[0]}"
# shellcheck disable=SC3040
set -o pipefail
elif [ ! -z "${ZSH_VERSION+x}" ]; then
# shellcheck disable=SC2296
this_file="${(%):-%x}"
# shellcheck disable=SC3040
set -o pipefail
else
this_file="${0}"
fi
set -feu
SCRIPT_ROOT_DIR="${SCRIPT_ROOT_DIR:-$( CDPATH='' cd -- "$( dirname -- "$( readlink -nf -- "${this_file}" )")" && pwd)}"
export SCRIPT_ROOT_DIR
STACK="${STACK:-:}${this_file}"':'
export STACK
DIR=$(CDPATH='' cd -- "$(dirname -- "${this_file}")" && pwd)
#############################
# Toolchain(s) [required] #
#############################
SCRIPT_NAME="${DIR}"'/false_env.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
export NODEJS_INSTALL_DIR="${NODEJS_INSTALL_DIR:-1}"
export NODEJS_VERSION='lts'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
export PYTHON_INSTALL_DIR="${PYTHON_INSTALL_DIR:-1}"
export PYTHON_VERSION='3.10'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
export RUST_INSTALL_DIR="${RUST_INSTALL_DIR:-1}"
export RUST_VERSION='nightly'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
wait
#############################
# Database(s) [required] #
#############################
SCRIPT_NAME="${DIR}"'/false_env.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
export POSTGRES_URL="${POSTGRES_URL:-1}"
export POSTGRES_VERSION='>17'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
export REDIS_URL="${REDIS_URL:-1}"
export VALKEY_VERSION='*'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
wait
#############################
# Database(s) [optional] #
#############################
SCRIPT_NAME="${DIR}"'/false_env.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}"
export AMQP_URL=0
export RabbitMQ_VERSION='*'
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
wait
#############################
# WWWROOT(s) #
#############################
export WWWROOT_example_com_INSTALL="${WWWROOT_example_com_INSTALL:-1}"
SCRIPT_NAME="${DIR}"'/install_gen.sh'
export SCRIPT_NAME
# shellcheck disable=SC1090
. "${SCRIPT_NAME}" &
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment