Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ contain nothing environment-specific: per-environment values are runtime

## Daemon requirements

- piqueld with in-container HTTP probes and local previews (`main` after #219).
- piqueld with in-container HTTP probes, local previews and manifest-declared
environments (`main` after #233).
- Managed ingress with the private apps node, and a DNS provider for
`piquel.fr`: private routes get DNS-01 certificates (`*.dev.piquel.fr` covers
every preview).
Expand All @@ -40,24 +41,23 @@ contain nothing environment-specific: per-environment values are runtime

## Setup

The manifest declares both environments and where each deploys from: staging
follows pushes to `main` (`sync = true`), production is `promote_from =
"staging"`. Saving it creates them, or converts an existing application's, and
every later save or push to `main` keeps them in line; edit the manifest rather
than running `piquelctl env create`, `env source` or `env sync`.

Once, after this manifest is on `main`:

```sh
piquelctl app apply --file infra/piqueld.toml --yes
piquelctl env create piquel-fr staging --branch main --yes
piquelctl env source piquel-fr production --promote-from staging --yes
piquelctl env sync piquel-fr staging on
piquelctl --timeout 30m app apply --file infra/piqueld.toml --deploy --yes # deploys staging
piquelctl app repository webhook rotate piquel-fr # prints the secret once
piquelctl app repository webhook show piquel-fr # prints the payload URL
```

Add a GitHub webhook to this repository with that URL and secret,
`application/json`, and the `push` event. Then deploy staging once; it follows
`main` from then on:

```sh
piquelctl --timeout 30m env deploy piquel-fr staging --yes
```
`application/json`, and the `push` event. Staging follows `main` from then on;
production waits for its first promotion.

## Releasing

Expand Down
11 changes: 8 additions & 3 deletions infra/piqueld.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#:schema https://raw.githubusercontent.com/piquel-fr/piqueld/main/docs/application-manifest.schema.json
# piquel.fr on piqueld. Staging builds `main` on every push, production only
# receives releases promoted from staging, and previews deploy branches or local
# worktrees. See infra/README.md.
# piquel.fr on piqueld. The environments below are the application's only ones:
# staging builds `main` on every push, production only receives releases
# promoted from staging, and previews deploy branches or local worktrees. See
# infra/README.md.
api_version = "piqueld.dev/v1alpha1"
kind = "Application"

Expand All @@ -21,12 +22,16 @@ branch = "main"
[spec.variables]
invite_required = "true"

[spec.environments.production]
promote_from = "staging"

[spec.environments.production.variables]
web_host = "piquel.fr"
auth_host = "auth.piquel.fr"
www_host = "www.piquel.fr"

[spec.environments.staging]
sync = true
visibility = "private"

[spec.environments.staging.variables]
Expand Down
Loading