fix(back-end): try fix profile manager
This commit is contained in:
@@ -125,7 +125,7 @@ jobs:
|
|||||||
|
|
||||||
ssh-keyscan -H "${{ secrets.SERVER_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null
|
ssh-keyscan -H "${{ secrets.SERVER_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
|
|
||||||
- name: Write env to server
|
- name: Write env and compose to server
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# 1. Start with the static env file content
|
# 1. Start with the static env file content
|
||||||
@@ -154,10 +154,15 @@ jobs:
|
|||||||
echo "Preparing to send env file with variables:"
|
echo "Preparing to send env file with variables:"
|
||||||
grep -v "PASSWORD" /tmp/full_env.env || true
|
grep -v "PASSWORD" /tmp/full_env.env || true
|
||||||
|
|
||||||
# 5. Send to server
|
# 5. Send env to server
|
||||||
ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}" \
|
ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}" \
|
||||||
"setenv ${{ env.ENV }}" < /tmp/full_env.env
|
"setenv ${{ env.ENV }}" < /tmp/full_env.env
|
||||||
|
|
||||||
|
# 6. Send docker-compose.deploy.yml to server
|
||||||
|
# We use a trick to find the base_dir: we look where the script usually puts things
|
||||||
|
cat docker-compose.deploy.yml | ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes "${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}" \
|
||||||
|
"cat > /mnt/cache/appdata/print-calculator/docker-compose-deploy.yml 2>/dev/null || cat > /mnt/user/appdata/print-calculator/docker-compose-deploy.yml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Trigger deploy on Unraid (forced command key)
|
- name: Trigger deploy on Unraid (forced command key)
|
||||||
|
|||||||
@@ -3,13 +3,25 @@ echo "----------------------------------------------------------------"
|
|||||||
echo "Starting Backend Application"
|
echo "Starting Backend Application"
|
||||||
echo "DB_URL: $DB_URL"
|
echo "DB_URL: $DB_URL"
|
||||||
echo "DB_USERNAME: $DB_USERNAME"
|
echo "DB_USERNAME: $DB_USERNAME"
|
||||||
|
echo "SPRING_DATASOURCE_URL: $SPRING_DATASOURCE_URL"
|
||||||
echo "SLICER_PATH: $SLICER_PATH"
|
echo "SLICER_PATH: $SLICER_PATH"
|
||||||
echo "--- ALL ENV VARS ---"
|
echo "--- ALL ENV VARS ---"
|
||||||
env
|
env
|
||||||
echo "----------------------------------------------------------------"
|
echo "----------------------------------------------------------------"
|
||||||
|
|
||||||
# Exec java with explicit properties from env
|
# Determine which environment variables to use for database connection
|
||||||
|
# This allows compatibility with different docker-compose configurations
|
||||||
|
FINAL_DB_URL="${DB_URL:-$SPRING_DATASOURCE_URL}"
|
||||||
|
FINAL_DB_USER="${DB_USERNAME:-$SPRING_DATASOURCE_USERNAME}"
|
||||||
|
FINAL_DB_PASS="${DB_PASSWORD:-$SPRING_DATASOURCE_PASSWORD}"
|
||||||
|
|
||||||
|
if [ -n "$FINAL_DB_URL" ]; then
|
||||||
|
echo "Using database URL: $FINAL_DB_URL"
|
||||||
exec java -jar app.jar \
|
exec java -jar app.jar \
|
||||||
--spring.datasource.url="${DB_URL}" \
|
--spring.datasource.url="${FINAL_DB_URL}" \
|
||||||
--spring.datasource.username="${DB_USERNAME}" \
|
--spring.datasource.username="${FINAL_DB_USER}" \
|
||||||
--spring.datasource.password="${DB_PASSWORD}"
|
--spring.datasource.password="${FINAL_DB_PASS}"
|
||||||
|
else
|
||||||
|
echo "No database URL specified in environment, relying on application.properties defaults."
|
||||||
|
exec java -jar app.jar
|
||||||
|
fi
|
||||||
|
|||||||
@@ -8,18 +8,25 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${BACKEND_PORT}:8000"
|
- "${BACKEND_PORT}:8000"
|
||||||
environment:
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=${ENV}
|
||||||
- DB_URL=${DB_URL}
|
- DB_URL=${DB_URL}
|
||||||
- DB_USERNAME=${DB_USERNAME}
|
- DB_USERNAME=${DB_USERNAME}
|
||||||
- DB_PASSWORD=${DB_PASSWORD}
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
- TEMP_DIR=/app/temp
|
- TEMP_DIR=/app/temp
|
||||||
- PROFILES_DIR=/app/profiles
|
- PROFILES_DIR=/app/profiles
|
||||||
restart: always
|
restart: always
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "10m"
|
||||||
|
max-file: "3"
|
||||||
volumes:
|
volumes:
|
||||||
- backend_profiles_${ENV}:/app/profiles
|
- backend_profiles_${ENV}:/app/profiles
|
||||||
- /mnt/cache/appdata/print-calculator/${ENV}/storage_quotes:/app/storage_quotes
|
- /mnt/cache/appdata/print-calculator/${ENV}/storage_quotes:/app/storage_quotes
|
||||||
- /mnt/cache/appdata/print-calculator/${ENV}/storage_orders:/app/storage_orders
|
- /mnt/cache/appdata/print-calculator/${ENV}/storage_orders:/app/storage_orders
|
||||||
- /mnt/cache/appdata/print-calculator/${ENV}/storage_requests:/app/storage_requests
|
- /mnt/cache/appdata/print-calculator/${ENV}/storage_requests:/app/storage_requests
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: ${REGISTRY_URL}/${REPO_OWNER}/print-calculator-frontend:${TAG}
|
image: ${REGISTRY_URL}/${REPO_OWNER}/print-calculator-frontend:${TAG}
|
||||||
@@ -29,6 +36,11 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
restart: always
|
restart: always
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "10m"
|
||||||
|
max-file: "3"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
backend_profiles_prod:
|
backend_profiles_prod:
|
||||||
|
|||||||
Reference in New Issue
Block a user