diff --git a/deployment/docker/ci/docker-compose.yml b/deployment/docker/ci/docker-compose.yml index 046ef56e..3c3b4b57 100644 --- a/deployment/docker/ci/docker-compose.yml +++ b/deployment/docker/ci/docker-compose.yml @@ -20,7 +20,7 @@ services: context: ./../../../ dockerfile: ./deployment/docker/ci/Dockerfile environment: - SEMAPHORE_DB_DIALECT: 1 + SEMAPHORE_DB_DIALECT: mysql SEMAPHORE_DB_USER: semaphore SEMAPHORE_DB_PASS: semaphore SEMAPHORE_DB_HOST: mysql diff --git a/deployment/docker/common/semaphore-wrapper b/deployment/docker/common/semaphore-wrapper index f34691a8..bec1768e 100755 --- a/deployment/docker/common/semaphore-wrapper +++ b/deployment/docker/common/semaphore-wrapper @@ -8,7 +8,8 @@ SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}" SEMAPHORE_TMP_PATH="${SEMAPHORE_TMP_PATH:-/tmp/semaphore}" # Semaphore database env config -SEMAPHORE_DB_DIALECT="${SEMAPHORE_DB_DIALECT:-1}" +SEMAPHORE_DB_DIALECT="${SEMAPHORE_DB_DIALECT:-mysql}" +SEMAPHORE_DB_DIALECT_ID=1 SEMAPHORE_DB_HOST="${SEMAPHORE_DB_HOST:-0.0.0.0}" SEMAPHORE_DB_PORT="${SEMAPHORE_DB_PORT:-3306}" SEMAPHORE_DB="${SEMAPHORE_DB:-semaphore}" @@ -59,12 +60,17 @@ while ! $(nc -z "$SEMAPHORE_DB_HOST" "$SEMAPHORE_DB_PORT") >/dev/null 2>&1; do sleep 1 done +case ${SEMAPHORE_DB_DIALECT} in + "mysql") SEMAPHORE_DB_DIALECT_ID=1;; + "bolt") SEMAPHORE_DB_DIALECT_ID=2;; + "postgres") SEMAPHORE_DB_DIALECT_ID=3;; +esac # Create a config if it does not exist in the current config path if [ ! -f "${SEMAPHORE_CONFIG_PATH}/config.json" ]; then echoerr "Generating ${SEMAPHORE_TMP_PATH}/config.stdin ..." cat << EOF > "${SEMAPHORE_TMP_PATH}/config.stdin" -${SEMAPHORE_DB_DIALECT} +${SEMAPHORE_DB_DIALECT_ID} ${SEMAPHORE_DB_HOST}:${SEMAPHORE_DB_PORT} ${SEMAPHORE_DB_USER} ${SEMAPHORE_DB_PASS} diff --git a/deployment/docker/dev/docker-compose.yml b/deployment/docker/dev/docker-compose.yml index 6cc83f79..abb13db6 100644 --- a/deployment/docker/dev/docker-compose.yml +++ b/deployment/docker/dev/docker-compose.yml @@ -22,7 +22,7 @@ services: volumes: - "./../../../:/go/src/github.com/ansible-semaphore/semaphore:rw" environment: - SEMAPHORE_DB_DIALECT: 1 + SEMAPHORE_DB_DIALECT: mysql SEMAPHORE_DB_USER: semaphore SEMAPHORE_DB_PASS: semaphore SEMAPHORE_DB_HOST: mysql diff --git a/deployment/docker/prod/docker-compose.yml b/deployment/docker/prod/docker-compose.yml index 5a85df15..578536e4 100644 --- a/deployment/docker/prod/docker-compose.yml +++ b/deployment/docker/prod/docker-compose.yml @@ -18,7 +18,7 @@ services: context: ./../../../ dockerfile: ./deployment/docker/prod/Dockerfile environment: - SEMAPHORE_DB_DIALECT: 1 + SEMAPHORE_DB_DIALECT: mysql SEMAPHORE_DB_USER: semaphore SEMAPHORE_DB_PASS: hx4hjxqthfwbfsy5535u4agfdscm SEMAPHORE_DB_HOST: mysql