Pipeline: new names for variables and secrets, monitoring from the build environment, SSH key login #23
@@ -84,9 +84,9 @@ jobs:
|
|||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
|
||||||
# Sentry toont bij elke fout uit welke commit de build komt
|
# Sentry toont bij elke fout uit welke commit de build komt
|
||||||
# Dit artefact (dist) is ook wat naar productie gaat: bewust zonder
|
# Dit artefact (dist) is ook wat naar productie gaat: met de gecommitte
|
||||||
# OFFERINGS_URL, dus met de gecommitte pakketlijst. De testbuild met de
|
# pakketlijst (snapshot), zonder testadres en met dicht formulier. De
|
||||||
# pakketten uit het CMS is job build-test.
|
# CMS-host schrijft de actuele gegevens bij elk verzoek in de HTML.
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
env:
|
env:
|
||||||
@@ -105,10 +105,10 @@ jobs:
|
|||||||
path: web/dist/client/
|
path: web/dist/client/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
# De build voor de testsite: zelfde code als dist, maar met de pakketten uit
|
# De build voor de testsite: zelfde code als dist, maar met het eigen adres
|
||||||
# het CMS van de testomgeving (OFFERINGS_URL uit de repo-variabele
|
# van de testsite en het formulier open. De pakketten komen niet meer uit
|
||||||
# ASF_OFFERINGS_URL_TEST). Productie krijgt dit artefact nooit: die blijft op
|
# het CMS bij de build: de CMS-host injecteert ze bij elk verzoek.
|
||||||
# dist met de gecommitte lijst tot er een productie-CMS is.
|
# Productie krijgt dit artefact nooit.
|
||||||
build-test:
|
build-test:
|
||||||
needs: check
|
needs: check
|
||||||
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||||
@@ -137,11 +137,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build (testomgeving, pakketten uit het CMS)
|
- name: Build (testomgeving)
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
env:
|
env:
|
||||||
VITE_RELEASE: ${{ github.sha }}
|
VITE_RELEASE: ${{ github.sha }}
|
||||||
OFFERINGS_URL: ${{ vars.ASF_OFFERINGS_URL_TEST }}
|
|
||||||
# De testsite staat op zichzelf: canonical, og:url, og:image,
|
# De testsite staat op zichzelf: canonical, og:url, og:image,
|
||||||
# JSON-LD en sitemap wijzen naar het eigen adres, zodat een gedeelde
|
# JSON-LD en sitemap wijzen naar het eigen adres, zodat een gedeelde
|
||||||
# link (WhatsApp, Discord) ook zijn eigen plaatje toont. Alleen in
|
# link (WhatsApp, Discord) ook zijn eigen plaatje toont. Alleen in
|
||||||
@@ -197,10 +196,10 @@ jobs:
|
|||||||
SSH_PORT: ${{ secrets.PI_MAIN_PORT }}
|
SSH_PORT: ${{ secrets.PI_MAIN_PORT }}
|
||||||
SSH_USER: ${{ secrets.PI_MAIN_USERNAME }}
|
SSH_USER: ${{ secrets.PI_MAIN_USERNAME }}
|
||||||
SSH_HOST: ${{ secrets.PI_MAIN_ADDRESS }}
|
SSH_HOST: ${{ secrets.PI_MAIN_ADDRESS }}
|
||||||
DEPLOY_PATH: ${{ vars.DEPLOY_PATH_TEST }}
|
DEPLOY_PATH: ${{ vars.TEST_DEPLOY_PATH }}
|
||||||
run: |
|
run: |
|
||||||
case "$DEPLOY_PATH" in
|
case "$DEPLOY_PATH" in
|
||||||
''|'/'|*' '*) echo "DEPLOY_PATH_TEST ontbreekt of is ongeldig: '$DEPLOY_PATH'"; exit 1 ;;
|
''|'/'|*' '*) echo "TEST_DEPLOY_PATH ontbreekt of is ongeldig: '$DEPLOY_PATH'"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
sudo apt-get update && sudo apt-get install -y sshpass
|
sudo apt-get update && sudo apt-get install -y sshpass
|
||||||
SSH="sshpass -e ssh -p $SSH_PORT -o StrictHostKeyChecking=accept-new $SSH_USER@$SSH_HOST"
|
SSH="sshpass -e ssh -p $SSH_PORT -o StrictHostKeyChecking=accept-new $SSH_USER@$SSH_HOST"
|
||||||
@@ -223,18 +222,12 @@ jobs:
|
|||||||
# dus staan voor de deploy (zie pi-install-instructions.md).
|
# dus staan voor de deploy (zie pi-install-instructions.md).
|
||||||
- name: Controle na deploy
|
- name: Controle na deploy
|
||||||
env:
|
env:
|
||||||
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_TEST }}
|
HEALTH_URL: ${{ vars.TEST_HEALTH_URL }}
|
||||||
# 'true' zodra test.andreaslop.nl door de CMS-host (Api.AndreaSlopFotografie)
|
|
||||||
# wordt bediend in plaats van nginx: dan controleert het script ook de
|
|
||||||
# exacte CSP en de CMS-routes. Zet hem om samen met de proxy-route.
|
|
||||||
SERVED_BY_CMS: ${{ vars.ASF_TEST_SERVED_BY_CMS }}
|
|
||||||
run: |
|
run: |
|
||||||
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_TEST ingesteld; overgeslagen"; exit 0; fi
|
if [ -z "$HEALTH_URL" ]; then echo "Geen TEST_HEALTH_URL ingesteld; overgeslagen"; exit 0; fi
|
||||||
if [ "$SERVED_BY_CMS" = "true" ]; then
|
# test.andreaslop.nl wordt door de CMS-host bediend: het script
|
||||||
|
# controleert ook de exacte CSP en de CMS-routes
|
||||||
EXPECTED_CSP="$(node config/printCsp.ts)" bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test --cms
|
EXPECTED_CSP="$(node config/printCsp.ts)" bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test --cms
|
||||||
else
|
|
||||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist --test
|
|
||||||
fi
|
|
||||||
echo "Test bereikbaar en gelijk aan de build"
|
echo "Test bereikbaar en gelijk aan de build"
|
||||||
|
|
||||||
# Lighthouse tegen de gebouwde site (mobiel en desktop)
|
# Lighthouse tegen de gebouwde site (mobiel en desktop)
|
||||||
@@ -350,10 +343,10 @@ jobs:
|
|||||||
# Deze job kan pas draaien als er een webhost is.
|
# Deze job kan pas draaien als er een webhost is.
|
||||||
- name: Upload naar productie (FTPS)
|
- name: Upload naar productie (FTPS)
|
||||||
env:
|
env:
|
||||||
FTP_HOST: ${{ secrets.FTP_HOST }}
|
FTP_HOST: ${{ secrets.PROD_HOST_ADDRESS }}
|
||||||
FTP_USER: ${{ secrets.FTP_USERNAME }}
|
FTP_USER: ${{ secrets.PROD_HOST_USERNAME }}
|
||||||
LFTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
LFTP_PASSWORD: ${{ secrets.PROD_HOST_PASSWORD }}
|
||||||
FTP_DIR: ${{ vars.FTP_REMOTE_DIR || 'wwwroot' }}
|
FTP_DIR: ${{ vars.PROD_DEPLOY_PATH || 'wwwroot' }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install -y lftp
|
sudo apt-get update && sudo apt-get install -y lftp
|
||||||
bash deploy/upload-production.sh dist "$FTP_DIR"
|
bash deploy/upload-production.sh dist "$FTP_DIR"
|
||||||
@@ -361,8 +354,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Controle na deploy
|
- name: Controle na deploy
|
||||||
env:
|
env:
|
||||||
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
|
HEALTH_URL: ${{ vars.PROD_HEALTH_URL }}
|
||||||
run: |
|
run: |
|
||||||
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_PRODUCTION ingesteld; overgeslagen"; exit 0; fi
|
if [ -z "$HEALTH_URL" ]; then echo "Geen PROD_HEALTH_URL ingesteld; overgeslagen"; exit 0; fi
|
||||||
bash deploy/verify-deployment.sh "$HEALTH_URL" dist
|
bash deploy/verify-deployment.sh "$HEALTH_URL" dist
|
||||||
echo "Productie bereikbaar en gelijk aan de build"
|
echo "Productie bereikbaar en gelijk aan de build"
|
||||||
|
|||||||
@@ -60,11 +60,10 @@ Decision (Bryan, 2026-11-15): the hosting package has one entry per website. The
|
|||||||
## Environment and variables
|
## Environment and variables
|
||||||
|
|
||||||
| Name | Where | Meaning |
|
| Name | Where | Meaning |
|
||||||
| --------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `OFFERINGS_URL` | build env | Site address that serves the API (for example `https://test.andreaslop.nl`). Unset gives the snapshot. |
|
| `OFFERINGS_URL` | build env | Site address that serves the API (for example `https://test.andreaslop.nl`). Unset gives the snapshot. |
|
||||||
| `ASF_OFFERINGS_URL_TEST` | Gitea repo variable | Value of `OFFERINGS_URL` for the test build. Set by SLS, not by feature sessions. |
|
|
||||||
| `API_PROXY_TARGET` | dev env | Forwards `/api` in `pnpm dev` to a CMS host. |
|
| `API_PROXY_TARGET` | dev env | Forwards `/api` in `pnpm dev` to a CMS host. |
|
||||||
| `VITE_SITE_URL` | build env | Address the site presents itself under (canonical, og:*, JSON-LD, sitemap). Only the test build sets it (`https://test.andreaslop.nl`); unset gives `https://andreaslop.nl`. |
|
| `VITE_SITE_URL` | build env | Address the site presents itself under (canonical, og:*, JSON-LD, sitemap). Only the test build sets it (`https://test.andreaslop.nl`); unset gives `https://andreaslop.nl`. |
|
||||||
| `VITE_CONTACT_FORM_ENABLED` | build env | Opens the contact form when exactly `true`. Only the test build sets it; unset keeps the form closed (production). Opening it in production needs Bryan's explicit go, after the captcha decision ([go-live-checklist.md](go-live-checklist.md)). |
|
| `VITE_CONTACT_FORM_ENABLED` | build env | Opens the contact form when exactly `true`. Only the test build sets it; unset keeps the form closed (production). Opening it in production needs Bryan's explicit go, after the captcha decision ([go-live-checklist.md](go-live-checklist.md)). |
|
||||||
|
|
||||||
The production artifact is built without `OFFERINGS_URL` on purpose: production must never carry the prices of the test CMS.
|
No build sets `OFFERINGS_URL` any more (since the host injection, 2026-11-18): the CMS host writes the current data into the HTML. The variable stays supported for a local build against a CMS. The production artifact never carries the prices of the test CMS.
|
||||||
|
|||||||
+18
-3
@@ -20,8 +20,8 @@ Dispatch from the CLI (the token comes from your git credentials, never print it
|
|||||||
|
|
||||||
## Jobs
|
## Jobs
|
||||||
|
|
||||||
1. `check`: lint, format, unit/property/axe tests (coverage threshold 100% on `src/lib/**`), build **without** `OFFERINGS_URL` (so with the committed snapshot), audit. Uploads artifact `dist` (this is what production gets).
|
1. `check`: lint, format, unit/property/axe tests (coverage threshold 100% on `src/lib/**`), build (with the committed package snapshot), audit. Uploads artifact `dist` (this is what production gets).
|
||||||
2. `build-test`: builds again with `OFFERINGS_URL=${{ vars.ASF_OFFERINGS_URL_TEST }}` (packages and banners from the test CMS) and `VITE_SITE_URL=https://test.andreaslop.nl` (see "Own address of the test site") and uploads `dist-test`.
|
2. `build-test`: builds again with `VITE_CONTACT_FORM_ENABLED=true` and `VITE_SITE_URL=https://test.andreaslop.nl` (see "Own address of the test site") and uploads `dist-test`.
|
||||||
3. `deploy-test`: needs `check` and `build-test`, downloads `dist-test`, uploads to the ASF test host and runs the deployment check (served by the CMS host, admin files, POST status).
|
3. `deploy-test`: needs `check` and `build-test`, downloads `dist-test`, uploads to the ASF test host and runs the deployment check (served by the CMS host, admin files, POST status).
|
||||||
4. `lighthouse`: against the built site with the preview stub (`--audit-route --contact-stub`).
|
4. `lighthouse`: against the built site with the preview stub (`--audit-route --contact-stub`).
|
||||||
5. `deploy-production`: manual, from `release/*` only, uses artifact `dist`.
|
5. `deploy-production`: manual, from `release/*` only, uses artifact `dist`.
|
||||||
@@ -52,4 +52,19 @@ The test site stands on its own: in the test build `VITE_SITE_URL` is `https://t
|
|||||||
|
|
||||||
There used to be a nightly test build (`schedule`, 03:15 UTC) that baked the CMS data into the HTML for search engines. It is gone: the CMS host writes the packages, banners and hero into the first HTML of every request (cache 60 s, refreshed at once on a change; NFR-10), so a content change is visible without a rebuild. A rebuild is only needed for code and design. The nightly run also put `master` over ASF-test every night, which would undo a feature branch deployed there.
|
There used to be a nightly test build (`schedule`, 03:15 UTC) that baked the CMS data into the HTML for search engines. It is gone: the CMS host writes the packages, banners and hero into the first HTML of every request (cache 60 s, refreshed at once on a change; NFR-10), so a content change is visible without a rebuild. A rebuild is only needed for code and design. The nightly run also put `master` over ASF-test every night, which would undo a feature branch deployed there.
|
||||||
|
|
||||||
The production site gets the same only when the ASF production site is served by the CMS host (the IIS pipeline, later; see [go-live-checklist.md](go-live-checklist.md)). Until then production shows the committed snapshot. The test build still sets `OFFERINGS_URL`; removing that (and `VITE_SITE_URL`) is a separate follow-up once host injection is confirmed end to end.
|
The production site gets the same only when the ASF production site is served by the CMS host (the IIS pipeline, later; see [go-live-checklist.md](go-live-checklist.md)). Until then production shows the committed snapshot. The test build no longer sets `OFFERINGS_URL` (removed 2026-11-18, once the host injection was confirmed on ASF-test); it still sets `VITE_SITE_URL` (own address of the test site) and `VITE_CONTACT_FORM_ENABLED`.
|
||||||
|
|
||||||
|
## Names of the repo variables and secrets
|
||||||
|
|
||||||
|
Format `{ENV}_{GROUP}_{NAME}` with `ENV` = `TEST` or `PROD`, no app part (this repo only deploys the ASF site) and no `VITE` (the pipeline maps a value to `VITE_...` in the build). Decision of Bryan, 2026-11-18; the full list is in the SLS repo (`aidlc-docs/_shared/gitea-naamgeving-variabelen.md`). Repo variables and secrets are created by SLS, not by feature sessions.
|
||||||
|
|
||||||
|
| Name | Kind | Used by |
|
||||||
|
| --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
|
| `TEST_DEPLOY_PATH` | variable | `deploy-test`: target folder on the Pi |
|
||||||
|
| `TEST_HEALTH_URL` | variable | `deploy-test`: check after the deploy |
|
||||||
|
| `PROD_DEPLOY_PATH` | variable | `deploy-production`: remote folder (default `wwwroot`) |
|
||||||
|
| `PROD_HEALTH_URL` | variable | `deploy-production`: check after the deploy |
|
||||||
|
| `PROD_HOST_ADDRESS`, `PROD_HOST_USERNAME`, `PROD_HOST_PASSWORD` | secrets | `deploy-production`: FTP (plain FTP, no FTPS, at the hosting partner) |
|
||||||
|
| `PI_MAIN_ADDRESS`, `_PORT`, `_USERNAME`, `_PASSWORD` | secrets | `deploy-test`: still the old names; they become `TEST_HOST_*` with an SSH key (SLS arranges the key) |
|
||||||
|
|
||||||
|
Removed: `DEPLOY_PATH_TEST`, `HEALTH_CHECK_URL_TEST`, `HEALTH_CHECK_URL_PRODUCTION`, `FTP_REMOTE_DIR`, `FTP_HOST`, `FTP_USERNAME`, `FTP_PASSWORD` (renamed), `ASF_OFFERINGS_URL_TEST` and `ASF_TEST_SERVED_BY_CMS` (no longer needed). The old names in the repo are removed by SLS after a green run.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ What must be true before the CMS-driven parts of the site go to production. Brya
|
|||||||
|
|
||||||
- [ ] Production hosting in place with the CMS host as the one entry of the website: IIS passes ALL requests to the CMS host (not only `/api/v1/*`) and serves no static files itself; the prerendered `dist/` is deployed to the CMS host ([cms-integration.md](cms-integration.md), "Hosting"). The generated IIS config and the production upload script are updated for this. Without it production keeps the committed snapshot and the console shows a 404 per page view for the API.
|
- [ ] Production hosting in place with the CMS host as the one entry of the website: IIS passes ALL requests to the CMS host (not only `/api/v1/*`) and serves no static files itself; the prerendered `dist/` is deployed to the CMS host ([cms-integration.md](cms-integration.md), "Hosting"). The generated IIS config and the production upload script are updated for this. Without it production keeps the committed snapshot and the console shows a 404 per page view for the API.
|
||||||
- [ ] `web/src/content/offerings.snapshot.json` holds the real, current packages (production builds use it).
|
- [ ] `web/src/content/offerings.snapshot.json` holds the real, current packages (production builds use it).
|
||||||
- [ ] The production CMS holds the real packages. The test CMS prices must never end up in the production artifact (it is built without `OFFERINGS_URL`).
|
- [ ] The production CMS holds the real packages. The test CMS prices must never end up in the production artifact (no build fetches packages from a CMS any more).
|
||||||
|
|
||||||
## Hero
|
## Hero
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user