Skip to content

Support deploying from CI - #20

Merged
lnsp merged 1 commit into
masterfrom
ci-support
Nov 20, 2026
Merged

lnsp merged 1 commit into
masterfrom
ci-support

Conversation

@lnsp

@lnsp lnsp commented Nov 20, 2026

Copy link
Copy Markdown
Member

What

This is what valar/action v3 needs, and it helps any CI that runs the CLI.

  • Config from the environment. VALAR_TOKEN, VALAR_ENDPOINT and VALAR_PROJECT take precedence over the active context and over the project in .valar.yml.
    • Without a configured endpoint, a VALAR_TOKEN talks to https://api.valar.dev/v2.
    • A missing default config file no longer prints a warning. An explicit VALARCONFIG path that is missing still does.
  • valar build push --wait [--timeout 30m].
    • It prints the build ID on stdout as before, and streams the build log to stderr.
    • It waits for the build, then for the deployment made from it, and exits non-zero if either fails.
    • A deployment replaced by a newer one counts as success. A batch service has no deployment.
  • push --service. push now honours --service and keeps .valar.yml's build and deployment settings for that service, which is what pull request previews need. Before, the fallback dropped both sections whenever --service was given.
  • valar build watch exits non-zero when the build failed.
  • valar service url prints the service's URLs from its listed domains, linked custom domains first, then the <project>-<service> ones.
  • Fixes in service disable and enable:
    • Each sent the other's status: disable sent disabled=false. This went unnoticed because the route only arrives with platform#244.
    • Their --service flag was never registered.
    • enable now retries for up to two minutes while #244 answers 409 because the instances of an earlier disable are still stopping.
  • Malformed .valar.yml. A file that doesn't parse is now an error instead of being silently ignored.

Testing

  • go test ./... and go vet ./... pass. New tests cover:
    • env precedence, the default endpoint and the absence of the warning;
    • the --service override keeping build settings, and VALAR_PROJECT;
    • the malformed-file error;
    • the wait logic against a fake API: success, failed build, failed deployment, replaced deployment, --no-deploy, batch service, missing deployment, timeout;
    • URL ordering;
    • the enable retry.
  • End to end against valar-test-0, which runs a 2.11.0 candidate with #244:
    • a static service: push --wait exits 0 after "Deployed version 1", service url prints a URL that serves the page, disable gives 503, and enable straight after waits and serves 200 again;
    • push --wait --service ciwaitpr1 deploys a preview with .valar.yml's build settings;
    • a Go service that doesn't compile: push --wait and watch both exit 1.

- VALAR_TOKEN, VALAR_ENDPOINT and VALAR_PROJECT take precedence over the
  active context and .valar.yml's project, so CI needs no config file. A
  missing default config file no longer prints a warning.
- build push --wait streams the build log to stderr, waits for the build
  and its deployment, and exits non-zero if either fails. push honours
  --service and keeps .valar.yml's build settings for it.
- build watch exits non-zero when the build failed.
- service url prints the service's URLs, custom domains first.
- service disable and enable sent the opposite status, and their
  --service flag was never registered. enable now waits while the
  instances of an earlier disable are still stopping.
- A malformed .valar.yml is an error instead of being ignored.
@lnsp
lnsp merged commit d417ae0 into master Nov 20, 2026
3 checks passed
@lnsp
lnsp deleted the ci-support branch November 20, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant