Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- enable patching - generate environment from env variables
- Loading branch information
Showing
2 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
#!/bin/bash -e | ||
|
||
log() { | ||
echo "$(date -u) [rucio-webui] - $@" | ||
} | ||
|
||
generate_env_file() { | ||
cd tools/env-generator && \ | ||
|
||
npm install liquidjs && \ | ||
npm run build && \ | ||
chmod +x ./dist/generate-env.js && \ | ||
./dist/generate-env.js make prod ../../.env --write | ||
|
||
echo "Return code: $?" | ||
cd ../.. | ||
} | ||
|
||
echo "=================== /opt/rucio/webui/.env ===================" | ||
if [ -f /opt/rucio/webui/.env ]; then | ||
echo "/opt/rucio/webui/.env already mounted." | ||
log "/opt/rucio/webui/.env already mounted." | ||
else | ||
echo "/opt/rucio/webui/.env not found. will generate one." | ||
j2 /tmp/.env.default.j2 | sed '/^\s*$/d' > /opt/rucio/webui/.env | ||
log "/opt/rucio/webui/.env not found. Will generate one now." | ||
generate_env_file | ||
fi | ||
|
||
echo "=================== /opt/rucio/webui/.env ========================" | ||
cat /opt/rucio/webui/.env | ||
echo "" | ||
|
||
if [ -d "/patch" ] | ||
then | ||
echo "Patches found. Trying to apply them" | ||
echo "=================== Apply Patches ===================" | ||
log "Patches found. Trying to apply them" | ||
for patchfile in /patch/* | ||
do | ||
echo "Apply patch ${patchfile}" | ||
patch -p3 -d "$RUCIO_WEBUI_PATH" < $patchfile | ||
done | ||
log "Rebuilding the Rucio WebUI after applying patches!" | ||
npm run build | ||
fi | ||
|
||
echo "=================== Starting RUCIO WEBUI ========================" | ||
echo "=================== Starting RUCIO WEBUI ===================" | ||
npm run start |