| Type | URL | Vercel Project | Environment | Vercel Deployment Type | Vercel Flags |
|---|---|---|---|---|---|
| Production | zentralhack.ch | prod-zentral-hack | Production | Production (live) | Production |
| Demo | See Bitwarden | dev-zentral-hack | Development |
Production (live) |
Production |
| Development | localhost | dev-zentral-hack | Development | - | Development |
The release script automates versioning, tagging, and pushing to the repository.
A deployment is created automatically, see Deployment
Create a .env file from .env.example in the project root if not already and add the GitHub PAT (see Bitwarden):
RELEASE_TOKEN=ghp_xxxxxxxxxxxx
Run the release script with:
npm run releaseThe script will prompt for a new version number and validate it. Versions must follow Semantic Versioning.
- Prompts for a new version and validates it
- Writes the new version to
package.json - Temporarily sets the local git
user.emailto the release email (STAIR GitHub E-Mail) - Temporarily authenticates as the STAIR release account via token
- Commits and pushes the version bump
- Creates an annotated git tag and pushes it
- Restores the previous local git
user.emailand remote URL
Note
The release email and token are only used temporarily during the script execution and never affect your global git configuration.
A deployment is created automatically whenever a tag is created that follows Semantic Versioning.
Every tag that is a stable release (e.g. 1.0.0, 1.2.0) automatically creates a Production Deployment on the production Vercel project.
This is the publicly accessible live website used by end-users.
Every tag that is a pre-release (e.g. 1.0.0-alpha.1, 1.2.0-beta.5) automatically creates a Vercel production deployment on the development Vercel project.
This is used to showcase and test new features in a production-like environment before they are released to production.
This project uses Vercel Flags with the Vercel adapter.
See Project Overview which Vercel Flags Environment to use.
Flags are defined centrally in lib/flags.ts:
import { flag } from "flags/next"
import { vercelAdapter } from "@flags-sdk/vercel"
// example
export const adminDocumentsFlag = flag({
key: "admin-documentss",
adapter: vercelAdapter(),
defaultValue: false
})Warning
defaultValue must be set for every flag. This prevents a runtime error if a flag is missing or not configured correctly in Vercel.
import { adminDocumentsFlag } from "@/lib/flags"
export async function AdminDocumentsGate() {
const showDocuments = await adminDocumentsFlag()
if (!showDocuments) {
return <p>Feature is currently disabled.</p>
}
return <DocumentsManagementPage />
}import { NextResponse } from "next/server"
import { adminDocumentsFlag } from "@/lib/flags"
export async function GET() {
const showDocuments = await adminDocumentsFlag()
if (!showDocuments) {
return NextResponse.json({ error: "Feature disabled" }, { status: 404 })
}
// ...
}- Add a new flag in
lib/flags.tswith (minimum):- unique
key adapter: vercelAdapter()- explicit
defaultValue
- unique
- Create the same flag key in both Vercel projects via Vercel project >
Flagson Sidebar:
Warning
defaultValue must be set for every flag. This prevents a runtime error if a flag is missing or not configured correctly in Vercel.