Compare commits

...

2 commits

Author SHA1 Message Date
pedro a0b14461b3 docker: bugfix devicehub entrypoint
entrypoint was being put inside the working directory, which is
preserved

that made entrypoint "persistent", avoiding future updates

solution is to put it in the root (/), which is not preserved
2024-04-03 13:13:32 +02:00
pedro b607eedf5f adapt entrypoint to idhub trustchain pilot 2024-04-03 13:01:40 +02:00
2 changed files with 13 additions and 14 deletions

View file

@ -28,5 +28,5 @@ COPY . .
COPY examples/app.py .
RUN pip install -e .
COPY docker/devicehub.entrypoint.sh .
ENTRYPOINT sh ./devicehub.entrypoint.sh
COPY docker/devicehub.entrypoint.sh /
ENTRYPOINT sh /devicehub.entrypoint.sh

View file

@ -7,6 +7,7 @@ set -x
# 3. Generate an environment .env file.
gen_env_vars() {
CONFIG_OIDC="${CONFIG_OIDC:-y}"
# specific dpp env vars
if [ "${DPP_MODULE}" = 'y' ]; then
dpp_env_vars="$(cat <<END
@ -67,7 +68,10 @@ init_data() {
# 11. Generate a minimal data structure.
# TODO it has some errors (?)
flask initdata || true
#flask dlt_register_user /opt/devicehub/examples/users_devicehub.json || true
if [ "${EREUSE_PILOT:-}" = 'y' ]; then
flask dlt_register_user /opt/devicehub/users_devicehub.json || true
fi
}
big_error() {
@ -165,14 +169,6 @@ config_dpp_part1() {
#flask dlt_register_user "${EMAIL_DEMO}" ${PASSWORD_DEMO} Operator
}
config_dpp_part2() {
# 16.
# commented because this fails with wrong DLT credentials
#flask check_install "${EMAIL_DEMO}" "${PASSWORD_DEMO}"
# 20. config server or client ID
config_oidc
}
config_phase() {
init_flagfile='docker__already_configured'
if [ ! -f "${init_flagfile}" ]; then
@ -194,9 +190,12 @@ config_phase() {
/usr/bin/time flask snapshot "${EMAIL_DEMO}" ${PASSWORD_DEMO}
fi
if [ "${DPP_MODULE}" = 'y' ]; then
# 16, 20
config_dpp_part2
if [ "${CONFIG_OIDC}" = 'y' ]; then
# 16.
# commented because this fails with wrong DLT credentials
#flask check_install "${EMAIL_DEMO}" "${PASSWORD_DEMO}"
# 20. config server or client ID
config_oidc
fi
# remain next command as the last operation for this if conditional