Skip to content

Commit

Permalink
Merge pull request #134 from abes-esr/ajout-url-idref-celon-environement
Browse files Browse the repository at this point in the history
fix CI docker-entrypoint.sh ne remplacer pas le bon placeholder
  • Loading branch information
EryneKL authored Sep 30, 2024
2 parents 0648093 + 957c168 commit 1eae169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ export ITEM_FRONT_IDREF_API_URL=${ITEM_FRONT_IDREF_API_URL:='http://localhost:80
# On va remplacer les placeholders depuis les JS originales
echo "-> Remplacement des placeholders venant du .env de vuejs dans la destination /usr/share/nginx/html/"
echo "-> ITEM_FRONT_API_BASEURL=${ITEM_FRONT_API_BASEURL}"
echo "-> ITEM_PLACEHOLDER_VITE_IDREF_API_URL=${ITEM_FRONT_IDREF_API_URL}"
rm -rf /usr/share/nginx/html/
cp -rf /usr/share/nginx/html.orig/ /usr/share/nginx/html/
sed -i \
"s#ITEM_PLACEHOLDER_VITE_API_URL#${ITEM_FRONT_API_BASEURL}#g" \
/usr/share/nginx/html/assets/*
sed -i \
"s#ITEM_PLACEHOLDER_VITE_API_URL_IDREF#${ITEM_FRONT_IDREF_API_URL}#g" \
"s#ITEM_PLACEHOLDER_VITE_IDREF_API_URL#${ITEM_FRONT_IDREF_API_URL}#g" \
/usr/share/nginx/html/assets/*

# execute nginx (cf CMD dans Dockerfile)
Expand Down
2 changes: 1 addition & 1 deletion docker/vuejs_env_placeholder
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# pour injecter une URL de l'API au moment de la création du conteneur
# et éviter ainsi d'avoir une URL de l'API en static dans l'image docker
VITE_API_URL=ITEM_PLACEHOLDER_VITE_API_URL
VITE_API_URL_IDREF=ITEM_PLACEHOLDER_VITE_API_URL_IDREF
VITE_API_URL_IDREF=ITEM_PLACEHOLDER_VITE_IDREF_API_URL

0 comments on commit 1eae169

Please sign in to comment.