@specific.dev/cli 0.1.175 → 0.1.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/404/index.html +1 -1
- package/dist/admin/404.html +1 -1
- package/dist/admin/__next.!KGRlZmF1bHQp.__PAGE__.txt +2 -2
- package/dist/admin/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/__next._full.txt +3 -3
- package/dist/admin/__next._head.txt +1 -1
- package/dist/admin/__next._index.txt +2 -2
- package/dist/admin/__next._tree.txt +2 -2
- package/dist/admin/_next/static/chunks/{411d73f9ad4901a2.js → 076d0b19f149e961.js} +2 -2
- package/dist/admin/_next/static/chunks/{f11bf31415d76903.css → 25ac6c65cd7c74e2.css} +1 -1
- package/dist/admin/_not-found/__next._full.txt +2 -2
- package/dist/admin/_not-found/__next._head.txt +1 -1
- package/dist/admin/_not-found/__next._index.txt +2 -2
- package/dist/admin/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/admin/_not-found/__next._not-found.txt +1 -1
- package/dist/admin/_not-found/__next._tree.txt +2 -2
- package/dist/admin/_not-found/index.html +1 -1
- package/dist/admin/_not-found/index.txt +2 -2
- package/dist/admin/crons/__next.!KGRlZmF1bHQp.crons.__PAGE__.txt +2 -2
- package/dist/admin/crons/__next.!KGRlZmF1bHQp.crons.txt +1 -1
- package/dist/admin/crons/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/crons/__next._full.txt +3 -3
- package/dist/admin/crons/__next._head.txt +1 -1
- package/dist/admin/crons/__next._index.txt +2 -2
- package/dist/admin/crons/__next._tree.txt +2 -2
- package/dist/admin/crons/index.html +1 -1
- package/dist/admin/crons/index.txt +3 -3
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.databases.__PAGE__.txt +1 -1
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.databases.txt +1 -1
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/databases/__next._full.txt +2 -2
- package/dist/admin/databases/__next._head.txt +1 -1
- package/dist/admin/databases/__next._index.txt +2 -2
- package/dist/admin/databases/__next._tree.txt +2 -2
- package/dist/admin/databases/index.html +1 -1
- package/dist/admin/databases/index.txt +2 -2
- package/dist/admin/fullscreen/__next._full.txt +3 -3
- package/dist/admin/fullscreen/__next._head.txt +1 -1
- package/dist/admin/fullscreen/__next._index.txt +2 -2
- package/dist/admin/fullscreen/__next._tree.txt +2 -2
- package/dist/admin/fullscreen/__next.fullscreen.__PAGE__.txt +2 -2
- package/dist/admin/fullscreen/__next.fullscreen.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._full.txt +2 -2
- package/dist/admin/fullscreen/databases/__next._head.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._index.txt +2 -2
- package/dist/admin/fullscreen/databases/__next._tree.txt +2 -2
- package/dist/admin/fullscreen/databases/__next.fullscreen.databases.__PAGE__.txt +1 -1
- package/dist/admin/fullscreen/databases/__next.fullscreen.databases.txt +1 -1
- package/dist/admin/fullscreen/databases/__next.fullscreen.txt +1 -1
- package/dist/admin/fullscreen/databases/index.html +1 -1
- package/dist/admin/fullscreen/databases/index.txt +2 -2
- package/dist/admin/fullscreen/index.html +1 -1
- package/dist/admin/fullscreen/index.txt +3 -3
- package/dist/admin/index.html +1 -1
- package/dist/admin/index.txt +3 -3
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.mail.__PAGE__.txt +1 -1
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.mail.txt +1 -1
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/mail/__next._full.txt +2 -2
- package/dist/admin/mail/__next._head.txt +1 -1
- package/dist/admin/mail/__next._index.txt +2 -2
- package/dist/admin/mail/__next._tree.txt +2 -2
- package/dist/admin/mail/index.html +1 -1
- package/dist/admin/mail/index.txt +2 -2
- package/dist/admin/services/__next.!KGRlZmF1bHQp.services.__PAGE__.txt +1 -1
- package/dist/admin/services/__next.!KGRlZmF1bHQp.services.txt +1 -1
- package/dist/admin/services/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/services/__next._full.txt +2 -2
- package/dist/admin/services/__next._head.txt +1 -1
- package/dist/admin/services/__next._index.txt +2 -2
- package/dist/admin/services/__next._tree.txt +2 -2
- package/dist/admin/services/index.html +1 -1
- package/dist/admin/services/index.txt +2 -2
- package/dist/admin/storage/__next.!KGRlZmF1bHQp.storage.__PAGE__.txt +1 -1
- package/dist/admin/storage/__next.!KGRlZmF1bHQp.storage.txt +1 -1
- package/dist/admin/storage/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/storage/__next._full.txt +2 -2
- package/dist/admin/storage/__next._head.txt +1 -1
- package/dist/admin/storage/__next._index.txt +2 -2
- package/dist/admin/storage/__next._tree.txt +2 -2
- package/dist/admin/storage/index.html +1 -1
- package/dist/admin/storage/index.txt +2 -2
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.workflows.__PAGE__.txt +1 -1
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.workflows.txt +1 -1
- package/dist/admin/workflows/__next._full.txt +2 -2
- package/dist/admin/workflows/__next._head.txt +1 -1
- package/dist/admin/workflows/__next._index.txt +2 -2
- package/dist/admin/workflows/__next._tree.txt +2 -2
- package/dist/admin/workflows/index.html +1 -1
- package/dist/admin/workflows/index.txt +2 -2
- package/dist/cli.js +30 -7
- package/dist/docs/index.md +1 -0
- package/dist/docs/previews.md +57 -0
- package/dist/docs/services.md +2 -0
- package/dist/docs/volumes.md +27 -0
- package/package.json +1 -1
- /package/dist/admin/_next/static/{4p_gKX-ebPN5Vy0IhSe2O → 6iTWj5ZOTS6kNmEbXOCUs}/_buildManifest.js +0 -0
- /package/dist/admin/_next/static/{4p_gKX-ebPN5Vy0IhSe2O → 6iTWj5ZOTS6kNmEbXOCUs}/_clientMiddlewareManifest.json +0 -0
- /package/dist/admin/_next/static/{4p_gKX-ebPN5Vy0IhSe2O → 6iTWj5ZOTS6kNmEbXOCUs}/_ssgManifest.js +0 -0
|
@@ -14,11 +14,11 @@ f:"$Sreact.suspense"
|
|
|
14
14
|
11:I[15478,["/_next/static/chunks/b2b4aada246f4749.js","/_next/static/chunks/7c2bbd09e9922443.js"],"ViewportBoundary"]
|
|
15
15
|
13:I[15478,["/_next/static/chunks/b2b4aada246f4749.js","/_next/static/chunks/7c2bbd09e9922443.js"],"MetadataBoundary"]
|
|
16
16
|
15:I[47541,[],"default"]
|
|
17
|
-
:HL["/_next/static/chunks/
|
|
17
|
+
:HL["/_next/static/chunks/25ac6c65cd7c74e2.css","style"]
|
|
18
18
|
:HL["/_next/static/media/797e433ab948586e-s.p.29207c2f.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
19
19
|
:HL["/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
20
20
|
:HL["/_next/static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
21
|
-
0:{"P":null,"b":"
|
|
21
|
+
0:{"P":null,"b":"6iTWj5ZOTS6kNmEbXOCUs","c":["","workflows",""],"q":"","i":false,"f":[[["",{"children":["(default)",{"children":["workflows",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/25ac6c65cd7c74e2.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/c52b2ebc474a0535.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"inter_b2991b2-module__9mH_6q__variable","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/_next/static/chunks/21d31e8f6bca9c4d.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/b44581875c51fcd8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/65e3cacf9bc29c63.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/_next/static/chunks/dc5c264e3262a84a.js","async":true,"nonce":"$undefined"}]],["$","$L6",null,{"children":[["$","$L7",null,{}],["$","$L8",null,{"className":"overflow-hidden","children":["$","$L9",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$La",null,{"Component":"$b","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@c","$@d"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/e3baf0c708c5b9ae.js","async":true,"nonce":"$undefined"}]],["$","$Le",null,{"children":["$","$f",null,{"name":"Next.MetadataOutlet","children":"$@10"}]}]]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$L11",null,{"children":"$L12"}],["$","div",null,{"hidden":true,"children":["$","$L13",null,{"children":["$","$f",null,{"name":"Next.Metadata","children":"$L14"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$15",[]],"S":true}
|
|
22
22
|
c:{}
|
|
23
23
|
d:"$0:f:0:1:1:children:1:children:1:children:0:props:children:0:props:serverProvidedParams:params"
|
|
24
24
|
12:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
package/dist/cli.js
CHANGED
|
@@ -368588,8 +368588,19 @@ function parseVolumes(fieldObj) {
|
|
|
368588
368588
|
return volumes;
|
|
368589
368589
|
}
|
|
368590
368590
|
if (!Array.isArray(volumeData)) {
|
|
368591
|
-
for (const [name] of Object.entries(volumeData)) {
|
|
368592
|
-
|
|
368591
|
+
for (const [name, fieldsArray] of Object.entries(volumeData)) {
|
|
368592
|
+
const volume = { name };
|
|
368593
|
+
const fields = Array.isArray(fieldsArray) ? fieldsArray[0] : fieldsArray;
|
|
368594
|
+
if (fields && typeof fields === "object" && !Array.isArray(fields)) {
|
|
368595
|
+
const resetCommand = fields.reset_command;
|
|
368596
|
+
if (resetCommand !== void 0) {
|
|
368597
|
+
if (typeof resetCommand !== "string" || resetCommand.trim() === "") {
|
|
368598
|
+
throw new Error(`Volume "${name}" has an invalid "reset_command" value. Must be a non-empty string.`);
|
|
368599
|
+
}
|
|
368600
|
+
volume.reset_command = resetCommand;
|
|
368601
|
+
}
|
|
368602
|
+
}
|
|
368603
|
+
volumes.push(volume);
|
|
368593
368604
|
}
|
|
368594
368605
|
}
|
|
368595
368606
|
return volumes;
|
|
@@ -374729,7 +374740,7 @@ function trackEvent(event, properties) {
|
|
|
374729
374740
|
event,
|
|
374730
374741
|
properties: {
|
|
374731
374742
|
...properties,
|
|
374732
|
-
cli_version: "0.1.
|
|
374743
|
+
cli_version: "0.1.176",
|
|
374733
374744
|
platform: process.platform,
|
|
374734
374745
|
node_version: process.version,
|
|
374735
374746
|
project_id: getProjectId()
|
|
@@ -375591,8 +375602,19 @@ function parseVolumes2(fieldObj) {
|
|
|
375591
375602
|
return volumes;
|
|
375592
375603
|
}
|
|
375593
375604
|
if (!Array.isArray(volumeData)) {
|
|
375594
|
-
for (const [name] of Object.entries(volumeData)) {
|
|
375595
|
-
|
|
375605
|
+
for (const [name, fieldsArray] of Object.entries(volumeData)) {
|
|
375606
|
+
const volume = { name };
|
|
375607
|
+
const fields = Array.isArray(fieldsArray) ? fieldsArray[0] : fieldsArray;
|
|
375608
|
+
if (fields && typeof fields === "object" && !Array.isArray(fields)) {
|
|
375609
|
+
const resetCommand = fields.reset_command;
|
|
375610
|
+
if (resetCommand !== void 0) {
|
|
375611
|
+
if (typeof resetCommand !== "string" || resetCommand.trim() === "") {
|
|
375612
|
+
throw new Error(`Volume "${name}" has an invalid "reset_command" value. Must be a non-empty string.`);
|
|
375613
|
+
}
|
|
375614
|
+
volume.reset_command = resetCommand;
|
|
375615
|
+
}
|
|
375616
|
+
}
|
|
375617
|
+
volumes.push(volume);
|
|
375596
375618
|
}
|
|
375597
375619
|
}
|
|
375598
375620
|
return volumes;
|
|
@@ -376898,6 +376920,7 @@ function formatErrorCode(code) {
|
|
|
376898
376920
|
deploy_failed: "Service failed to deploy",
|
|
376899
376921
|
health_check_failed: "Health check failed",
|
|
376900
376922
|
post_deploy_failed: "Post-deploy hook failed",
|
|
376923
|
+
volume_reset_failed: "Volume reset failed",
|
|
376901
376924
|
internal_error: "Internal error"
|
|
376902
376925
|
};
|
|
376903
376926
|
return labels[code] || code;
|
|
@@ -379092,7 +379115,7 @@ function compareVersions(a, b) {
|
|
|
379092
379115
|
return 0;
|
|
379093
379116
|
}
|
|
379094
379117
|
async function checkForUpdate() {
|
|
379095
|
-
const currentVersion = "0.1.
|
|
379118
|
+
const currentVersion = "0.1.176";
|
|
379096
379119
|
const response = await fetch(`${BINARIES_BASE_URL}/latest?t=${Date.now()}`);
|
|
379097
379120
|
if (!response.ok) {
|
|
379098
379121
|
throw new Error(`Failed to check for updates: HTTP ${response.status}`);
|
|
@@ -379772,7 +379795,7 @@ async function domainAddCommand(service, domain, options2) {
|
|
|
379772
379795
|
var program = new Command();
|
|
379773
379796
|
var env = "production";
|
|
379774
379797
|
var envLabel = env !== "production" ? `[${env.toUpperCase()}] ` : "";
|
|
379775
|
-
program.name("specific").description(`${envLabel}Infrastructure-as-code for coding agents`).version("0.1.
|
|
379798
|
+
program.name("specific").description(`${envLabel}Infrastructure-as-code for coding agents`).version("0.1.176").enablePositionalOptions();
|
|
379776
379799
|
program.command("init").description("Initialize project for use with a coding agent").option("--agent <name...>", "Agents to configure (cursor, claude, codex, other)").addHelpText("after", `
|
|
379777
379800
|
Examples:
|
|
379778
379801
|
$ specific init
|
package/dist/docs/index.md
CHANGED
|
@@ -28,6 +28,7 @@ After deploying, the user can manage their project from the Specific Dashboard a
|
|
|
28
28
|
- [Volumes](/volumes): define persistent storage volumes for services to store files in.
|
|
29
29
|
- [Temporal](/temporal): managed durable workflow engine for background tasks, AI agents and more.
|
|
30
30
|
- [Observability](/observability): query logs and metrics from running environments using `specific query` for debugging and analytics.
|
|
31
|
+
- [Preview environments](/previews): ephemeral copies of an environment created per pull request, with the parent's databases branched, object storage forked, and volumes cloned. Covers resetting cloned volume state for stateful services.
|
|
31
32
|
<!-- beta:mail -->
|
|
32
33
|
- [Mail](/mail): managed email sending via SMTP for transactional emails.
|
|
33
34
|
<!-- /beta:mail -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Preview Environments
|
|
2
|
+
|
|
3
|
+
A preview environment is a temporary, fully isolated copy of an existing environment. It runs the same services with their own URLs and their own network namespace, on top of its own copy of the parent's stateful data — so a change can be tested end to end without touching the parent.
|
|
4
|
+
|
|
5
|
+
## How previews are created
|
|
6
|
+
|
|
7
|
+
- **Per pull request** — with the GitHub integration connected, Specific creates a preview environment for each open pull request, keeps it up to date as new commits are pushed, and posts its URL back on the PR.
|
|
8
|
+
- **Manually** — previews can also be created on demand.
|
|
9
|
+
|
|
10
|
+
Preview environments are ephemeral: pull-request previews are removed when the PR is closed or merged, and a preview can be given an expiry, after which Specific cleans it up automatically.
|
|
11
|
+
|
|
12
|
+
Run `specific status` to list every environment and its `env_…` ID, including preview environments. Target a preview with `--environment` on commands that take one (see `specific docs observability`).
|
|
13
|
+
|
|
14
|
+
## What's copied from the parent
|
|
15
|
+
|
|
16
|
+
A preview branches off a parent environment and starts from its data. Each resource is forked in the way that's fastest for that service:
|
|
17
|
+
|
|
18
|
+
- **Postgres** databases are branched (an instant, copy-on-write branch).
|
|
19
|
+
- **Object storage** buckets are forked.
|
|
20
|
+
- **Volumes** are cloned — a byte-for-byte copy of the parent volume's contents.
|
|
21
|
+
|
|
22
|
+
The preview gets its own isolated database, buckets, and volumes; writing to them never affects the parent.
|
|
23
|
+
|
|
24
|
+
## Volumes in previews
|
|
25
|
+
|
|
26
|
+
Because a volume is copied byte for byte, a preview's service starts on an exact replica of the parent's on-disk data. For most volumes (uploads, caches, plain database files) that is exactly what you want, and no extra configuration is needed.
|
|
27
|
+
|
|
28
|
+
But some stateful services store their **node or cluster identity inside the volume**, and a cloned instance that inherits the parent's identity can fail to start. The clearest example is **Typesense**, which keeps its raft consensus state — its node identity and peer list — under `state/` in the data directory. On a clone, the new node finds a cluster configuration that belongs to the parent and can't elect itself, so it crash-loops.
|
|
29
|
+
|
|
30
|
+
For services like this, set `reset_command` on the volume. Specific runs it **once** against the freshly cloned volume — before the service starts, in the service's image, with the volume mounted at `/volumes/<name>` — so the service can scrub state that must not be inherited:
|
|
31
|
+
|
|
32
|
+
```hcl
|
|
33
|
+
service "search" {
|
|
34
|
+
image = "typesense/typesense:30.1"
|
|
35
|
+
command = "typesense-server --data-dir=/volumes/data --api-port=$PORT --api-address=0.0.0.0"
|
|
36
|
+
|
|
37
|
+
volume "data" {
|
|
38
|
+
reset_command = "rm -rf /volumes/data/state"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
env = {
|
|
42
|
+
PORT = port
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- It runs **only** on cloned volumes in preview environments — never in production, and never on a freshly provisioned volume.
|
|
48
|
+
- A non-zero exit fails the deploy, so a botched reset never starts the service on bad data.
|
|
49
|
+
- Most services need no `reset_command` — reach for it only when a service stores node or cluster identity inside its volume.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
Related topics:
|
|
54
|
+
|
|
55
|
+
- Run `specific docs volumes` for declaring persistent volumes
|
|
56
|
+
- Run `specific docs services` for service configuration
|
|
57
|
+
- Run `specific docs observability` for querying a preview's logs and metrics
|
package/dist/docs/services.md
CHANGED
|
@@ -560,3 +560,5 @@ Related topics:
|
|
|
560
560
|
- Run `specific docs crons` for scheduled jobs (a service that runs on a schedule)
|
|
561
561
|
- Run `specific docs exec` for running one-off commands during development
|
|
562
562
|
- Run `specific docs postgres` for database configuration
|
|
563
|
+
- Run `specific docs volumes` for persistent storage volumes
|
|
564
|
+
- Run `specific docs previews` for preview environments (and resetting cloned volume state)
|
package/dist/docs/volumes.md
CHANGED
|
@@ -61,3 +61,30 @@ fs.writeFileSync(path.join(uploadsDir, "myfile.txt"), "Hello, world!");
|
|
|
61
61
|
// Read it back (persists across restarts)
|
|
62
62
|
const content = fs.readFileSync(path.join(uploadsDir, "myfile.txt"), "utf8");
|
|
63
63
|
```
|
|
64
|
+
|
|
65
|
+
## Preview environments
|
|
66
|
+
|
|
67
|
+
Preview environments clone each volume's contents byte for byte from the parent environment. For most volumes (uploads, caches, plain database files) that's exactly what you want, and no extra configuration is needed.
|
|
68
|
+
|
|
69
|
+
Some stateful services store node or cluster identity inside the volume and crash-loop when a clone inherits the parent's identity — for example Typesense keeps its raft consensus state under `state/`. For those, set `reset_command` on the volume to scrub that state once, on the freshly cloned volume, before the service starts in a preview:
|
|
70
|
+
|
|
71
|
+
```hcl
|
|
72
|
+
service "search" {
|
|
73
|
+
image = "typesense/typesense:30.1"
|
|
74
|
+
command = "typesense-server --data-dir=/volumes/data --api-port=$PORT --api-address=0.0.0.0"
|
|
75
|
+
|
|
76
|
+
volume "data" {
|
|
77
|
+
reset_command = "rm -rf /volumes/data/state"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
env = {
|
|
81
|
+
PORT = port
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- It runs **only** on cloned volumes in preview environments — never in production, and never on a freshly provisioned volume.
|
|
87
|
+
- A non-zero exit fails the deploy.
|
|
88
|
+
- Most services need no `reset_command` — reach for it only when a service stores node or cluster identity inside its volume.
|
|
89
|
+
|
|
90
|
+
See `specific docs previews` for how preview environments work.
|
package/package.json
CHANGED
/package/dist/admin/_next/static/{4p_gKX-ebPN5Vy0IhSe2O → 6iTWj5ZOTS6kNmEbXOCUs}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/admin/_next/static/{4p_gKX-ebPN5Vy0IhSe2O → 6iTWj5ZOTS6kNmEbXOCUs}/_ssgManifest.js
RENAMED
|
File without changes
|