UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Verified Commit 133ae537 authored by Patrick Tafoya's avatar Patrick Tafoya
Browse files

BULL-3225-better-startup - Updated startup.

parent f68a4be3
No related branches found
No related tags found
1 merge request!11BULL-3225-better-startup
......@@ -2,7 +2,7 @@ version: "3.6"
services:
startup:
image: alpine:latest
image: node:20.11
container_name: startup-service
working_dir: /local-dev
user: "${UID:-1000}:${GID:-1000}" # Default to 1000:1000 if UID/GID not set
......
......@@ -12,6 +12,9 @@ services:
- xx_project_name_xx-net
extra_hosts:
- "healthcheck.dev.bigbang.mil:127.0.0.1"
depends_on:
users:
condition: service_started
healthcheck:
test: curl --fail https://healthcheck.dev.bigbang.mil
timeout: 10s
......@@ -31,6 +34,9 @@ services:
timeout: 10s
start_period: 10s
retries: 10
depends_on:
startup:
condition: service_completed_successfully
volumes:
xx_project_name_xx-psql: {}
......
#!/bin/sh
set -e
# Add execute permissions to all .sh files in ./scripts/ and its subdirectories
find ./scripts/ -type f -name '*.sh' -exec chmod +x {} \;
......@@ -6,7 +7,31 @@ find ./scripts/ -type f -name '*.sh' -exec chmod +x {} \;
# Add execute permissions to all .sh files in ./config/ and its subdirectories
find ./config/ -type f -name '*.sh' -exec chmod +x {} \;
# Ensure the /cat-shoe-local-dev/reports folder exists
# Ensure the some important root folders exist
mkdir -p ./reports
mkdir -p ./users-db
# Function to install dependencies if package.json exists and node_modules is empty
install_deps_if_needed() {
dir="$1"
if [ -f "$dir/package.json" ]; then
# Check if node_modules doesn't exist or is empty
if [ ! -d "$dir/node_modules" ] || [ -z "$(ls -A "$dir/node_modules" 2>/dev/null)" ]; then
echo "Found $dir/package.json and no node_modules. Running npm install..."
(cd "$dir" && npm install)
else
echo "Found $dir/package.json but node_modules already exists and is not empty. Skipping npm install."
fi
else
echo "No package.json found in $dir. Skipping npm install."
fi
}
# Check xx_project_name_xx-api
install_deps_if_needed "./xx_project_name_xx-api"
# Check xx_project_name_xx-ui
install_deps_if_needed "./xx_project_name_xx-ui"
echo "Setup script completed successfully!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment