Test site: risk-appetite-test.triodian.com
A separate copy of the app for trying changes before they reach the live engagement.
It has its own Worker (risk-appetite-test) and its own database (risk-appetite-test-db),
so nothing done there touches the live engagement. A striped banner across the top of every
page says "Test site ยท not the live engagement".
One-time set-up (about 15 minutes)โ
-
Create the test database. Cloudflare dashboard โ Storage & databases โ D1 โ Create database โ name it
risk-appetite-test-db. Copy its database ID and replaceREPLACE_WITH_TEST_DATABASE_IDinwrangler.jsonc(or send the ID to whoever maintains the app). The tables are created automatically on first use. -
Protect the address with the same sign-in. Zero Trust โ Access controls โ Applications โ the Risk Appetite application โ Configure โ add a public hostname
risk-appetite-test.triodian.com. Adding it to the same application keeps the same sign-in, the same MFA and the same AUD tag, so the app needs no other settings. Do this before the first deploy, so the address is never open. -
Connect the test Worker to GitHub. Workers & Pages โ Create โ Import a repository โ
Triodian/risk_appetite.- Worker name:
risk-appetite-test - Production branch:
test - Deploy command:
npx wrangler deploy --env testTherisk-appetite-test.triodian.comsub-domain and its DNS record are created by Cloudflare on the first deploy, because the route is a custom domain. Nothing needs adding in DNS by hand.
- Worker name:
-
Create the
testbranch in GitHub frommain.
Day to dayโ
- Changes go to the
testbranch first; Cloudflare deploys them to the test site. - When they have been checked there, merge
testintomain; Cloudflare deploys the live site. - The first person to sign in to the test site who is listed in
BOOTSTRAP_ADMINS(lib/config.js) becomes its administrator. Add test users in its Admin, separately from the live site. - To start the test site again from empty, delete and re-create the test database.