@deployfoundation/foundation-deploy 0.2.48 → 0.2.49
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/bin/app.js +2 -2
- package/dist/bin/foundation-deploy.js +21 -1
- package/dist/bin/release-account.js +5 -0
- package/dist/{chunk-z4gsy5kh.js → chunk-6f2hkamj.js} +1 -1
- package/dist/{chunk-2tachxjf.js → chunk-gnz747z2.js} +1 -1
- package/dist/src/index.js +2 -2
- package/package.json +1 -1
- package/src/deploy/cli.ts +25 -1
- package/src/stacks/release-account-stack.ts +7 -0
package/dist/bin/app.js
CHANGED
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
FoundationPages,
|
|
9
9
|
FoundationPipeline,
|
|
10
10
|
NewsletterStack
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-6f2hkamj.js";
|
|
12
12
|
import {
|
|
13
13
|
adminsFor,
|
|
14
14
|
instanceNames,
|
|
15
15
|
loadInstanceFile,
|
|
16
16
|
provisionsIntegration
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-gnz747z2.js";
|
|
18
18
|
import"../chunk-dz91avrb.js";
|
|
19
19
|
|
|
20
20
|
// bin/app.ts
|
|
@@ -22,12 +22,15 @@ import {
|
|
|
22
22
|
slackCommandPrefix,
|
|
23
23
|
verifyManifest,
|
|
24
24
|
versionedConfigKey
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-gnz747z2.js";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_RELEASE_BUCKET,
|
|
28
28
|
expectedKeyArn
|
|
29
29
|
} from "../chunk-dz91avrb.js";
|
|
30
30
|
|
|
31
|
+
// src/deploy/cli.ts
|
|
32
|
+
import { readFileSync as readFileSync10 } from "node:fs";
|
|
33
|
+
|
|
31
34
|
// src/deploy/aws.ts
|
|
32
35
|
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
33
36
|
import { tmpdir } from "node:os";
|
|
@@ -2560,6 +2563,7 @@ Done. Now say \`@${ctx.instance.displayName} hello\` in Slack.`);
|
|
|
2560
2563
|
|
|
2561
2564
|
// src/deploy/cli.ts
|
|
2562
2565
|
var COMMANDS = [
|
|
2566
|
+
"check",
|
|
2563
2567
|
"deploy",
|
|
2564
2568
|
"post-deploy",
|
|
2565
2569
|
"config:sync",
|
|
@@ -2572,6 +2576,10 @@ var COMMANDS = [
|
|
|
2572
2576
|
var USAGE = `usage: foundation-deploy <command> --instance <path> [options]
|
|
2573
2577
|
|
|
2574
2578
|
commands
|
|
2579
|
+
check parse the instance and config files with THIS release's
|
|
2580
|
+
schema; no AWS. Run it on config PRs with the pinned
|
|
2581
|
+
version: a config the deployed release rejects puts the
|
|
2582
|
+
teammate on the fallback config.
|
|
2575
2583
|
deploy build and push the agent image, cdk deploy --all, refresh
|
|
2576
2584
|
the runtime secret, sync config
|
|
2577
2585
|
post-deploy smoke DEFAULT, probe the mount, promote \`live\`, smoke \`live\`
|
|
@@ -2650,6 +2658,18 @@ async function main(argv2 = process.argv.slice(2)) {
|
|
|
2650
2658
|
${USAGE}`);
|
|
2651
2659
|
return 1;
|
|
2652
2660
|
}
|
|
2661
|
+
if (command === "check") {
|
|
2662
|
+
const paths = loadInstanceContext(resolveInstanceFilePath(args, process.env));
|
|
2663
|
+
try {
|
|
2664
|
+
parseInstanceConfig(readFileSync10(paths.configPath, "utf8"));
|
|
2665
|
+
} catch (error) {
|
|
2666
|
+
console.error(`${paths.configPath} does not parse with this release (v${toolVersion()}):
|
|
2667
|
+
${error instanceof Error ? error.message : String(error)}`);
|
|
2668
|
+
return 1;
|
|
2669
|
+
}
|
|
2670
|
+
console.log(`${paths.configPath} parses with this release (v${toolVersion()})`);
|
|
2671
|
+
return 0;
|
|
2672
|
+
}
|
|
2653
2673
|
if (command === "slack-manifest") {
|
|
2654
2674
|
const paths = loadInstanceContext(resolveInstanceFilePath(args, process.env));
|
|
2655
2675
|
if (process.env.EVENTS_REQUEST_URL === undefined)
|
|
@@ -111,6 +111,11 @@ class ReleaseAccountStack extends cdk.Stack {
|
|
|
111
111
|
actions: ["ecr:GetAuthorizationToken"],
|
|
112
112
|
resources: ["*"]
|
|
113
113
|
}),
|
|
114
|
+
new iam.PolicyStatement({
|
|
115
|
+
sid: "EcrPublicLogin",
|
|
116
|
+
actions: ["ecr-public:GetAuthorizationToken", "sts:GetServiceBearerToken"],
|
|
117
|
+
resources: ["*"]
|
|
118
|
+
}),
|
|
114
119
|
new iam.PolicyStatement({
|
|
115
120
|
sid: "SignManifest",
|
|
116
121
|
actions: ["kms:Sign", "kms:GetPublicKey", "kms:DescribeKey"],
|
|
@@ -1975,4 +1975,4 @@ function ecrRepositoryArn(repositoryUri) {
|
|
|
1975
1975
|
return `arn:aws:ecr:${region}:${account}:repository/${name}`;
|
|
1976
1976
|
}
|
|
1977
1977
|
|
|
1978
|
-
export { parseSchedule, BASE_SLACK_EVENTS, CAPABILITY_IDS, requiredGithubPermissions, requiredSlackScopes, requiredSlackCommands,
|
|
1978
|
+
export { parseSchedule, BASE_SLACK_EVENTS, CAPABILITY_IDS, requiredGithubPermissions, requiredSlackScopes, requiredSlackCommands, isScheduledJob, isWebhookJob, webhookJobBindings, scheduledJobBindings, jobWebhookKey, capabilityScheduledJobs, crmOutreachConfigured, crmPolicyFingerprint, parseInstanceConfig, encodeProactiveChannels, CUSTOMIZATION_ARTIFACT_NAME, newsletterManifestFor, FOUNDATION_VERSION_RE, versionedConfigKey, instanceNames, slackCommandPrefix, slackCommandPrefixes, loadInstanceFile, configPathFor, capabilityEnabled, requiresAuthenticatedQueue, enabledIntegrations, provisionsIntegration, adminsFor, WEB_SEARCH_TARGET, WEB_SEARCH_CONNECTOR_VERSION, LIVE_ENDPOINT_NAME, RELEASE_VERSION_RE, parseManifest, manifestKey, lambdaKey, skillsKey, buildManifest, manifestSigningPayload, verifyManifest, lambdaBundleContext, BUN_VERSION, LAMBDA_ENTRY_POINTS, skipBundle, RELEASE_BUCKET_ENV, RELEASE_DIR_ENV, releaseCacheDir, releaseSource, releaseAccess, lambdaCode, agentImage, agentImageTagRequired, releaseImageRepositoryArn, ecrRepositoryArn };
|
package/dist/src/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
FoundationPipeline,
|
|
11
11
|
NewsletterStack,
|
|
12
12
|
deployStatements
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-6f2hkamj.js";
|
|
14
14
|
import {
|
|
15
15
|
BUN_VERSION,
|
|
16
16
|
LAMBDA_ENTRY_POINTS,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
skillsKey,
|
|
45
45
|
skipBundle,
|
|
46
46
|
verifyManifest
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-gnz747z2.js";
|
|
48
48
|
import"../chunk-dz91avrb.js";
|
|
49
49
|
export {
|
|
50
50
|
BUILD_TIMEOUT,
|
package/package.json
CHANGED
package/src/deploy/cli.ts
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* tree into a deploy would make every release of the tool carry a model
|
|
12
12
|
* runtime it never executes.
|
|
13
13
|
*/
|
|
14
|
+
import { readFileSync } from "node:fs";
|
|
15
|
+
import { parseInstanceConfig } from "@deployfoundation/foundation-core";
|
|
14
16
|
import { type AwsContext, awsContext } from "./aws.ts";
|
|
15
17
|
import { configSync } from "./config-sync.ts";
|
|
16
18
|
import { deploy } from "./deploy.ts";
|
|
@@ -18,12 +20,13 @@ import { githubAppCreate } from "./github-app-create.ts";
|
|
|
18
20
|
import { instanceBanner, loadInstanceContext, resolveInstanceFilePath } from "./instance.ts";
|
|
19
21
|
import { jobKey } from "./job-key.ts";
|
|
20
22
|
import { postDeploy } from "./post-deploy.ts";
|
|
21
|
-
import { releaseRequest, resolveRelease } from "./release.ts";
|
|
23
|
+
import { releaseRequest, resolveRelease, toolVersion } from "./release.ts";
|
|
22
24
|
import { setup } from "./setup.ts";
|
|
23
25
|
import { slackManifestFor } from "./slack-manifest.ts";
|
|
24
26
|
import { stageCustomization } from "./stage-customization.ts";
|
|
25
27
|
|
|
26
28
|
export const COMMANDS = [
|
|
29
|
+
"check",
|
|
27
30
|
"deploy",
|
|
28
31
|
"post-deploy",
|
|
29
32
|
"config:sync",
|
|
@@ -39,6 +42,10 @@ export type Command = (typeof COMMANDS)[number];
|
|
|
39
42
|
export const USAGE = `usage: foundation-deploy <command> --instance <path> [options]
|
|
40
43
|
|
|
41
44
|
commands
|
|
45
|
+
check parse the instance and config files with THIS release's
|
|
46
|
+
schema; no AWS. Run it on config PRs with the pinned
|
|
47
|
+
version: a config the deployed release rejects puts the
|
|
48
|
+
teammate on the fallback config.
|
|
42
49
|
deploy build and push the agent image, cdk deploy --all, refresh
|
|
43
50
|
the runtime secret, sync config
|
|
44
51
|
post-deploy smoke DEFAULT, probe the mount, promote \`live\`, smoke \`live\`
|
|
@@ -120,6 +127,23 @@ export async function main(argv: readonly string[] = process.argv.slice(2)): Pro
|
|
|
120
127
|
return 1;
|
|
121
128
|
}
|
|
122
129
|
|
|
130
|
+
// `check` reads files only, so it runs in a pull request with no credentials.
|
|
131
|
+
if (command === "check") {
|
|
132
|
+
const paths = loadInstanceContext(resolveInstanceFilePath(args, process.env));
|
|
133
|
+
try {
|
|
134
|
+
parseInstanceConfig(readFileSync(paths.configPath, "utf8"));
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.error(
|
|
137
|
+
`${paths.configPath} does not parse with this release (v${toolVersion()}):\n${
|
|
138
|
+
error instanceof Error ? error.message : String(error)
|
|
139
|
+
}`,
|
|
140
|
+
);
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
console.log(`${paths.configPath} parses with this release (v${toolVersion()})`);
|
|
144
|
+
return 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
123
147
|
// `slack-manifest` writes a machine-readable document to stdout and must not
|
|
124
148
|
// print a banner into it; every other command announces its target first.
|
|
125
149
|
if (command === "slack-manifest") {
|
|
@@ -208,6 +208,13 @@ export class ReleaseAccountStack extends cdk.Stack {
|
|
|
208
208
|
actions: ["ecr:GetAuthorizationToken"],
|
|
209
209
|
resources: ["*"],
|
|
210
210
|
}),
|
|
211
|
+
// Pull-only login to public ECR. Anonymous base-image pulls share
|
|
212
|
+
// the hosted runners' quota and failed v0.2.48's build with 429.
|
|
213
|
+
new iam.PolicyStatement({
|
|
214
|
+
sid: "EcrPublicLogin",
|
|
215
|
+
actions: ["ecr-public:GetAuthorizationToken", "sts:GetServiceBearerToken"],
|
|
216
|
+
resources: ["*"],
|
|
217
|
+
}),
|
|
211
218
|
new iam.PolicyStatement({
|
|
212
219
|
sid: "SignManifest",
|
|
213
220
|
actions: ["kms:Sign", "kms:GetPublicKey", "kms:DescribeKey"],
|