EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESA
PRISM
VS
Commits
2e7beb82
Commit
2e7beb82
authored
4 years ago
by
Mussab Abdalla
Browse files
Options
Downloads
Patches
Plain Diff
attemt to os as secret
parent
dec34593
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/entrypoint.sh
+31
-0
31 additions, 0 deletions
core/entrypoint.sh
docker-compose.emg.yml
+4
-3
4 additions, 3 deletions
docker-compose.emg.yml
env_setup.sh
+1
-1
1 addition, 1 deletion
env_setup.sh
with
36 additions
and
4 deletions
core/entrypoint.sh
+
31
−
0
View file @
2e7beb82
#!/bin/bash -e
set
-eo
pipefail
shopt
-s
nullglob
SERVICES
=
${
WAIT_SERVICES
:
=
''
}
TIMEOUT
=
${
WAIT_TIMEOUT
:
=
'15'
}
...
...
@@ -8,5 +10,34 @@ if [[ ! -z $SERVICES ]] ; then
wait-for-it
-t
$TIMEOUT
$service
done
fi
# usage: file_env VAR [DEFAULT]
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (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
:-}
"
if
[
"
${
!var
:-}
"
]
&&
[
"
${
!fileVar
:-}
"
]
;
then
echo
"Both
$var
and
$fileVar
are set (but are exclusive)"
fi
local
val
=
"
$def
"
if
[
"
${
!var
:-}
"
]
;
then
val
=
"
${
!var
}
"
elif
[
"
${
!fileVar
:-}
"
]
;
then
val
=
"
$(
<
"
${
!fileVar
}
"
)
"
fi
export
"
$var
"
=
"
$val
"
echo
" the
${
var
}
shall be set to
${
val
}
"
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'
}
docker_setup_env
"
$@
"
eval
"/opt/eoxserver/eoxserver-entrypoint.sh
$@
"
This diff is collapsed.
Click to expand it.
docker-compose.emg.yml
+
4
−
3
View file @
2e7beb82
...
...
@@ -130,7 +130,7 @@ services:
-
env/emg_obs.env
-
env/emg_redis.env
secrets
:
-
my_secret
-
os_password
environment
:
INSTANCE_ID
:
"
prism-view-server_registrar"
INSTALL_DIR
:
"
/var/www/pvs/dev/"
...
...
@@ -140,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
...
...
@@ -172,5 +173,5 @@ volumes:
networks
:
intnet
:
secrets
:
my_secret
:
external
:
true
os_password
:
file
:
OS_PASSWORD.txt
This diff is collapsed.
Click to expand it.
env_setup.sh
+
1
−
1
View file @
2e7beb82
...
...
@@ -6,7 +6,7 @@ cat $vhr18_obs > ./env/vhr18_obs.env
cat
$emg_db
>
./env/emg_db.env
cat
$emg_django
>
./env/emg_django.env
cat
$emg_obs
>
./env/emg_obs.env
echo
"OS_PASSWORD=
${
OS_PASSWORD
}
"
>>
./OS_PASSWORD.txt
set
-o
allexport
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment