chore: wire Carplace into dev and production stacks
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s
This commit is contained in:
@@ -51,7 +51,7 @@ SITE_ORIGIN=https://rentaldrivego.ma
|
||||
NEXT_PUBLIC_MARKETING_URL=https://rentaldrivego.ma
|
||||
NEXT_PUBLIC_MARKETPLACE_URL=https://rentaldrivego.ma
|
||||
NEXT_PUBLIC_HOMEPAGE_URL=https://rentaldrivego.ma
|
||||
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma
|
||||
NEXT_PUBLIC_CARPLACE_URL=https://rentaldrivego.ma/carplace
|
||||
NEXT_PUBLIC_DASHBOARD_URL=https://rentaldrivego.ma/dashboard
|
||||
NEXT_PUBLIC_ADMIN_URL=https://rentaldrivego.ma/admin
|
||||
NEXT_PUBLIC_PUBLIC_SITE_DOMAIN=rentaldrivego.ma
|
||||
|
||||
@@ -160,7 +160,7 @@ cd /opt/rentaldrivego
|
||||
docker load -i /opt/docker-image-transfer/carmanagement-latest.tar
|
||||
APP_ENV_FILE=.env.docker.production docker compose --env-file .env.docker.production -f docker-compose.production.yml up -d postgres redis
|
||||
APP_ENV_FILE=.env.docker.production docker compose --env-file .env.docker.production -f docker-compose.production.yml run --rm migrate
|
||||
APP_ENV_FILE=.env.docker.production docker compose --env-file .env.docker.production -f docker-compose.production.yml up -d api homepage storefront dashboard admin
|
||||
APP_ENV_FILE=.env.docker.production docker compose --env-file .env.docker.production -f docker-compose.production.yml up -d api homepage carplace dashboard admin
|
||||
```
|
||||
|
||||
## Source Builds
|
||||
|
||||
@@ -461,7 +461,7 @@ echo "Running database migrations"
|
||||
run_prod_migrations
|
||||
|
||||
echo "Starting application services"
|
||||
app_services=(api homepage storefront dashboard admin)
|
||||
app_services=(api homepage carplace dashboard admin)
|
||||
|
||||
if [[ "${include_pgmanage}" -eq 1 ]]; then
|
||||
prod_compose --profile private-tools up -d "${app_services[@]}" pgmanage
|
||||
@@ -471,7 +471,7 @@ fi
|
||||
|
||||
wait_for_healthy api 180
|
||||
wait_for_healthy homepage 180
|
||||
wait_for_healthy storefront 180
|
||||
wait_for_healthy carplace 180
|
||||
wait_for_healthy dashboard 180
|
||||
wait_for_healthy admin 180
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
@@ -90,7 +90,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
@@ -149,7 +149,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
@@ -180,7 +180,7 @@ services:
|
||||
- traefik.http.services.homepage-svc.loadbalancer.server.port=3000
|
||||
- traefik.http.routers.homepage.middlewares=rdg-security-headers@docker
|
||||
|
||||
storefront:
|
||||
carplace:
|
||||
<<: *node-runtime-hardening
|
||||
image: ${APP_IMAGE:-rentaldrivego/carmanagement}:${IMAGE_TAG:-latest}
|
||||
build:
|
||||
@@ -193,7 +193,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
@@ -203,7 +203,7 @@ services:
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
command: ["npm", "run", "start", "--workspace", "@rentaldrivego/storefront"]
|
||||
command: ["npm", "run", "start", "--workspace", "@rentaldrivego/carplace"]
|
||||
networks:
|
||||
- internal
|
||||
- traefik-proxy
|
||||
@@ -215,14 +215,14 @@ services:
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.storefront.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && (PathPrefix(`/explore`) || PathPrefix(`/renter`) || PathPrefix(`/sign-in`) || PathPrefix(`/footer`) || PathPrefix(`/app-privacy`) || PathPrefix(`/app-tc`) || PathPrefix(`/company-workspace`))
|
||||
- traefik.http.routers.storefront.entrypoints=websecure
|
||||
- traefik.http.routers.storefront.tls=true
|
||||
- traefik.http.routers.storefront.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.storefront.service=storefront-svc
|
||||
- traefik.http.routers.storefront.priority=20
|
||||
- traefik.http.services.storefront-svc.loadbalancer.server.port=3004
|
||||
- traefik.http.routers.storefront.middlewares=rdg-security-headers@docker
|
||||
- traefik.http.routers.carplace.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && PathPrefix(`/carplace`)
|
||||
- traefik.http.routers.carplace.entrypoints=websecure
|
||||
- traefik.http.routers.carplace.tls=true
|
||||
- traefik.http.routers.carplace.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.carplace.service=carplace-svc
|
||||
- traefik.http.routers.carplace.priority=20
|
||||
- traefik.http.services.carplace-svc.loadbalancer.server.port=3004
|
||||
- traefik.http.routers.carplace.middlewares=rdg-security-headers@docker
|
||||
|
||||
dashboard:
|
||||
<<: *node-runtime-hardening
|
||||
@@ -237,7 +237,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
@@ -281,7 +281,7 @@ services:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
|
||||
NEXT_PUBLIC_MARKETPLACE_URL: ${NEXT_PUBLIC_MARKETPLACE_URL}
|
||||
NEXT_PUBLIC_HOMEPAGE_URL: ${NEXT_PUBLIC_HOMEPAGE_URL}
|
||||
NEXT_PUBLIC_STOREFRONT_URL: ${NEXT_PUBLIC_STOREFRONT_URL}
|
||||
NEXT_PUBLIC_CARPLACE_URL: ${NEXT_PUBLIC_CARPLACE_URL}
|
||||
NEXT_PUBLIC_DASHBOARD_URL: ${NEXT_PUBLIC_DASHBOARD_URL}
|
||||
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL}
|
||||
SITE_ORIGIN: ${SITE_ORIGIN}
|
||||
|
||||
@@ -49,7 +49,7 @@ The `--yes` flag is required. Without it, the script exits with instructions.
|
||||
|
||||
### What the restore does (in order)
|
||||
|
||||
1. Stops all app services (api, dashboard, storefront, admin, pgmanage, redis, traefik)
|
||||
1. Stops all app services (api, dashboard, carplace, admin, pgmanage, redis, traefik)
|
||||
2. Starts PostgreSQL
|
||||
3. Restores the database with `pg_restore --clean --if-exists`
|
||||
4. Restores uploaded files into the api_uploads volume
|
||||
|
||||
@@ -254,7 +254,7 @@ start_prod_services() {
|
||||
|
||||
for service in "${services[@]}"; do
|
||||
case "${service}" in
|
||||
api|storefront|dashboard|admin)
|
||||
api|carplace|dashboard|admin)
|
||||
needs_migrations=1
|
||||
break
|
||||
;;
|
||||
@@ -348,7 +348,7 @@ pull_prod_release_images() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prod_compose pull migrate api homepage storefront dashboard admin
|
||||
prod_compose pull migrate api homepage carplace dashboard admin
|
||||
verify_prod_release_image
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ echo "Running database migrations"
|
||||
run_prod_migrations
|
||||
|
||||
echo "Starting application services"
|
||||
prod_compose up -d api homepage storefront dashboard admin
|
||||
prod_compose up -d api homepage carplace dashboard admin
|
||||
wait_for_healthy api 180
|
||||
wait_for_healthy homepage 180
|
||||
wait_for_healthy storefront 180
|
||||
wait_for_healthy carplace 180
|
||||
wait_for_healthy dashboard 180
|
||||
wait_for_healthy admin 180
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ SKIP_RAW_RESTORE_VOLUMES=(
|
||||
)
|
||||
|
||||
echo "Stopping application services before restore..."
|
||||
prod_compose stop api homepage storefront dashboard admin pgmanage >/dev/null || true
|
||||
prod_compose stop api homepage carplace dashboard admin pgmanage >/dev/null || true
|
||||
prod_compose stop redis >/dev/null || true
|
||||
stop_traefik
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ echo "Applying migrations"
|
||||
prod_compose run --rm migrate
|
||||
|
||||
echo "Starting application services"
|
||||
app_services=(api homepage storefront dashboard admin)
|
||||
app_services=(api homepage carplace dashboard admin)
|
||||
|
||||
if [[ "${INCLUDE_PGMANAGE}" == "1" ]]; then
|
||||
prod_compose --profile private-tools up -d "${app_services[@]}" pgmanage
|
||||
@@ -99,7 +99,7 @@ else
|
||||
fi
|
||||
wait_for_healthy api 180
|
||||
wait_for_healthy homepage 180
|
||||
wait_for_healthy storefront 180
|
||||
wait_for_healthy carplace 180
|
||||
wait_for_healthy dashboard 180
|
||||
wait_for_healthy admin 180
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
source "${ROOT_DIR}/scripts/docker-prod-common.sh"
|
||||
|
||||
start_traefik
|
||||
start_prod_services postgres redis api homepage storefront dashboard admin
|
||||
start_prod_services postgres redis api homepage carplace dashboard admin
|
||||
wait_for_healthy api
|
||||
wait_for_healthy homepage
|
||||
wait_for_healthy storefront
|
||||
wait_for_healthy carplace
|
||||
wait_for_healthy dashboard
|
||||
wait_for_healthy admin
|
||||
|
||||
echo "Production stack is up and healthy: traefik, postgres, redis, api, homepage, storefront, dashboard, admin"
|
||||
echo "Production stack is up and healthy: traefik, postgres, redis, api, homepage, carplace, dashboard, admin"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
source "${ROOT_DIR}/scripts/docker-prod-common.sh"
|
||||
|
||||
start_prod_services carplace
|
||||
wait_for_healthy carplace
|
||||
|
||||
echo "Carplace is up and healthy."
|
||||
@@ -5,9 +5,9 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
source "${ROOT_DIR}/scripts/docker-prod-common.sh"
|
||||
|
||||
start_prod_services homepage storefront dashboard admin
|
||||
start_prod_services homepage carplace dashboard admin
|
||||
wait_for_healthy homepage
|
||||
wait_for_healthy storefront
|
||||
wait_for_healthy carplace
|
||||
wait_for_healthy dashboard
|
||||
wait_for_healthy admin
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
source "${ROOT_DIR}/scripts/docker-prod-common.sh"
|
||||
|
||||
start_prod_services storefront
|
||||
wait_for_healthy storefront
|
||||
start_prod_services carplace
|
||||
wait_for_healthy carplace
|
||||
|
||||
echo "Storefront is up and healthy."
|
||||
echo "Carplace is up and healthy."
|
||||
|
||||
Reference in New Issue
Block a user