@tachyon-gg/railway-deploy 0.2.5 → 0.2.6
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/README.md +3 -1
- package/dist/index.js +11 -3
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ environment: production # Railway environment name
|
|
|
60
60
|
|
|
61
61
|
shared_variables: # Variables shared across all services
|
|
62
62
|
APP_ENV: production
|
|
63
|
-
|
|
63
|
+
API_PORT: "8080"
|
|
64
64
|
|
|
65
65
|
services: # Map of service name -> config
|
|
66
66
|
web: { ... }
|
|
@@ -212,6 +212,8 @@ variables:
|
|
|
212
212
|
| `%{service_name}` | At config load time | Built-in: the service's config key |
|
|
213
213
|
| `null` | N/A | Marks a variable for deletion |
|
|
214
214
|
|
|
215
|
+
**Important:** Shared variables (`shared_variables`) cannot contain `${{service.VAR}}` references — Railway resolves shared variables without a service context, so cross-service references will resolve to empty strings. Use `${{service.VAR}}` references directly in service variables instead, and use shared variables only for plain values or `${{shared.OTHER_VAR}}` self-references.
|
|
216
|
+
|
|
215
217
|
`%{param}` is expanded first, so it can be used inside `${{}}` Railway references. This is useful for templates that need to reference their own or other services' variables:
|
|
216
218
|
|
|
217
219
|
```yaml
|
package/dist/index.js
CHANGED
|
@@ -39225,11 +39225,19 @@ async function applyChangeset(client, changeset, projectId, environmentId, optio
|
|
|
39225
39225
|
const failed = [];
|
|
39226
39226
|
const noColor = options?.noColor ?? false;
|
|
39227
39227
|
const createdServiceIds = new Map;
|
|
39228
|
-
const
|
|
39229
|
-
|
|
39228
|
+
const lastVarChangeByService = new Map;
|
|
39229
|
+
for (let i = 0;i < changeset.changes.length; i++) {
|
|
39230
|
+
const c = changeset.changes[i];
|
|
39231
|
+
if (c.type === "upsert-variables") {
|
|
39232
|
+
lastVarChangeByService.set(c.serviceName, i);
|
|
39233
|
+
}
|
|
39234
|
+
}
|
|
39230
39235
|
for (let i = 0;i < changeset.changes.length; i++) {
|
|
39231
39236
|
const change = changeset.changes[i];
|
|
39232
|
-
|
|
39237
|
+
let skipDeploys = false;
|
|
39238
|
+
if (change.type === "upsert-variables") {
|
|
39239
|
+
skipDeploys = i < (lastVarChangeByService.get(change.serviceName) ?? -1);
|
|
39240
|
+
}
|
|
39233
39241
|
try {
|
|
39234
39242
|
await applyChange(client, change, projectId, environmentId, createdServiceIds, skipDeploys);
|
|
39235
39243
|
applied.push(change);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachyon-gg/railway-deploy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"test:all": "bun test --bail --timeout 30000 --env-file .env.test test/",
|
|
30
30
|
"lint": "biome check .",
|
|
31
31
|
"lint:fix": "biome check --write .",
|
|
32
|
-
"format": "biome format --write ."
|
|
32
|
+
"format": "biome format --write .",
|
|
33
|
+
"prepare": "husky"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"@graphql-codegen/typescript": "^4.1.2",
|
|
49
50
|
"@graphql-codegen/typescript-operations": "^4.4.0",
|
|
50
51
|
"@types/bun": "latest",
|
|
52
|
+
"husky": "^9.1.7",
|
|
51
53
|
"typescript": "^5.7.0"
|
|
52
54
|
}
|
|
53
55
|
}
|