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: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Switching current -> releases/412
$ vallic ssh
vallic@acme-webshop-16-production:/var/www/html$ drush status

$ vallic db export > dump.sql
$ gunzip -c dump.sql.gz | vallic db import staging
$ vallic db dump --gzip
✓ Wrote acme--production--dump.sql.gz (88.4 MB)
$ vallic db import staging -f acme--production--dump.sql.gz
$ vallic mount download ./files

$ vallic tunnel staging db
Expand Down Expand Up @@ -216,23 +217,28 @@ when it is left off.

| | |
|---|---|
| `login` · `logout` · `whoami` · `team` | Signing in, and which team a credential reaches |
| `login` · `logout` · `whoami` · `team list\|switch` | Signing in, and which team a credential reaches |
| `team people\|invite\|role\|remove\|withdraw` | Who is in the team, inviting more, their roles |
| `ssh-key list\|add\|delete` | The SSH keys on your account, which every shell and dump logs in with |
| `project` · `env` · `server` · `status` | What exists |
| `url [--all] [--open]` | The browsable address, alone on stdout. `--all` lists every name the edge routes |
| `deploy` · `rollback` · `redeploy` · `release list` | Shipping |
| `activity list` · `activity get` · `activity log` | What the platform has been doing, and the log of one task |
| `activity list` · `activity get` · `activity log` · `activity cancel` | What the platform has been doing, the log of one task, and calling off one that has not started |
| `logs` | Where the site's own request and error logs go — the project's destination and the machine's copy. Not a tail: Vallic Cloud does not keep them |
| `ssh` · `sql` · `db` · `mount` | Getting inside |
| `ssh` · `sql` · `db dump\|export\|import\|size` · `mount` | Getting inside. `db dump` writes a file named for the project and environment, all of it or `--table`s; `db size` shows the largest tables; `sql -- <query>` runs one query |
| `drush` | `drush` in the container, over the same forced command `ssh --` uses |
| `var list\|get\|set\|delete\|apply` | Variables, at either scope; `apply` restarts the site with them now |
| `var list\|get\|set\|delete\|import\|apply` | Variables, at either scope; `import` adds a `.env`, `apply` restarts the site with them now |
| `domain list\|add\|verify\|delete` | Hostnames, and the DNS each one needs |
| `service list` | The stack, and the versions that go in `vallic.yaml` |
| `backup list\|create\|download\|restore` | Copies, and putting one back |
| `env create` · `env source` · `env delete` | Raising, repointing and removing an environment |
| `env create` · `env source` · `env maintenance` · `env delete` | Raising, repointing, taking offline and removing an environment |
| `cdn show\|clear` · `metrics` | What the CDN caches, and emptying it; CPU, memory and disk over a window |
| `validate [--local]` | Checking `vallic.yaml` before you commit it |
| `init` | Writes a starting `vallic.yaml` from what the checkout looks like |
| `init` | Writes a starting `vallic.yaml` from what the checkout looks like: Drupal, Laravel, WordPress, PHP, Node.js (or Bun), Go, Rust, Python, Django, Ruby and Rails |
| `link` | Records which project this checkout is, when the git remote cannot say |

Upsun's and Platform.sh's spelling works too: `vallic db:dump`, `vallic environment:list` and `vallic user:add` are `db dump`, `env list` and `team invite`.

Four of these are worth knowing about before you need them.

**A secret is never readable, by anybody.** Not masked for a viewer and shown
Expand Down
101 changes: 92 additions & 9 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ vallic login --token

# Who the stored credential belongs to, and which teams it reaches
vallic whoami
vallic team
vallic team list

# Put your SSH key on your account, for ssh, db and mount: the first of
# ~/.ssh/id_ed25519.pub, id_ecdsa.pub and id_rsa.pub, or the one you name
vallic ssh-key add
vallic ssh-key add ~/.ssh/vallic.pub --label work-laptop
vallic ssh-key list

# Record a project for directories that are not a clone of its repository.
# One for the whole machine: a clone's own remote still answers first.
Expand Down Expand Up @@ -54,8 +60,10 @@ vallic url staging --open
## vallic.yaml

```bash
# A starting file from what the checkout looks like
vallic init --type drupal
# A starting file from what the checkout looks like: composer.json, go.mod,
# Cargo.toml, pyproject.toml, Gemfile or package.json (on Bun with a bun.lock)
vallic init
vallic init --type rust

# Check it before committing: on its own, or against what an environment runs
vallic validate --local
Expand All @@ -72,10 +80,30 @@ vallic env create feature/checkout --type development --auto-deploy
vallic env source staging --branch release/2.0
vallic env source staging --auto-deploy false

# Put staging behind its offline page while something is fixed, and back
vallic env maintenance on staging --note "Back at 15:00"
vallic env maintenance off staging

# Remove an environment and its machines
vallic env delete feature-checkout
```

## The team

```bash
# Who is in the team, and the invitations still waiting
vallic team people

# Invite somebody; the link is printed once and no mail is sent
vallic team invite ana@example.com --role developer
vallic team invite contractor@example.com --role developer --projects acme-site

# Another role, take somebody off, or take an invitation back
vallic team role ana@example.com admin
vallic team remove contractor@example.com
vallic team withdraw old@example.com
```

## Building and deploying

```bash
Expand Down Expand Up @@ -106,8 +134,15 @@ vallic activity list production --type deploy,build --limit 20
vallic activity get 1234
vallic activity log 1234 --follow

# Call off a deploy still waiting in the queue; one already running finishes
vallic activity cancel 1235

# Where the site's logs go
vallic logs production

# CPU, memory and disk: now, on average and at peak
vallic metrics production
vallic metrics production --window 7d
```

## A shell and commands
Expand Down Expand Up @@ -179,16 +214,36 @@ vallic mount upload staging ./files --delete
## Databases

```bash
# A copy of production's database, then onto staging
# A copy of production's database, in a file named for it, then onto staging
vallic db dump production
vallic db import staging --file acme--production--dump.sql

# Compressed, with the time in the name so the last one is kept; import
# decompresses whatever it is given
vallic db dump production --gzip --timestamp
vallic db import staging -f acme--production--20261018-031500-UTC--dump.sql.gz

# Somewhere else, or named outright
vallic db dump production --directory ~/dumps
vallic db dump production --file before-upgrade.sql.gz

# Part of it: some tables, all but some, or the schema alone
vallic db dump production --table users --table orders
vallic db dump production --exclude-table cache_render,sessions
vallic db dump production --schema-only

# How much it holds, and the largest tables
vallic db size production

# A stream, for a pipeline
vallic db export production > production.sql
vallic db export production --gzip > production.sql.gz
vallic db import staging < production.sql

# Compressed on the way out
vallic db export production | gzip > production.sql.gz
gunzip -c production.sql.gz | vallic db import staging

# An interactive prompt
# An interactive prompt, one query, or a file of them
vallic sql staging
vallic sql production -- 'SELECT COUNT(*) FROM users'
vallic sql staging < fix.sql

# A local port onto the database, for a desktop client, and the credentials
vallic tunnel staging db --port 3307
Expand Down Expand Up @@ -226,6 +281,11 @@ vallic var set PAYMENT_KEY sk_live_example production --secret
vallic var get API_URL staging
vallic var delete OLD_FLAG staging

# Add every variable in a .env, all or none; see first what it would add
vallic var import .env.production production --dry-run
vallic var import .env.production production
vallic var import .env.shared --scope project --secret STRIPE_KEY,DB_PASSWORD

# Restart the site so changed variables take effect now
vallic var apply production
```
Expand All @@ -247,6 +307,29 @@ vallic domain delete old.example.com production
`domain verify` exits 0 when the answer is "not yet", so a retry loop does not
fail on a record that has not propagated.

## The CDN

```bash
# What it caches, and for how long
vallic cdn show production

# Empty it after a change the site's own cache headers do not cover
vallic cdn clear production
```

## Coming from Upsun

Upsun's `noun:verb` spelling is read as the two words it stands for, and the
commands spelled differently here are mapped to what does the same thing:

```bash
vallic db:dump production # vallic db dump production
vallic environment:list # vallic env list
vallic db:sql production # vallic sql production
vallic user:add ana@example.com --role developer # vallic team invite …
vallic self:update # vallic self-update
```

## In scripts and CI

```bash
Expand Down
Loading
Loading