Skip to content

Commit 2d4fa85

Browse files
committed
Science Commit 5.
1 parent d2c4e2d commit 2d4fa85

4 files changed

Lines changed: 59 additions & 1 deletion

File tree

deploy-all.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# NitroWebExpress™ — Deploy All (convenience wrapper)
3+
# Runs from project root. Delegates to scripts/web/deploy-all.sh
4+
exec bash "$(dirname "$0")/scripts/web/deploy-all.sh" "$@"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
30495
1+
31095

scripts/status.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ CONTEXTS=(
117117
"languages"
118118
"library"
119119
"california-nsa"
120+
"futures"
120121
)
121122

122123
FRONTENDS_UP=0

scripts/web/post-clone.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,59 @@ set -e # Re-enable exit-on-error
233233
echo ""
234234
echo "[OK] Deployed: $DEPLOY_PASS | Failed: $DEPLOY_FAIL"
235235

236+
# 6.5. Generate db.properties for all modules that need database connectivity
237+
echo ""
238+
echo "[*] Generating db.properties for all deployed modules..."
239+
source "$PROJECT_ROOT/scripts/deploy-functions.sh"
240+
241+
declare -A MODULE_DBS=(
242+
["modules/AE6E66/servlets/servlet/src/main/webapp"]="nwe_ae6e66"
243+
["modules/fbi/servlets/servlet/src/main/webapp"]="nwe_california_fbi"
244+
["modules/cia/servlets/servlet/src/main/webapp"]="nwe_california_cia"
245+
["modules/nsa/servlets/servlet/src/main/webapp"]="nwe_california_nsa"
246+
["modules/duke/servlets/servlet/src/main/webapp"]="nwe_duke"
247+
["modules/library/servlets/servlet/src/main/webapp"]="nwe_library"
248+
["modules/gray/servlets/servlet/src/main/webapp"]="nwe_gray_registry"
249+
["modules/gray.a85/servlets/servlet/src/main/webapp"]="nwe_gray85_registry"
250+
["modules/red/Futures/servlets/servlet/src/main/webapp"]="nwe_futures"
251+
["modules/Green.Durham.Grass.and.Herb/servlets/servlet/src/main/webapp"]="nwe_gdgh"
252+
)
253+
254+
DB_PROPS_OK=0
255+
DB_PROPS_FAIL=0
256+
for MODULE_PATH in "${!MODULE_DBS[@]}"; do
257+
FULL_PATH="$PROJECT_ROOT/$MODULE_PATH"
258+
DB_NAME="${MODULE_DBS[$MODULE_PATH]}"
259+
if [ -d "$FULL_PATH" ]; then
260+
nwe_ensure_db_properties "$FULL_PATH" "$DB_NAME" "$PROJECT_ROOT" && DB_PROPS_OK=$((DB_PROPS_OK + 1)) || DB_PROPS_FAIL=$((DB_PROPS_FAIL + 1))
261+
fi
262+
done
263+
echo "[OK] db.properties: $DB_PROPS_OK generated"
264+
265+
# Also copy db.properties into Tomcat webapps (deployed copies)
266+
echo "[*] Copying db.properties to Tomcat deployed webapps..."
267+
declare -A TOMCAT_DBS=(
268+
["ae6e66"]="nwe_ae6e66"
269+
["california-fbi"]="nwe_california_fbi"
270+
["california-cia"]="nwe_california_cia"
271+
["california-nsa"]="nwe_california_nsa"
272+
["california-duke"]="nwe_duke"
273+
["library"]="nwe_library"
274+
["gray-registry"]="nwe_gray_registry"
275+
["gray85-registry"]="nwe_gray85_registry"
276+
["futures"]="nwe_futures"
277+
["gdgh"]="nwe_gdgh"
278+
)
279+
280+
for CONTEXT in "${!TOMCAT_DBS[@]}"; do
281+
WEBAPP_DIR="$TOMCAT_HOME/webapps/$CONTEXT"
282+
DB_NAME="${TOMCAT_DBS[$CONTEXT]}"
283+
if [ -d "$WEBAPP_DIR" ]; then
284+
nwe_ensure_db_properties "$WEBAPP_DIR" "$DB_NAME" "$PROJECT_ROOT"
285+
fi
286+
done
287+
echo "[OK] Tomcat webapp db.properties updated"
288+
236289
# 7. Start Tomcat
237290
systemctl start tomcat 2>/dev/null || "$TOMCAT_HOME/bin/startup.sh"
238291
echo "[OK] Tomcat started"

0 commit comments

Comments
 (0)