@infracraft/pulumi 1.15.0 → 1.16.0
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/deploy-command.cjs +48 -0
- package/dist/deploy-command.cjs.map +1 -0
- package/dist/deploy-command.d.cts +33 -0
- package/dist/deploy-command.d.cts.map +1 -0
- package/dist/deploy-command.d.mts +33 -0
- package/dist/deploy-command.d.mts.map +1 -0
- package/dist/deploy-command.mjs +45 -0
- package/dist/deploy-command.mjs.map +1 -0
- package/dist/fly/deploy.cjs +15 -25
- package/dist/fly/deploy.cjs.map +1 -1
- package/dist/fly/deploy.d.cts +7 -33
- package/dist/fly/deploy.d.cts.map +1 -1
- package/dist/fly/deploy.d.mts +7 -33
- package/dist/fly/deploy.d.mts.map +1 -1
- package/dist/fly/deploy.mjs +15 -24
- package/dist/fly/deploy.mjs.map +1 -1
- package/dist/git-guard.cjs +21 -280
- package/dist/git-guard.cjs.map +1 -1
- package/dist/git-guard.d.cts +11 -116
- package/dist/git-guard.d.cts.map +1 -1
- package/dist/git-guard.d.mts +11 -116
- package/dist/git-guard.d.mts.map +1 -1
- package/dist/git-guard.mjs +20 -267
- package/dist/git-guard.mjs.map +1 -1
- package/dist/hash.cjs +2 -2
- package/dist/hash.mjs +1 -1
- package/dist/railway/deploy.cjs +23 -33
- package/dist/railway/deploy.cjs.map +1 -1
- package/dist/railway/deploy.d.cts +10 -37
- package/dist/railway/deploy.d.cts.map +1 -1
- package/dist/railway/deploy.d.mts +10 -37
- package/dist/railway/deploy.d.mts.map +1 -1
- package/dist/railway/deploy.mjs +23 -32
- package/dist/railway/deploy.mjs.map +1 -1
- package/dist/sandbox.cjs +93 -0
- package/dist/sandbox.cjs.map +1 -0
- package/dist/sandbox.d.cts +46 -0
- package/dist/sandbox.d.cts.map +1 -0
- package/dist/sandbox.d.mts +46 -0
- package/dist/sandbox.d.mts.map +1 -0
- package/dist/sandbox.mjs +86 -0
- package/dist/sandbox.mjs.map +1 -0
- package/dist/vercel/deploy.cjs +15 -89
- package/dist/vercel/deploy.cjs.map +1 -1
- package/dist/vercel/deploy.d.cts +10 -82
- package/dist/vercel/deploy.d.cts.map +1 -1
- package/dist/vercel/deploy.d.mts +10 -82
- package/dist/vercel/deploy.d.mts.map +1 -1
- package/dist/vercel/deploy.mjs +16 -87
- package/dist/vercel/deploy.mjs.map +1 -1
- package/package.json +5 -1
- package/dist/stable-dir.cjs +0 -41
- package/dist/stable-dir.cjs.map +0 -1
- package/dist/stable-dir.d.cts +0 -34
- package/dist/stable-dir.d.cts.map +0 -1
- package/dist/stable-dir.d.mts +0 -34
- package/dist/stable-dir.d.mts.map +0 -1
- package/dist/stable-dir.mjs +0 -39
- package/dist/stable-dir.mjs.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('./chunk-BVYJZCqc.cjs');
|
|
3
|
+
const require_git_guard = require('./git-guard.cjs');
|
|
4
|
+
const require_sandbox = require('./sandbox.cjs');
|
|
5
|
+
let _pulumi_command = require("@pulumi/command");
|
|
6
|
+
_pulumi_command = require_chunk.__toESM(_pulumi_command, 1);
|
|
7
|
+
let _pulumi_pulumi = require("@pulumi/pulumi");
|
|
8
|
+
_pulumi_pulumi = require_chunk.__toESM(_pulumi_pulumi, 1);
|
|
9
|
+
|
|
10
|
+
//#region src/deploy-command.ts
|
|
11
|
+
/** Reads a `dependsOn` opt into a flat array of resource instances. */
|
|
12
|
+
function dependsOnList(opts) {
|
|
13
|
+
const dep = opts.dependsOn;
|
|
14
|
+
if (Array.isArray(dep)) return dep;
|
|
15
|
+
return dep ? [dep] : [];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:
|
|
19
|
+
* a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.
|
|
20
|
+
* The platform deploy resources call ONLY this; they never touch the sandbox.
|
|
21
|
+
*/
|
|
22
|
+
function createDeployCommand(args, opts) {
|
|
23
|
+
const deps = dependsOnList(opts);
|
|
24
|
+
const sandbox = deps.some(require_sandbox.isDeploySandbox);
|
|
25
|
+
const gitGuard = deps.some(require_git_guard.isGitGuard);
|
|
26
|
+
if (gitGuard && !sandbox) throw new Error(`[infracraft] ${args.name}: GitGuard has no effect without a DeploySandbox in dependsOn`);
|
|
27
|
+
const create = _pulumi_pulumi.output(args.cli).apply((cli) => require_sandbox.buildSandboxScript({
|
|
28
|
+
sandbox,
|
|
29
|
+
gitGuard,
|
|
30
|
+
appName: args.name.replace(/-deploy$/, ""),
|
|
31
|
+
excludePaths: args.excludePaths,
|
|
32
|
+
setup: args.setup,
|
|
33
|
+
cli
|
|
34
|
+
}));
|
|
35
|
+
const cmd = new _pulumi_command.local.Command(args.name, {
|
|
36
|
+
create,
|
|
37
|
+
triggers: args.triggers,
|
|
38
|
+
environment: args.environment
|
|
39
|
+
}, opts);
|
|
40
|
+
return {
|
|
41
|
+
command: cmd,
|
|
42
|
+
deploymentUrl: cmd.stdout.apply((out) => out.trim().split("\n").pop() ?? "")
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.createDeployCommand = createDeployCommand;
|
|
48
|
+
//# sourceMappingURL=deploy-command.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-command.cjs","names":["isDeploySandbox","isGitGuard","pulumi","buildSandboxScript","command"],"sources":["../src/deploy-command.ts"],"sourcesContent":["// src/deploy-command.ts\nimport * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\n\nimport { isGitGuard } from \"./git-guard\";\nimport { buildSandboxScript, isDeploySandbox } from \"./sandbox\";\n\nexport interface CreateDeployCommandArgs {\n\t/** Resource name; the child command is `<name>` and the sandbox dir uses it. */\n\tname: string;\n\t/** Fully-formed platform deploy command (may be an Output, e.g. Railway). */\n\tcli: pulumi.Input<string>;\n\t/** Redeploy triggers (source/env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\t/** Upload-scoping excludes (applied only in stub mode). */\n\texcludePaths?: string[];\n\t/** Shell run in the working dir before `cli` (e.g. write railpack.json). */\n\tsetup?: string;\n\t/** Env passed to the command (secrets that survive preview; not the inlined ones). */\n\tenvironment?: Record<string, pulumi.Input<string>>;\n}\n\nexport interface CreateDeployCommandResult {\n\tcommand: command.local.Command;\n\t/** The deploy CLI's final stdout line (the production URL for Vercel/Fly). */\n\tdeploymentUrl: pulumi.Output<string>;\n}\n\n/** Reads a `dependsOn` opt into a flat array of resource instances. */\nfunction dependsOnList(opts: pulumi.ComponentResourceOptions): unknown[] {\n\tconst dep = opts.dependsOn;\n\n\tif (Array.isArray(dep)) {\n\t\treturn dep;\n\t}\n\n\treturn dep ? [dep] : [];\n}\n\n/**\n * Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:\n * a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.\n * The platform deploy resources call ONLY this; they never touch the sandbox.\n */\nexport function createDeployCommand(\n\targs: CreateDeployCommandArgs,\n\topts: pulumi.ComponentResourceOptions,\n): CreateDeployCommandResult {\n\tconst deps = dependsOnList(opts);\n\tconst sandbox = deps.some(isDeploySandbox);\n\tconst gitGuard = deps.some(isGitGuard);\n\n\tif (gitGuard && !sandbox) {\n\t\tthrow new Error(\n\t\t\t`[infracraft] ${args.name}: GitGuard has no effect without a DeploySandbox in dependsOn`,\n\t\t);\n\t}\n\n\tconst create = pulumi.output(args.cli).apply((cli) =>\n\t\tbuildSandboxScript({\n\t\t\tsandbox,\n\t\t\tgitGuard,\n\t\t\tappName: args.name.replace(/-deploy$/, \"\"),\n\t\t\texcludePaths: args.excludePaths,\n\t\t\tsetup: args.setup,\n\t\t\tcli,\n\t\t}),\n\t);\n\n\tconst cmd = new command.local.Command(\n\t\targs.name,\n\t\t{ create, triggers: args.triggers, environment: args.environment },\n\t\topts,\n\t);\n\n\tconst deploymentUrl = cmd.stdout.apply(\n\t\t(out) => out.trim().split(\"\\n\").pop() ?? \"\",\n\t);\n\n\treturn { command: cmd, deploymentUrl };\n}\n"],"mappings":";;;;;;;;;;;AA6BA,SAAS,cAAc,MAAkD;CACxE,MAAM,MAAM,KAAK;CAEjB,IAAI,MAAM,QAAQ,GAAG,GACpB,OAAO;CAGR,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC;AACvB;;;;;;AAOA,SAAgB,oBACf,MACA,MAC4B;CAC5B,MAAM,OAAO,cAAc,IAAI;CAC/B,MAAM,UAAU,KAAK,KAAKA,+BAAe;CACzC,MAAM,WAAW,KAAK,KAAKC,4BAAU;CAErC,IAAI,YAAY,CAAC,SAChB,MAAM,IAAI,MACT,gBAAgB,KAAK,KAAK,8DAC3B;CAGD,MAAM,SAASC,eAAO,OAAO,KAAK,GAAG,EAAE,OAAO,QAC7CC,mCAAmB;EAClB;EACA;EACA,SAAS,KAAK,KAAK,QAAQ,YAAY,EAAE;EACzC,cAAc,KAAK;EACnB,OAAO,KAAK;EACZ;CACD,CAAC,CACF;CAEA,MAAM,MAAM,IAAIC,gBAAQ,MAAM,QAC7B,KAAK,MACL;EAAE;EAAQ,UAAU,KAAK;EAAU,aAAa,KAAK;CAAY,GACjE,IACD;CAMA,OAAO;EAAE,SAAS;EAAK,eAJD,IAAI,OAAO,OAC/B,QAAQ,IAAI,KAAK,EAAE,MAAM,IAAI,EAAE,IAAI,KAAK,EAGP;CAAE;AACtC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-OPjESj5l.cjs";
|
|
2
|
+
import * as command from "@pulumi/command";
|
|
3
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
4
|
+
|
|
5
|
+
//#region src/deploy-command.d.ts
|
|
6
|
+
interface CreateDeployCommandArgs {
|
|
7
|
+
/** Resource name; the child command is `<name>` and the sandbox dir uses it. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Fully-formed platform deploy command (may be an Output, e.g. Railway). */
|
|
10
|
+
cli: pulumi.Input<string>;
|
|
11
|
+
/** Redeploy triggers (source/env hashes). */
|
|
12
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
13
|
+
/** Upload-scoping excludes (applied only in stub mode). */
|
|
14
|
+
excludePaths?: string[];
|
|
15
|
+
/** Shell run in the working dir before `cli` (e.g. write railpack.json). */
|
|
16
|
+
setup?: string;
|
|
17
|
+
/** Env passed to the command (secrets that survive preview; not the inlined ones). */
|
|
18
|
+
environment?: Record<string, pulumi.Input<string>>;
|
|
19
|
+
}
|
|
20
|
+
interface CreateDeployCommandResult {
|
|
21
|
+
command: command.local.Command;
|
|
22
|
+
/** The deploy CLI's final stdout line (the production URL for Vercel/Fly). */
|
|
23
|
+
deploymentUrl: pulumi.Output<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:
|
|
27
|
+
* a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.
|
|
28
|
+
* The platform deploy resources call ONLY this; they never touch the sandbox.
|
|
29
|
+
*/
|
|
30
|
+
declare function createDeployCommand(args: CreateDeployCommandArgs, opts: pulumi.ComponentResourceOptions): CreateDeployCommandResult;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateDeployCommandArgs, CreateDeployCommandResult, createDeployCommand };
|
|
33
|
+
//# sourceMappingURL=deploy-command.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-command.d.cts","names":[],"sources":["../src/deploy-command.ts"],"mappings":";;;;;UAOiB,uBAAA;;EAEhB,IAAA;EAFgB;EAIhB,GAAA,EAAK,MAAA,CAAO,KAAA;;EAEZ,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAAP;EAEvB,YAAA;EAI6B;EAF7B,KAAA;EAEoB;EAApB,WAAA,GAAc,MAAA,SAAe,MAAA,CAAO,KAAA;AAAA;AAAA,UAGpB,yBAAA;EAChB,OAAA,EAAS,OAAA,CAAQ,KAAA,CAAM,OAAA;EAZX;EAcZ,aAAA,EAAe,MAAA,CAAO,MAAM;AAAA;;;;;;iBAmBb,mBAAA,CACf,IAAA,EAAM,uBAAA,EACN,IAAA,EAAM,MAAA,CAAO,wBAAA,GACX,yBAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-OPjESj5l.mjs";
|
|
2
|
+
import * as command from "@pulumi/command";
|
|
3
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
4
|
+
|
|
5
|
+
//#region src/deploy-command.d.ts
|
|
6
|
+
interface CreateDeployCommandArgs {
|
|
7
|
+
/** Resource name; the child command is `<name>` and the sandbox dir uses it. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Fully-formed platform deploy command (may be an Output, e.g. Railway). */
|
|
10
|
+
cli: pulumi.Input<string>;
|
|
11
|
+
/** Redeploy triggers (source/env hashes). */
|
|
12
|
+
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
13
|
+
/** Upload-scoping excludes (applied only in stub mode). */
|
|
14
|
+
excludePaths?: string[];
|
|
15
|
+
/** Shell run in the working dir before `cli` (e.g. write railpack.json). */
|
|
16
|
+
setup?: string;
|
|
17
|
+
/** Env passed to the command (secrets that survive preview; not the inlined ones). */
|
|
18
|
+
environment?: Record<string, pulumi.Input<string>>;
|
|
19
|
+
}
|
|
20
|
+
interface CreateDeployCommandResult {
|
|
21
|
+
command: command.local.Command;
|
|
22
|
+
/** The deploy CLI's final stdout line (the production URL for Vercel/Fly). */
|
|
23
|
+
deploymentUrl: pulumi.Output<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:
|
|
27
|
+
* a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.
|
|
28
|
+
* The platform deploy resources call ONLY this; they never touch the sandbox.
|
|
29
|
+
*/
|
|
30
|
+
declare function createDeployCommand(args: CreateDeployCommandArgs, opts: pulumi.ComponentResourceOptions): CreateDeployCommandResult;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CreateDeployCommandArgs, CreateDeployCommandResult, createDeployCommand };
|
|
33
|
+
//# sourceMappingURL=deploy-command.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-command.d.mts","names":[],"sources":["../src/deploy-command.ts"],"mappings":";;;;;UAOiB,uBAAA;;EAEhB,IAAA;EAFgB;EAIhB,GAAA,EAAK,MAAA,CAAO,KAAA;;EAEZ,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAAP;EAEvB,YAAA;EAI6B;EAF7B,KAAA;EAEoB;EAApB,WAAA,GAAc,MAAA,SAAe,MAAA,CAAO,KAAA;AAAA;AAAA,UAGpB,yBAAA;EAChB,OAAA,EAAS,OAAA,CAAQ,KAAA,CAAM,OAAA;EAZX;EAcZ,aAAA,EAAe,MAAA,CAAO,MAAM;AAAA;;;;;;iBAmBb,mBAAA,CACf,IAAA,EAAM,uBAAA,EACN,IAAA,EAAM,MAAA,CAAO,wBAAA,GACX,yBAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-OPjESj5l.mjs";
|
|
2
|
+
import { isGitGuard } from "./git-guard.mjs";
|
|
3
|
+
import { buildSandboxScript, isDeploySandbox } from "./sandbox.mjs";
|
|
4
|
+
import * as command from "@pulumi/command";
|
|
5
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
6
|
+
|
|
7
|
+
//#region src/deploy-command.ts
|
|
8
|
+
/** Reads a `dependsOn` opt into a flat array of resource instances. */
|
|
9
|
+
function dependsOnList(opts) {
|
|
10
|
+
const dep = opts.dependsOn;
|
|
11
|
+
if (Array.isArray(dep)) return dep;
|
|
12
|
+
return dep ? [dep] : [];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:
|
|
16
|
+
* a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.
|
|
17
|
+
* The platform deploy resources call ONLY this; they never touch the sandbox.
|
|
18
|
+
*/
|
|
19
|
+
function createDeployCommand(args, opts) {
|
|
20
|
+
const deps = dependsOnList(opts);
|
|
21
|
+
const sandbox = deps.some(isDeploySandbox);
|
|
22
|
+
const gitGuard = deps.some(isGitGuard);
|
|
23
|
+
if (gitGuard && !sandbox) throw new Error(`[infracraft] ${args.name}: GitGuard has no effect without a DeploySandbox in dependsOn`);
|
|
24
|
+
const create = pulumi.output(args.cli).apply((cli) => buildSandboxScript({
|
|
25
|
+
sandbox,
|
|
26
|
+
gitGuard,
|
|
27
|
+
appName: args.name.replace(/-deploy$/, ""),
|
|
28
|
+
excludePaths: args.excludePaths,
|
|
29
|
+
setup: args.setup,
|
|
30
|
+
cli
|
|
31
|
+
}));
|
|
32
|
+
const cmd = new command.local.Command(args.name, {
|
|
33
|
+
create,
|
|
34
|
+
triggers: args.triggers,
|
|
35
|
+
environment: args.environment
|
|
36
|
+
}, opts);
|
|
37
|
+
return {
|
|
38
|
+
command: cmd,
|
|
39
|
+
deploymentUrl: cmd.stdout.apply((out) => out.trim().split("\n").pop() ?? "")
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { createDeployCommand };
|
|
45
|
+
//# sourceMappingURL=deploy-command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-command.mjs","names":[],"sources":["../src/deploy-command.ts"],"sourcesContent":["// src/deploy-command.ts\nimport * as command from \"@pulumi/command\";\nimport * as pulumi from \"@pulumi/pulumi\";\n\nimport { isGitGuard } from \"./git-guard\";\nimport { buildSandboxScript, isDeploySandbox } from \"./sandbox\";\n\nexport interface CreateDeployCommandArgs {\n\t/** Resource name; the child command is `<name>` and the sandbox dir uses it. */\n\tname: string;\n\t/** Fully-formed platform deploy command (may be an Output, e.g. Railway). */\n\tcli: pulumi.Input<string>;\n\t/** Redeploy triggers (source/env hashes). */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\t/** Upload-scoping excludes (applied only in stub mode). */\n\texcludePaths?: string[];\n\t/** Shell run in the working dir before `cli` (e.g. write railpack.json). */\n\tsetup?: string;\n\t/** Env passed to the command (secrets that survive preview; not the inlined ones). */\n\tenvironment?: Record<string, pulumi.Input<string>>;\n}\n\nexport interface CreateDeployCommandResult {\n\tcommand: command.local.Command;\n\t/** The deploy CLI's final stdout line (the production URL for Vercel/Fly). */\n\tdeploymentUrl: pulumi.Output<string>;\n}\n\n/** Reads a `dependsOn` opt into a flat array of resource instances. */\nfunction dependsOnList(opts: pulumi.ComponentResourceOptions): unknown[] {\n\tconst dep = opts.dependsOn;\n\n\tif (Array.isArray(dep)) {\n\t\treturn dep;\n\t}\n\n\treturn dep ? [dep] : [];\n}\n\n/**\n * Builds a sandboxed deploy command. Inspects `opts.dependsOn` by brand:\n * a DeploySandbox → isolate; a GitGuard → stub `.git`; GitGuard alone → throw.\n * The platform deploy resources call ONLY this; they never touch the sandbox.\n */\nexport function createDeployCommand(\n\targs: CreateDeployCommandArgs,\n\topts: pulumi.ComponentResourceOptions,\n): CreateDeployCommandResult {\n\tconst deps = dependsOnList(opts);\n\tconst sandbox = deps.some(isDeploySandbox);\n\tconst gitGuard = deps.some(isGitGuard);\n\n\tif (gitGuard && !sandbox) {\n\t\tthrow new Error(\n\t\t\t`[infracraft] ${args.name}: GitGuard has no effect without a DeploySandbox in dependsOn`,\n\t\t);\n\t}\n\n\tconst create = pulumi.output(args.cli).apply((cli) =>\n\t\tbuildSandboxScript({\n\t\t\tsandbox,\n\t\t\tgitGuard,\n\t\t\tappName: args.name.replace(/-deploy$/, \"\"),\n\t\t\texcludePaths: args.excludePaths,\n\t\t\tsetup: args.setup,\n\t\t\tcli,\n\t\t}),\n\t);\n\n\tconst cmd = new command.local.Command(\n\t\targs.name,\n\t\t{ create, triggers: args.triggers, environment: args.environment },\n\t\topts,\n\t);\n\n\tconst deploymentUrl = cmd.stdout.apply(\n\t\t(out) => out.trim().split(\"\\n\").pop() ?? \"\",\n\t);\n\n\treturn { command: cmd, deploymentUrl };\n}\n"],"mappings":";;;;;;;;AA6BA,SAAS,cAAc,MAAkD;CACxE,MAAM,MAAM,KAAK;CAEjB,IAAI,MAAM,QAAQ,GAAG,GACpB,OAAO;CAGR,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC;AACvB;;;;;;AAOA,SAAgB,oBACf,MACA,MAC4B;CAC5B,MAAM,OAAO,cAAc,IAAI;CAC/B,MAAM,UAAU,KAAK,KAAK,eAAe;CACzC,MAAM,WAAW,KAAK,KAAK,UAAU;CAErC,IAAI,YAAY,CAAC,SAChB,MAAM,IAAI,MACT,gBAAgB,KAAK,KAAK,8DAC3B;CAGD,MAAM,SAAS,OAAO,OAAO,KAAK,GAAG,EAAE,OAAO,QAC7C,mBAAmB;EAClB;EACA;EACA,SAAS,KAAK,KAAK,QAAQ,YAAY,EAAE;EACzC,cAAc,KAAK;EACnB,OAAO,KAAK;EACZ;CACD,CAAC,CACF;CAEA,MAAM,MAAM,IAAI,QAAQ,MAAM,QAC7B,KAAK,MACL;EAAE;EAAQ,UAAU,KAAK;EAAU,aAAa,KAAK;CAAY,GACjE,IACD;CAMA,OAAO;EAAE,SAAS;EAAK,eAJD,IAAI,OAAO,OAC/B,QAAQ,IAAI,KAAK,EAAE,MAAM,IAAI,EAAE,IAAI,KAAK,EAGP;CAAE;AACtC"}
|
package/dist/fly/deploy.cjs
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('../chunk-BVYJZCqc.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_deploy_command = require('../deploy-command.cjs');
|
|
4
4
|
const require_fly_toml = require('./toml.cjs');
|
|
5
|
-
let _pulumi_command = require("@pulumi/command");
|
|
6
|
-
_pulumi_command = require_chunk.__toESM(_pulumi_command, 1);
|
|
7
5
|
let _pulumi_pulumi = require("@pulumi/pulumi");
|
|
8
6
|
_pulumi_pulumi = require_chunk.__toESM(_pulumi_pulumi, 1);
|
|
9
7
|
|
|
10
8
|
//#region src/fly/deploy.ts
|
|
11
9
|
/**
|
|
12
|
-
* Deploys a Fly app via `fly deploy --remote-only
|
|
13
|
-
*
|
|
14
|
-
* time, not during `pulumi preview`) to `<monorepoRoot>/.fly/<app>.toml`, and
|
|
15
|
-
* its content is added to the redeploy triggers (so config changes redeploy).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* new FlyDeploy("api-deploy", {
|
|
20
|
-
* monorepoRoot,
|
|
21
|
-
* config: { app: "rby-api", primaryRegion: "iad", build: { dockerfile: "apps/api/Dockerfile" } },
|
|
22
|
-
* triggers: [hashDirectory("apps/api"), secrets.version],
|
|
23
|
-
* }, { provider, app, dependsOn: [secrets] });
|
|
24
|
-
* ```
|
|
10
|
+
* Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.
|
|
11
|
+
* Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).
|
|
25
12
|
*/
|
|
26
13
|
var FlyDeploy = class extends _pulumi_pulumi.ComponentResource {
|
|
27
14
|
constructor(name, args, opts) {
|
|
@@ -32,23 +19,26 @@ var FlyDeploy = class extends _pulumi_pulumi.ComponentResource {
|
|
|
32
19
|
const waitTimeout = args.waitTimeout ?? 300;
|
|
33
20
|
const releaseCommandTimeout = args.releaseCommandTimeout ?? 600;
|
|
34
21
|
const highAvailability = args.highAvailability ?? false;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
`printf '%s' "$FLY_TOML_CONTENT" > ${configPath}`,
|
|
38
|
-
`fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`
|
|
39
|
-
].join(" && ");
|
|
22
|
+
const setup = `mkdir -p .fly && printf '%s' "$FLY_TOML_CONTENT" > ${configPath}`;
|
|
23
|
+
const cli = `fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`;
|
|
40
24
|
const triggers = _pulumi_pulumi.output(args.triggers).apply((values) => [...values, tomlContent]);
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
let consumerDeps;
|
|
26
|
+
if (Array.isArray(pulumiOpts.dependsOn)) consumerDeps = pulumiOpts.dependsOn;
|
|
27
|
+
else if (pulumiOpts.dependsOn) consumerDeps = [pulumiOpts.dependsOn];
|
|
28
|
+
else consumerDeps = [];
|
|
29
|
+
require_deploy_command.createDeployCommand({
|
|
30
|
+
name: `${name}-deploy`,
|
|
31
|
+
cli,
|
|
43
32
|
triggers,
|
|
44
|
-
|
|
33
|
+
setup,
|
|
45
34
|
environment: {
|
|
46
35
|
FLY_API_TOKEN: provider.token,
|
|
47
36
|
FLY_TOML_CONTENT: tomlContent
|
|
48
37
|
}
|
|
49
38
|
}, {
|
|
39
|
+
...pulumiOpts,
|
|
50
40
|
parent: this,
|
|
51
|
-
dependsOn: [app]
|
|
41
|
+
dependsOn: [app, ...consumerDeps]
|
|
52
42
|
});
|
|
53
43
|
this.registerOutputs({});
|
|
54
44
|
}
|
package/dist/fly/deploy.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.cjs","names":["pulumi","generateFlyToml"
|
|
1
|
+
{"version":3,"file":"deploy.cjs","names":["pulumi","generateFlyToml"],"sources":["../../src/fly/deploy.ts"],"sourcesContent":["// src/fly/deploy.ts (replace entire file)\nimport * as pulumi from \"@pulumi/pulumi\";\n\nimport { createDeployCommand } from \"../deploy-command\";\nimport type { FlyApp } from \"./app\";\nimport type { FlyProvider } from \"./provider\";\nimport { type FlyTomlConfig, generateFlyToml } from \"./toml\";\n\ntype FlyDeployOptions = Omit<pulumi.ComponentResourceOptions, \"provider\"> & {\n\tprovider: FlyProvider;\n\tapp: FlyApp;\n};\n\nexport interface FlyDeployArgs {\n\t/** fly.toml configuration. `config.app` must equal the FlyApp name. */\n\tconfig: FlyTomlConfig;\n\t/** Redeploy triggers; the generated toml content is appended automatically. */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\t/** `fly deploy --wait-timeout` seconds (default 300). */\n\twaitTimeout?: number;\n\t/** `fly deploy --release-command-timeout` seconds (default 600). */\n\treleaseCommandTimeout?: number;\n\t/** `fly deploy --ha` (default false). */\n\thighAvailability?: boolean;\n}\n\n/**\n * Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.\n * Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).\n */\nexport class FlyDeploy extends pulumi.ComponentResource {\n\tconstructor(name: string, args: FlyDeployArgs, opts: FlyDeployOptions) {\n\t\tconst { provider, app, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:fly:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst tomlContent = generateFlyToml(args.config);\n\t\tconst configPath = `.fly/${args.config.app}.toml`;\n\n\t\tconst waitTimeout = args.waitTimeout ?? 300;\n\t\tconst releaseCommandTimeout = args.releaseCommandTimeout ?? 600;\n\t\tconst highAvailability = args.highAvailability ?? false;\n\n\t\t// The toml content arrives via FLY_TOML_CONTENT (avoids shell escaping).\n\t\tconst setup = `mkdir -p .fly && printf '%s' \"$FLY_TOML_CONTENT\" > ${configPath}`;\n\t\tconst cli = `fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`;\n\n\t\tconst triggers = pulumi\n\t\t\t.output(args.triggers)\n\t\t\t.apply((values) => [...values, tomlContent]);\n\n\t\tlet consumerDeps: pulumi.Resource[];\n\n\t\tif (Array.isArray(pulumiOpts.dependsOn)) {\n\t\t\tconsumerDeps = pulumiOpts.dependsOn as pulumi.Resource[];\n\t\t} else if (pulumiOpts.dependsOn) {\n\t\t\tconsumerDeps = [pulumiOpts.dependsOn as pulumi.Resource];\n\t\t} else {\n\t\t\tconsumerDeps = [];\n\t\t}\n\n\t\tcreateDeployCommand(\n\t\t\t{\n\t\t\t\tname: `${name}-deploy`,\n\t\t\t\tcli,\n\t\t\t\ttriggers,\n\t\t\t\tsetup,\n\t\t\t\tenvironment: {\n\t\t\t\t\tFLY_API_TOKEN: provider.token,\n\t\t\t\t\tFLY_TOML_CONTENT: tomlContent,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ ...pulumiOpts, parent: this, dependsOn: [app, ...consumerDeps] },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAa,YAAb,cAA+BA,eAAO,kBAAkB;CACvD,YAAY,MAAc,MAAqB,MAAwB;EACtE,MAAM,EAAE,UAAU,KAAK,GAAG,eAAe;EAEzC,MAAM,yBAAyB,MAAM,CAAC,GAAG,UAAU;EAEnD,MAAM,cAAcC,iCAAgB,KAAK,MAAM;EAC/C,MAAM,aAAa,QAAQ,KAAK,OAAO,IAAI;EAE3C,MAAM,cAAc,KAAK,eAAe;EACxC,MAAM,wBAAwB,KAAK,yBAAyB;EAC5D,MAAM,mBAAmB,KAAK,oBAAoB;EAGlD,MAAM,QAAQ,sDAAsD;EACpE,MAAM,MAAM,uBAAuB,WAAW,sBAAsB,iBAAiB,kBAAkB,YAAY,6BAA6B;EAEhJ,MAAM,WAAWD,eACf,OAAO,KAAK,QAAQ,EACpB,OAAO,WAAW,CAAC,GAAG,QAAQ,WAAW,CAAC;EAE5C,IAAI;EAEJ,IAAI,MAAM,QAAQ,WAAW,SAAS,GACrC,eAAe,WAAW;OACpB,IAAI,WAAW,WACrB,eAAe,CAAC,WAAW,SAA4B;OAEvD,eAAe,CAAC;EAGjB,2CACC;GACC,MAAM,GAAG,KAAK;GACd;GACA;GACA;GACA,aAAa;IACZ,eAAe,SAAS;IACxB,kBAAkB;GACnB;EACD,GACA;GAAE,GAAG;GAAY,QAAQ;GAAM,WAAW,CAAC,KAAK,GAAG,YAAY;EAAE,CAClE;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|
package/dist/fly/deploy.d.cts
CHANGED
|
@@ -5,51 +5,25 @@ import { FlyTomlConfig } from "./toml.cjs";
|
|
|
5
5
|
import * as pulumi from "@pulumi/pulumi";
|
|
6
6
|
|
|
7
7
|
//#region src/fly/deploy.d.ts
|
|
8
|
-
/** Options type for FlyDeploy. */
|
|
9
8
|
type FlyDeployOptions = Omit<pulumi.ComponentResourceOptions, "provider"> & {
|
|
10
|
-
|
|
9
|
+
provider: FlyProvider;
|
|
11
10
|
app: FlyApp;
|
|
12
11
|
};
|
|
13
|
-
/** Args for FlyDeploy. */
|
|
14
12
|
interface FlyDeployArgs {
|
|
15
|
-
/**
|
|
16
|
-
* Absolute path to the repo root (working directory for `fly deploy`).
|
|
17
|
-
* Stored relative to the Pulumi program directory so the command stays stable
|
|
18
|
-
* across machines and CI (see {@link stableDir}).
|
|
19
|
-
*/
|
|
20
|
-
monorepoRoot: string;
|
|
21
|
-
/**
|
|
22
|
-
* fly.toml configuration. `config.app` must equal the FlyApp name. All values
|
|
23
|
-
* are plain (not `pulumi.Input`) — resolve Outputs before constructing this.
|
|
24
|
-
*/
|
|
13
|
+
/** fly.toml configuration. `config.app` must equal the FlyApp name. */
|
|
25
14
|
config: FlyTomlConfig;
|
|
26
|
-
/**
|
|
27
|
-
* Values that force a redeploy when changed (e.g. a source hash from
|
|
28
|
-
* `hashDirectory()` and `FlySecret.version`). The generated toml content is
|
|
29
|
-
* appended automatically.
|
|
30
|
-
*/
|
|
15
|
+
/** Redeploy triggers; the generated toml content is appended automatically. */
|
|
31
16
|
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
32
|
-
/** `fly deploy --wait-timeout`
|
|
17
|
+
/** `fly deploy --wait-timeout` seconds (default 300). */
|
|
33
18
|
waitTimeout?: number;
|
|
34
|
-
/** `fly deploy --release-command-timeout`
|
|
19
|
+
/** `fly deploy --release-command-timeout` seconds (default 600). */
|
|
35
20
|
releaseCommandTimeout?: number;
|
|
36
21
|
/** `fly deploy --ha` (default false). */
|
|
37
22
|
highAvailability?: boolean;
|
|
38
23
|
}
|
|
39
24
|
/**
|
|
40
|
-
* Deploys a Fly app via `fly deploy --remote-only
|
|
41
|
-
*
|
|
42
|
-
* time, not during `pulumi preview`) to `<monorepoRoot>/.fly/<app>.toml`, and
|
|
43
|
-
* its content is added to the redeploy triggers (so config changes redeploy).
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* new FlyDeploy("api-deploy", {
|
|
48
|
-
* monorepoRoot,
|
|
49
|
-
* config: { app: "rby-api", primaryRegion: "iad", build: { dockerfile: "apps/api/Dockerfile" } },
|
|
50
|
-
* triggers: [hashDirectory("apps/api"), secrets.version],
|
|
51
|
-
* }, { provider, app, dependsOn: [secrets] });
|
|
52
|
-
* ```
|
|
25
|
+
* Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.
|
|
26
|
+
* Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).
|
|
53
27
|
*/
|
|
54
28
|
declare class FlyDeploy extends pulumi.ComponentResource {
|
|
55
29
|
constructor(name: string, args: FlyDeployArgs, opts: FlyDeployOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/fly/deploy.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/fly/deploy.ts"],"mappings":";;;;;;;KAQK,gBAAA,GAAmB,IAAA,CAAK,MAAA,CAAO,wBAAA;EACnC,QAAA,EAAU,WAAA;EACV,GAAA,EAAK,MAAA;AAAA;AAAA,UAGW,aAAA;;EAEhB,MAAA,EAAQ,aAAA;EAPe;EASvB,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAPzB;EASL,WAAA;EATW;EAWX,qBAAA;EAb4B;EAe5B,gBAAA;AAAA;;;;;cAOY,SAAA,SAAkB,MAAA,CAAO,iBAAA;cACzB,IAAA,UAAc,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,gBAAA;AAAA"}
|
package/dist/fly/deploy.d.mts
CHANGED
|
@@ -5,51 +5,25 @@ import { FlyTomlConfig } from "./toml.mjs";
|
|
|
5
5
|
import * as pulumi from "@pulumi/pulumi";
|
|
6
6
|
|
|
7
7
|
//#region src/fly/deploy.d.ts
|
|
8
|
-
/** Options type for FlyDeploy. */
|
|
9
8
|
type FlyDeployOptions = Omit<pulumi.ComponentResourceOptions, "provider"> & {
|
|
10
|
-
|
|
9
|
+
provider: FlyProvider;
|
|
11
10
|
app: FlyApp;
|
|
12
11
|
};
|
|
13
|
-
/** Args for FlyDeploy. */
|
|
14
12
|
interface FlyDeployArgs {
|
|
15
|
-
/**
|
|
16
|
-
* Absolute path to the repo root (working directory for `fly deploy`).
|
|
17
|
-
* Stored relative to the Pulumi program directory so the command stays stable
|
|
18
|
-
* across machines and CI (see {@link stableDir}).
|
|
19
|
-
*/
|
|
20
|
-
monorepoRoot: string;
|
|
21
|
-
/**
|
|
22
|
-
* fly.toml configuration. `config.app` must equal the FlyApp name. All values
|
|
23
|
-
* are plain (not `pulumi.Input`) — resolve Outputs before constructing this.
|
|
24
|
-
*/
|
|
13
|
+
/** fly.toml configuration. `config.app` must equal the FlyApp name. */
|
|
25
14
|
config: FlyTomlConfig;
|
|
26
|
-
/**
|
|
27
|
-
* Values that force a redeploy when changed (e.g. a source hash from
|
|
28
|
-
* `hashDirectory()` and `FlySecret.version`). The generated toml content is
|
|
29
|
-
* appended automatically.
|
|
30
|
-
*/
|
|
15
|
+
/** Redeploy triggers; the generated toml content is appended automatically. */
|
|
31
16
|
triggers: pulumi.Input<pulumi.Input<string>[]>;
|
|
32
|
-
/** `fly deploy --wait-timeout`
|
|
17
|
+
/** `fly deploy --wait-timeout` seconds (default 300). */
|
|
33
18
|
waitTimeout?: number;
|
|
34
|
-
/** `fly deploy --release-command-timeout`
|
|
19
|
+
/** `fly deploy --release-command-timeout` seconds (default 600). */
|
|
35
20
|
releaseCommandTimeout?: number;
|
|
36
21
|
/** `fly deploy --ha` (default false). */
|
|
37
22
|
highAvailability?: boolean;
|
|
38
23
|
}
|
|
39
24
|
/**
|
|
40
|
-
* Deploys a Fly app via `fly deploy --remote-only
|
|
41
|
-
*
|
|
42
|
-
* time, not during `pulumi preview`) to `<monorepoRoot>/.fly/<app>.toml`, and
|
|
43
|
-
* its content is added to the redeploy triggers (so config changes redeploy).
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* new FlyDeploy("api-deploy", {
|
|
48
|
-
* monorepoRoot,
|
|
49
|
-
* config: { app: "rby-api", primaryRegion: "iad", build: { dockerfile: "apps/api/Dockerfile" } },
|
|
50
|
-
* triggers: [hashDirectory("apps/api"), secrets.version],
|
|
51
|
-
* }, { provider, app, dependsOn: [secrets] });
|
|
52
|
-
* ```
|
|
25
|
+
* Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.
|
|
26
|
+
* Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).
|
|
53
27
|
*/
|
|
54
28
|
declare class FlyDeploy extends pulumi.ComponentResource {
|
|
55
29
|
constructor(name: string, args: FlyDeployArgs, opts: FlyDeployOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/fly/deploy.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/fly/deploy.ts"],"mappings":";;;;;;;KAQK,gBAAA,GAAmB,IAAA,CAAK,MAAA,CAAO,wBAAA;EACnC,QAAA,EAAU,WAAA;EACV,GAAA,EAAK,MAAA;AAAA;AAAA,UAGW,aAAA;;EAEhB,MAAA,EAAQ,aAAA;EAPe;EASvB,QAAA,EAAU,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,KAAA;EAPzB;EASL,WAAA;EATW;EAWX,qBAAA;EAb4B;EAe5B,gBAAA;AAAA;;;;;cAOY,SAAA,SAAkB,MAAA,CAAO,iBAAA;cACzB,IAAA,UAAc,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,gBAAA;AAAA"}
|
package/dist/fly/deploy.mjs
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import { t as __name } from "../chunk-OPjESj5l.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { createDeployCommand } from "../deploy-command.mjs";
|
|
3
3
|
import { generateFlyToml } from "./toml.mjs";
|
|
4
|
-
import * as command from "@pulumi/command";
|
|
5
4
|
import * as pulumi from "@pulumi/pulumi";
|
|
6
5
|
|
|
7
6
|
//#region src/fly/deploy.ts
|
|
8
7
|
/**
|
|
9
|
-
* Deploys a Fly app via `fly deploy --remote-only
|
|
10
|
-
*
|
|
11
|
-
* time, not during `pulumi preview`) to `<monorepoRoot>/.fly/<app>.toml`, and
|
|
12
|
-
* its content is added to the redeploy triggers (so config changes redeploy).
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* new FlyDeploy("api-deploy", {
|
|
17
|
-
* monorepoRoot,
|
|
18
|
-
* config: { app: "rby-api", primaryRegion: "iad", build: { dockerfile: "apps/api/Dockerfile" } },
|
|
19
|
-
* triggers: [hashDirectory("apps/api"), secrets.version],
|
|
20
|
-
* }, { provider, app, dependsOn: [secrets] });
|
|
21
|
-
* ```
|
|
8
|
+
* Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.
|
|
9
|
+
* Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).
|
|
22
10
|
*/
|
|
23
11
|
var FlyDeploy = class extends pulumi.ComponentResource {
|
|
24
12
|
constructor(name, args, opts) {
|
|
@@ -29,23 +17,26 @@ var FlyDeploy = class extends pulumi.ComponentResource {
|
|
|
29
17
|
const waitTimeout = args.waitTimeout ?? 300;
|
|
30
18
|
const releaseCommandTimeout = args.releaseCommandTimeout ?? 600;
|
|
31
19
|
const highAvailability = args.highAvailability ?? false;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
`printf '%s' "$FLY_TOML_CONTENT" > ${configPath}`,
|
|
35
|
-
`fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`
|
|
36
|
-
].join(" && ");
|
|
20
|
+
const setup = `mkdir -p .fly && printf '%s' "$FLY_TOML_CONTENT" > ${configPath}`;
|
|
21
|
+
const cli = `fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`;
|
|
37
22
|
const triggers = pulumi.output(args.triggers).apply((values) => [...values, tomlContent]);
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
let consumerDeps;
|
|
24
|
+
if (Array.isArray(pulumiOpts.dependsOn)) consumerDeps = pulumiOpts.dependsOn;
|
|
25
|
+
else if (pulumiOpts.dependsOn) consumerDeps = [pulumiOpts.dependsOn];
|
|
26
|
+
else consumerDeps = [];
|
|
27
|
+
createDeployCommand({
|
|
28
|
+
name: `${name}-deploy`,
|
|
29
|
+
cli,
|
|
40
30
|
triggers,
|
|
41
|
-
|
|
31
|
+
setup,
|
|
42
32
|
environment: {
|
|
43
33
|
FLY_API_TOKEN: provider.token,
|
|
44
34
|
FLY_TOML_CONTENT: tomlContent
|
|
45
35
|
}
|
|
46
36
|
}, {
|
|
37
|
+
...pulumiOpts,
|
|
47
38
|
parent: this,
|
|
48
|
-
dependsOn: [app]
|
|
39
|
+
dependsOn: [app, ...consumerDeps]
|
|
49
40
|
});
|
|
50
41
|
this.registerOutputs({});
|
|
51
42
|
}
|
package/dist/fly/deploy.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/fly/deploy.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/fly/deploy.ts"],"sourcesContent":["// src/fly/deploy.ts (replace entire file)\nimport * as pulumi from \"@pulumi/pulumi\";\n\nimport { createDeployCommand } from \"../deploy-command\";\nimport type { FlyApp } from \"./app\";\nimport type { FlyProvider } from \"./provider\";\nimport { type FlyTomlConfig, generateFlyToml } from \"./toml\";\n\ntype FlyDeployOptions = Omit<pulumi.ComponentResourceOptions, \"provider\"> & {\n\tprovider: FlyProvider;\n\tapp: FlyApp;\n};\n\nexport interface FlyDeployArgs {\n\t/** fly.toml configuration. `config.app` must equal the FlyApp name. */\n\tconfig: FlyTomlConfig;\n\t/** Redeploy triggers; the generated toml content is appended automatically. */\n\ttriggers: pulumi.Input<pulumi.Input<string>[]>;\n\t/** `fly deploy --wait-timeout` seconds (default 300). */\n\twaitTimeout?: number;\n\t/** `fly deploy --release-command-timeout` seconds (default 600). */\n\treleaseCommandTimeout?: number;\n\t/** `fly deploy --ha` (default false). */\n\thighAvailability?: boolean;\n}\n\n/**\n * Deploys a Fly app via `fly deploy --remote-only` from a generated fly.toml.\n * Isolation/git are the seam's job (list a `DeploySandbox`, optionally a `GitGuard`).\n */\nexport class FlyDeploy extends pulumi.ComponentResource {\n\tconstructor(name: string, args: FlyDeployArgs, opts: FlyDeployOptions) {\n\t\tconst { provider, app, ...pulumiOpts } = opts;\n\n\t\tsuper(\"infracraft:fly:Deploy\", name, {}, pulumiOpts);\n\n\t\tconst tomlContent = generateFlyToml(args.config);\n\t\tconst configPath = `.fly/${args.config.app}.toml`;\n\n\t\tconst waitTimeout = args.waitTimeout ?? 300;\n\t\tconst releaseCommandTimeout = args.releaseCommandTimeout ?? 600;\n\t\tconst highAvailability = args.highAvailability ?? false;\n\n\t\t// The toml content arrives via FLY_TOML_CONTENT (avoids shell escaping).\n\t\tconst setup = `mkdir -p .fly && printf '%s' \"$FLY_TOML_CONTENT\" > ${configPath}`;\n\t\tconst cli = `fly deploy --config ${configPath} --remote-only --ha=${highAvailability} --wait-timeout ${waitTimeout} --release-command-timeout ${releaseCommandTimeout}`;\n\n\t\tconst triggers = pulumi\n\t\t\t.output(args.triggers)\n\t\t\t.apply((values) => [...values, tomlContent]);\n\n\t\tlet consumerDeps: pulumi.Resource[];\n\n\t\tif (Array.isArray(pulumiOpts.dependsOn)) {\n\t\t\tconsumerDeps = pulumiOpts.dependsOn as pulumi.Resource[];\n\t\t} else if (pulumiOpts.dependsOn) {\n\t\t\tconsumerDeps = [pulumiOpts.dependsOn as pulumi.Resource];\n\t\t} else {\n\t\t\tconsumerDeps = [];\n\t\t}\n\n\t\tcreateDeployCommand(\n\t\t\t{\n\t\t\t\tname: `${name}-deploy`,\n\t\t\t\tcli,\n\t\t\t\ttriggers,\n\t\t\t\tsetup,\n\t\t\t\tenvironment: {\n\t\t\t\t\tFLY_API_TOKEN: provider.token,\n\t\t\t\t\tFLY_TOML_CONTENT: tomlContent,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ ...pulumiOpts, parent: this, dependsOn: [app, ...consumerDeps] },\n\t\t);\n\n\t\tthis.registerOutputs({});\n\t}\n}\n"],"mappings":";;;;;;;;;;AA8BA,IAAa,YAAb,cAA+B,OAAO,kBAAkB;CACvD,YAAY,MAAc,MAAqB,MAAwB;EACtE,MAAM,EAAE,UAAU,KAAK,GAAG,eAAe;EAEzC,MAAM,yBAAyB,MAAM,CAAC,GAAG,UAAU;EAEnD,MAAM,cAAc,gBAAgB,KAAK,MAAM;EAC/C,MAAM,aAAa,QAAQ,KAAK,OAAO,IAAI;EAE3C,MAAM,cAAc,KAAK,eAAe;EACxC,MAAM,wBAAwB,KAAK,yBAAyB;EAC5D,MAAM,mBAAmB,KAAK,oBAAoB;EAGlD,MAAM,QAAQ,sDAAsD;EACpE,MAAM,MAAM,uBAAuB,WAAW,sBAAsB,iBAAiB,kBAAkB,YAAY,6BAA6B;EAEhJ,MAAM,WAAW,OACf,OAAO,KAAK,QAAQ,EACpB,OAAO,WAAW,CAAC,GAAG,QAAQ,WAAW,CAAC;EAE5C,IAAI;EAEJ,IAAI,MAAM,QAAQ,WAAW,SAAS,GACrC,eAAe,WAAW;OACpB,IAAI,WAAW,WACrB,eAAe,CAAC,WAAW,SAA4B;OAEvD,eAAe,CAAC;EAGjB,oBACC;GACC,MAAM,GAAG,KAAK;GACd;GACA;GACA;GACA,aAAa;IACZ,eAAe,SAAS;IACxB,kBAAkB;GACnB;EACD,GACA;GAAE,GAAG;GAAY,QAAQ;GAAM,WAAW,CAAC,KAAK,GAAG,YAAY;EAAE,CAClE;EAEA,KAAK,gBAAgB,CAAC,CAAC;CACxB;AACD"}
|