EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit f886e6ef authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

export variables into bash.bashrc

parent 2e7beb82
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ fi
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
......@@ -27,17 +28,14 @@ file_env() {
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
echo " the ${var} shall be set to ${val}"
cat >> /etc/bash.bashrc <<EOF
export ${var}=${val}
EOF
unset "$fileVar"
}
# Loads various settings that are used elsewhere in the script
# This should be called after mysql_check_config, but before any other functions
docker_setup_env() {
# Initialize values that might be stored in a file
file_env 'OS_PASSWORD'
file_env "OS_PASSWORD"
}
docker_setup_env "$@"
eval "/opt/eoxserver/eoxserver-entrypoint.sh $@"
......@@ -129,6 +129,8 @@ services:
- env/vhr18_db.env
- env/vhr18_obs.env
- env/vhr18_redis.env
secrets:
- OS_PASSWORD
environment:
INSTANCE_ID: "prism-view-server_registrar"
INSTALL_DIR: "/var/www/pvs/dev/"
......@@ -138,6 +140,7 @@ services:
INIT_SCRIPTS: "/configure.sh /init-db.sh /initialized.sh"
STARTUP_SCRIPTS: "/wait-initialized.sh"
WAIT_SERVICES: "redis:6379 database:5432"
OS_PASSWORD_FILE: "/run/secrets/OS_PASSWORD"
configs:
- source: init-db
target: /init-db.sh
......@@ -169,3 +172,6 @@ volumes:
instance-data:
networks:
intnet:
secrets:
OS_PASSWORD:
external: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment