firebase-tools 15.28.2 → 15.28.3-feat-firebase-debug-path.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/lib/api.js +4 -2
- package/lib/apphosting/config.js +10 -8
- package/lib/apphosting/localbuilds.js +8 -0
- package/lib/apphosting/yaml.js +27 -0
- package/lib/bin/cli.js +4 -1
- package/lib/bin/mcp.js +8 -3
- package/lib/commands/ext-export.js +34 -13
- package/lib/commands/ext-migrate.js +3 -0
- package/lib/commands/functions-delete.js +6 -67
- package/lib/commands/functions-kits-install.js +3 -0
- package/lib/commands/functions-kits-uninstall.js +5 -71
- package/lib/crashlytics/onboarding.js +23 -2
- package/lib/deploy/apphosting/deploy.js +2 -1
- package/lib/deploy/apphosting/prepare.js +12 -3
- package/lib/deploy/apphosting/release.js +3 -0
- package/lib/deploy/apphosting/util.js +3 -1
- package/lib/deploy/extensions/secrets.js +10 -0
- package/lib/deploy/functions/delete.js +80 -0
- package/lib/emulator/types.js +3 -1
- package/lib/extensions/askUserForParam.js +9 -8
- package/lib/extensions/export.js +46 -9
- package/lib/extensions/extensionsHelper.js +28 -0
- package/lib/extensions/migrate.js +121 -2
- package/lib/extensions/paramHelper.js +78 -25
- package/lib/extensions/secretsUtils.js +3 -0
- package/lib/extensions/updateHelper.js +3 -1
- package/lib/functions/kits/install.js +238 -68
- package/lib/gcp/apikeys.js +89 -0
- package/lib/gcp/storage.js +3 -2
- package/lib/logger.js +83 -9
- package/lib/mcp/tools/apphosting/fetch_logs.js +1 -0
- package/lib/mcp/tools/apphosting/list_backends.js +1 -0
- package/lib/mcp/tools/apptesting/tests.js +2 -0
- package/lib/mcp/tools/auth/get_users.js +1 -0
- package/lib/mcp/tools/auth/set_sms_region_policy.js +1 -0
- package/lib/mcp/tools/auth/update_user.js +1 -0
- package/lib/mcp/tools/core/create_android_sha.js +1 -0
- package/lib/mcp/tools/core/create_app.js +1 -0
- package/lib/mcp/tools/core/create_project.js +1 -0
- package/lib/mcp/tools/core/deploy.js +1 -0
- package/lib/mcp/tools/core/deploy_status.js +1 -0
- package/lib/mcp/tools/core/get_environment.js +1 -0
- package/lib/mcp/tools/core/get_project.js +1 -0
- package/lib/mcp/tools/core/get_sdk_config.js +1 -0
- package/lib/mcp/tools/core/get_security_rules.js +1 -0
- package/lib/mcp/tools/core/init.js +1 -0
- package/lib/mcp/tools/core/list_apps.js +1 -0
- package/lib/mcp/tools/core/list_projects.js +1 -0
- package/lib/mcp/tools/core/login.js +1 -0
- package/lib/mcp/tools/core/logout.js +1 -0
- package/lib/mcp/tools/core/read_resources.js +1 -0
- package/lib/mcp/tools/core/update_environment.js +1 -0
- package/lib/mcp/tools/core/validate_security_rules.js +1 -0
- package/lib/mcp/tools/crashlytics/events.js +2 -0
- package/lib/mcp/tools/crashlytics/issues.js +2 -0
- package/lib/mcp/tools/crashlytics/notes.js +3 -0
- package/lib/mcp/tools/crashlytics/reports.js +1 -0
- package/lib/mcp/tools/dataconnect/compile.js +1 -0
- package/lib/mcp/tools/dataconnect/execute.js +1 -0
- package/lib/mcp/tools/dataconnect/list_services.js +1 -0
- package/lib/mcp/tools/firestore/query_collection.js +1 -0
- package/lib/mcp/tools/functions/get_logs.js +1 -0
- package/lib/mcp/tools/functions/list_functions.js +1 -0
- package/lib/mcp/tools/index.js +3 -1
- package/lib/mcp/tools/messaging/send_message.js +1 -0
- package/lib/mcp/tools/realtime_database/get_data.js +1 -0
- package/lib/mcp/tools/realtime_database/set_data.js +1 -0
- package/lib/mcp/tools/remoteconfig/get_template.js +1 -0
- package/lib/mcp/tools/remoteconfig/update_template.js +1 -0
- package/lib/mcp/tools/storage/get_download_url.js +1 -0
- package/lib/prompt.js +10 -1
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/templates/init/functions/typescript/index-kit-migration.ts +20 -2
package/lib/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.developerKnowledgeOrigin = exports.cloudTestingOrigin = exports.appTestingOrigin = exports.aiLogicProxyOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.studioApiOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = exports.storageOrigin = void 0;
|
|
3
|
+
exports.rulesOrigin = exports.resourceManagerOrigin = exports.firebaseTelemetryAdminOrigin = exports.firebaseTelemetryOrigin = exports.crashlyticsApiOrigin = exports.messagingApiOrigin = exports.remoteConfigApiOrigin = exports.rtdbMetadataOrigin = exports.rtdbManagementOrigin = exports.realtimeOrigin = exports.extensionsTOSOrigin = exports.extensionsPublisherOrigin = exports.extensionsOrigin = exports.iamOrigin = exports.identityOrigin = exports.hostingOrigin = exports.googleOrigin = exports.pubsubOrigin = exports.cloudTasksOrigin = exports.cloudschedulerOrigin = exports.cloudbuildOrigin = exports.functionsDefaultRegion = exports.runOrigin = exports.functionsV2Origin = exports.functionsOrigin = exports.firestoreOrigin = exports.firestoreOriginOrEmulator = exports.firedataOrigin = exports.firebaseExtensionsRegistryOrigin = exports.firebaseApiOrigin = exports.eventarcOrigin = exports.consoleOrigin = exports.authManagementOrigin = exports.authOrigin = exports.apphostingGitHubAppInstallationURL = exports.apphostingP4SADomain = exports.apphostingOrigin = exports.appDistributionOrigin = exports.appCheckOrigin = exports.apiKeysOrigin = exports.artifactRegistryDomain = exports.developerConnectP4SADomain = exports.developerConnectOrigin = exports.containerRegistryDomain = exports.cloudMonitoringOrigin = exports.cloudloggingOrigin = exports.cloudbillingOrigin = exports.clientSecret = exports.clientId = exports.authProxyOrigin = void 0;
|
|
4
|
+
exports.developerKnowledgeOrigin = exports.cloudTestingOrigin = exports.appTestingOrigin = exports.aiLogicProxyOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.studioApiOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = exports.storageOrigin = exports.runtimeconfigOrigin = void 0;
|
|
5
5
|
exports.getScopes = getScopes;
|
|
6
6
|
exports.setScopes = setScopes;
|
|
7
7
|
const constants_1 = require("./emulator/constants");
|
|
@@ -29,6 +29,8 @@ const developerConnectP4SADomain = () => utils.envOverride("DEVELOPERCONNECT_P4S
|
|
|
29
29
|
exports.developerConnectP4SADomain = developerConnectP4SADomain;
|
|
30
30
|
const artifactRegistryDomain = () => utils.envOverride("ARTIFACT_REGISTRY_DOMAIN", "https://artifactregistry.googleapis.com");
|
|
31
31
|
exports.artifactRegistryDomain = artifactRegistryDomain;
|
|
32
|
+
const apiKeysOrigin = () => utils.envOverride("CLOUD_APIKEYS_URL", "https://apikeys.googleapis.com");
|
|
33
|
+
exports.apiKeysOrigin = apiKeysOrigin;
|
|
32
34
|
const appCheckOrigin = () => utils.envOverride("FIREBASE_APPCHECK_URL", "https://firebaseappcheck.googleapis.com");
|
|
33
35
|
exports.appCheckOrigin = appCheckOrigin;
|
|
34
36
|
const appDistributionOrigin = () => utils.envOverride("FIREBASE_APP_DISTRIBUTION_URL", "https://firebaseappdistribution.googleapis.com");
|
package/lib/apphosting/config.js
CHANGED
|
@@ -67,7 +67,7 @@ function load(yamlPath) {
|
|
|
67
67
|
return yaml.parseDocument(raw);
|
|
68
68
|
}
|
|
69
69
|
const dynamicDispatch = exports;
|
|
70
|
-
async function getAppHostingConfiguration(backendDir) {
|
|
70
|
+
async function getAppHostingConfiguration(backendDir, includeLocalConfigs = true) {
|
|
71
71
|
const appHostingConfigPaths = dynamicDispatch.listAppHostingFilesInPath(backendDir);
|
|
72
72
|
const fileNameToPathMap = Object.fromEntries(appHostingConfigPaths.map((path) => [(0, path_1.basename)(path), path]));
|
|
73
73
|
const output = yaml_1.AppHostingYamlConfig.empty();
|
|
@@ -78,13 +78,15 @@ async function getAppHostingConfiguration(backendDir) {
|
|
|
78
78
|
const baseFile = await yaml_1.AppHostingYamlConfig.loadFromFile(baseFilePath);
|
|
79
79
|
output.merge(baseFile, false);
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
if (includeLocalConfigs) {
|
|
82
|
+
if (emulatorsFilePath) {
|
|
83
|
+
const emulatorsConfig = await yaml_1.AppHostingYamlConfig.loadFromFile(emulatorsFilePath);
|
|
84
|
+
output.merge(emulatorsConfig, false);
|
|
85
|
+
}
|
|
86
|
+
if (localFilePath) {
|
|
87
|
+
const localYamlConfig = await yaml_1.AppHostingYamlConfig.loadFromFile(localFilePath);
|
|
88
|
+
output.merge(localYamlConfig, true);
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
return output;
|
|
90
92
|
}
|
|
@@ -114,6 +114,14 @@ async function localBuild(projectId, projectRoot, env = {}, options) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
const addedEnv = await toProcessEnv(projectId, env);
|
|
117
|
+
if (options?.rootDir) {
|
|
118
|
+
const normalizedRootDir = options.rootDir.replace(/\\/g, "/");
|
|
119
|
+
const root = path.resolve(projectRoot);
|
|
120
|
+
const appDir = path.resolve(path.join(projectRoot, normalizedRootDir));
|
|
121
|
+
if (appDir !== root) {
|
|
122
|
+
addedEnv.GOOGLE_BUILDABLE = path.relative(root, appDir).replace(/\\/g, "/");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
117
125
|
const apphostingBuildOutput = await runUniversalMaker(projectRoot, addedEnv);
|
|
118
126
|
const discoveredEnv = apphostingBuildOutput.runConfig.environmentVariables?.map(({ variable, value, availability }) => ({
|
|
119
127
|
variable,
|
package/lib/apphosting/yaml.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppHostingYamlConfig = void 0;
|
|
4
4
|
exports.toEnvMap = toEnvMap;
|
|
5
5
|
exports.toEnvList = toEnvList;
|
|
6
|
+
exports.toApiRunConfig = toApiRunConfig;
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
8
9
|
const config_1 = require("./config");
|
|
@@ -26,6 +27,9 @@ class AppHostingYamlConfig {
|
|
|
26
27
|
if (loadedAppHostingYaml.env) {
|
|
27
28
|
config.env = toEnvMap(loadedAppHostingYaml.env);
|
|
28
29
|
}
|
|
30
|
+
if (loadedAppHostingYaml.runConfig) {
|
|
31
|
+
config.runConfig = loadedAppHostingYaml.runConfig;
|
|
32
|
+
}
|
|
29
33
|
return config;
|
|
30
34
|
}
|
|
31
35
|
static empty() {
|
|
@@ -44,6 +48,12 @@ class AppHostingYamlConfig {
|
|
|
44
48
|
...this.env,
|
|
45
49
|
...other.env,
|
|
46
50
|
};
|
|
51
|
+
if (other.runConfig) {
|
|
52
|
+
this.runConfig = {
|
|
53
|
+
...this.runConfig,
|
|
54
|
+
...other.runConfig,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
47
57
|
}
|
|
48
58
|
async upsertFile(filePath) {
|
|
49
59
|
let yamlConfigToWrite = {};
|
|
@@ -52,6 +62,9 @@ class AppHostingYamlConfig {
|
|
|
52
62
|
yamlConfigToWrite = await (0, utils_1.wrappedSafeLoad)(file.source);
|
|
53
63
|
}
|
|
54
64
|
yamlConfigToWrite.env = toEnvList(this.env);
|
|
65
|
+
if (this.runConfig) {
|
|
66
|
+
yamlConfigToWrite.runConfig = this.runConfig;
|
|
67
|
+
}
|
|
55
68
|
(0, config_1.store)(filePath, yaml.parseDocument(jsYaml.dump(yamlConfigToWrite)));
|
|
56
69
|
}
|
|
57
70
|
}
|
|
@@ -67,3 +80,17 @@ function toEnvList(envs) {
|
|
|
67
80
|
return { ...env, variable };
|
|
68
81
|
});
|
|
69
82
|
}
|
|
83
|
+
function toApiRunConfig(runConfig) {
|
|
84
|
+
if (!runConfig) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const { memoryMiB, ...rest } = runConfig;
|
|
88
|
+
const apiConfig = {
|
|
89
|
+
...rest,
|
|
90
|
+
...(memoryMiB !== undefined ? { memoryMib: memoryMiB } : {}),
|
|
91
|
+
};
|
|
92
|
+
if (Object.keys(apiConfig).length === 0) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
return apiConfig;
|
|
96
|
+
}
|
package/lib/bin/cli.js
CHANGED
|
@@ -82,7 +82,10 @@ function cli(pkg) {
|
|
|
82
82
|
help = "Having trouble? Try " + clc.bold("firebase [command] --help");
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
|
|
85
|
+
const logFileDisplay = process.env.FIREBASE_DEBUG_PATH?.trim()
|
|
86
|
+
? logFilename
|
|
87
|
+
: "firebase-debug.log";
|
|
88
|
+
help = `Having trouble? Try again or contact support with contents of ${logFileDisplay}`;
|
|
86
89
|
}
|
|
87
90
|
if (cmd) {
|
|
88
91
|
console.log();
|
package/lib/bin/mcp.js
CHANGED
|
@@ -92,9 +92,14 @@ async function mcp() {
|
|
|
92
92
|
process.exit(1);
|
|
93
93
|
}
|
|
94
94
|
(0, env_1.setFirebaseMcp)(true);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (process.env.FIREBASE_DEBUG_PATH?.trim()) {
|
|
96
|
+
(0, logger_1.useFileLogger)();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const mcpLogDir = (0, path_1.join)((0, os_1.homedir)(), ".cache", "firebase");
|
|
100
|
+
await (0, promises_1.mkdir)(mcpLogDir, { recursive: true });
|
|
101
|
+
(0, logger_1.useFileLogger)((0, path_1.join)(mcpLogDir, "firebase-debug.log"));
|
|
102
|
+
}
|
|
98
103
|
const activeFeatures = (values.only || "")
|
|
99
104
|
.split(",")
|
|
100
105
|
.map((f) => f.trim())
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
+
exports.handleSecretEjection = handleSecretEjection;
|
|
4
5
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
5
6
|
const command_1 = require("../command");
|
|
6
7
|
const planner = require("../deploy/extensions/planner");
|
|
@@ -20,11 +21,9 @@ const utils_1 = require("../utils");
|
|
|
20
21
|
const env_1 = require("../functions/env");
|
|
21
22
|
const fs_1 = require("fs");
|
|
22
23
|
const path_1 = require("path");
|
|
23
|
-
const utils_2 = require("../utils");
|
|
24
24
|
const config_1 = require("../config");
|
|
25
25
|
const projectConfig_1 = require("../functions/projectConfig");
|
|
26
26
|
const error_1 = require("../error");
|
|
27
|
-
const clc = require("colorette");
|
|
28
27
|
const experiments = require("../experiments");
|
|
29
28
|
exports.command = new command_1.Command("ext:export")
|
|
30
29
|
.description("export Extension instances installed on a project to a local Firebase directory")
|
|
@@ -113,34 +112,56 @@ async function fnHandler(options) {
|
|
|
113
112
|
if (instanceId !== options.instance) {
|
|
114
113
|
return;
|
|
115
114
|
}
|
|
115
|
+
await handleSecretEjection(options, instance);
|
|
116
116
|
const convertedEnv = (0, export_1.functionsEnvFromInstance)(instance);
|
|
117
|
-
const secretCount = Object.keys(convertedEnv).filter((key) => key.startsWith("FIREBASE_SECRET_REF_")).length;
|
|
118
117
|
const writeLocation = kitExportTarget(instanceId, projectId, options);
|
|
119
118
|
if ((0, env_1.hasUserEnvs)(writeLocation)) {
|
|
120
119
|
logger_1.logger.info(`Exported extensions config appears to already exist in /${instanceId}, aborting write.`);
|
|
121
120
|
}
|
|
122
121
|
else {
|
|
123
|
-
(0,
|
|
124
|
-
`Saving exported extensions config as a Function Kits .env file`);
|
|
122
|
+
(0, utils_1.logLabeledBullet)("functions", `Saving exported extensions config as a Function Kits .env file`);
|
|
125
123
|
(0, fs_1.mkdirSync)((0, path_1.resolve)(writeLocation.projectDir, writeLocation.configDir ?? instanceId), {
|
|
126
124
|
recursive: true,
|
|
127
125
|
});
|
|
128
126
|
(0, env_1.writeUserEnvs)(convertedEnv, writeLocation);
|
|
129
127
|
}
|
|
130
|
-
|
|
128
|
+
}
|
|
129
|
+
async function handleSecretEjection(options, instance) {
|
|
130
|
+
const secrets = await (0, export_1.secretsNeedingEjection)(instance);
|
|
131
|
+
if (secrets.length === 0) {
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
(0, utils_1.logLabeledBullet)("functions", "Cloud Secret Manager resources still require migration from Extensions lifecycle management to Kits.");
|
|
135
|
+
(0, utils_1.logLabeledWarning)("functions", "Finishing the Extension migration process with extensions:uninstall without migrating bound secrets will result in permanent loss of secrets.");
|
|
136
|
+
const userAllowedEjection = await (0, prompt_1.confirm)({
|
|
137
|
+
message: `Automatically migrate ${secrets.length} Secrets from Extensions to Kits? (Y/n)`,
|
|
135
138
|
nonInteractive: options.nonInteractive,
|
|
136
139
|
force: options.force,
|
|
137
140
|
default: true,
|
|
138
|
-
})
|
|
139
|
-
|
|
141
|
+
});
|
|
142
|
+
if (userAllowedEjection) {
|
|
143
|
+
const results = await (0, export_1.ejectSecretsFromInstance)(instance);
|
|
144
|
+
if (results.fail.length > 0) {
|
|
145
|
+
let resultMsg = "";
|
|
146
|
+
if (results.success.length > 0) {
|
|
147
|
+
resultMsg = `Added functions-managed label to secrets: ${results.success}.`;
|
|
148
|
+
}
|
|
149
|
+
resultMsg += `${results.fail.length} secrets failed to update: ${results.fail}`;
|
|
150
|
+
(0, utils_1.logLabeledError)("functions", resultMsg);
|
|
151
|
+
if (!options.force) {
|
|
152
|
+
throw new error_1.FirebaseError("Secret migration failed.");
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
(0, utils_1.logLabeledWarning)("functions", "Proceeding after secret migration failure in --force mode. Manually remove the 'firebase-extensions-managed' label from the secrets, or risk permanent data loss.");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
(0, utils_1.logLabeledBullet)("functions", `Added functions-managed label to secrets: ${results.success}.`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
(0, utils_1.logLabeledError)("functions", "Proceeding without migrating secrets risks permanent data loss. Manually remove the 'firebase-extensions-managed' label from the secrets before running ext:uninstall.");
|
|
140
164
|
}
|
|
141
|
-
const secretsChanged = await (0, export_1.ejectSecretsFromInstance)(instance);
|
|
142
|
-
(0, utils_2.logBullet)(clc.cyan(clc.bold("functions: ")) +
|
|
143
|
-
`Added functions-managed label to secrets: ${secretsChanged}`);
|
|
144
165
|
}
|
|
145
166
|
function kitExportTarget(instanceId, projectId, options) {
|
|
146
167
|
const firebaseConfig = config_1.Config.load(options, true);
|
|
@@ -16,6 +16,7 @@ exports.command = new command_1.Command("ext:migrate")
|
|
|
16
16
|
.option("-p, --package <package>", "optional kit package override to use")
|
|
17
17
|
.option("-i, --ext-instance <instanceId>", "extension instance ID to migrate")
|
|
18
18
|
.option("-e, --extension <extensionRef>", "extension reference or name to migrate")
|
|
19
|
+
.option("-f, --force", "force update and migration without prompting")
|
|
19
20
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
20
21
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
21
22
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
@@ -29,8 +30,10 @@ exports.command = new command_1.Command("ext:migrate")
|
|
|
29
30
|
extInstance: options.extInstance,
|
|
30
31
|
extension: options.extension,
|
|
31
32
|
nonInteractive: options.nonInteractive,
|
|
33
|
+
force: options.force,
|
|
32
34
|
});
|
|
33
35
|
(0, utils_1.logLabeledBullet)(extensionsHelper_1.logPrefix, `Selected instance ${clc.bold(plan.instanceId)} (${plan.kitPackage}) for migration.`);
|
|
36
|
+
plan.instance = await (0, migrate_1.ensureInstanceUpToDate)(projectId, plan.instance, options);
|
|
34
37
|
logger_1.logger.info("TODO: Draw the rest of the owl");
|
|
35
38
|
return plan;
|
|
36
39
|
});
|
|
@@ -2,22 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const functionsConfig = require("../functionsConfig");
|
|
6
5
|
const command_1 = require("../command");
|
|
7
|
-
const error_1 = require("../error");
|
|
8
6
|
const projectUtils_1 = require("../projectUtils");
|
|
9
|
-
const prompt_1 = require("../prompt");
|
|
10
|
-
const functional_1 = require("../functional");
|
|
11
7
|
const requirePermissions_1 = require("../requirePermissions");
|
|
12
8
|
const helper = require("../deploy/functions/functionsDeployHelper");
|
|
13
9
|
const utils = require("../utils");
|
|
14
10
|
const backend = require("../deploy/functions/backend");
|
|
15
11
|
const projectConfig = require("../functions/projectConfig");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const executor = require("../deploy/functions/release/executor");
|
|
19
|
-
const reporter = require("../deploy/functions/release/reporter");
|
|
20
|
-
const getProjectNumber_1 = require("../getProjectNumber");
|
|
12
|
+
const delete_1 = require("../deploy/functions/delete");
|
|
13
|
+
const error_1 = require("../error");
|
|
21
14
|
exports.command = new command_1.Command("functions:delete [filters...]")
|
|
22
15
|
.description("delete one or more Cloud Functions by name, group name, or codebase.")
|
|
23
16
|
.option("--region <region>", "Specify region of the function to be deleted. " +
|
|
@@ -32,13 +25,8 @@ exports.command = new command_1.Command("functions:delete [filters...]")
|
|
|
32
25
|
projectId: (0, projectUtils_1.needProjectId)(options),
|
|
33
26
|
filters: [],
|
|
34
27
|
};
|
|
35
|
-
|
|
36
|
-
functionsConfig.getFirebaseConfig(options),
|
|
37
|
-
backend.existingBackend(context),
|
|
38
|
-
]);
|
|
39
|
-
let existingBackend = letExistingBackend;
|
|
28
|
+
let existingBackend = await backend.existingBackend(context);
|
|
40
29
|
await backend.checkAvailability(context, backend.empty());
|
|
41
|
-
const appEngineLocation = functionsConfig.getAppEngineLocation(firebaseConfig);
|
|
42
30
|
if (options.region) {
|
|
43
31
|
existingBackend = backend.matchingBackend(existingBackend, (ep) => ep.region === options.region);
|
|
44
32
|
}
|
|
@@ -48,63 +36,14 @@ exports.command = new command_1.Command("functions:delete [filters...]")
|
|
|
48
36
|
.map((ep) => ep.codebase || projectConfig.DEFAULT_CODEBASE)),
|
|
49
37
|
];
|
|
50
38
|
context.filters = helper.parseDeleteFilters(filters, activeCodebases);
|
|
51
|
-
const plan = await planner.createDeploymentPlan({
|
|
52
|
-
wantBackend: backend.empty(),
|
|
53
|
-
haveBackend: existingBackend,
|
|
54
|
-
codebase: "",
|
|
55
|
-
projectId: context.projectId,
|
|
56
|
-
filters: context.filters,
|
|
57
|
-
deleteAll: true,
|
|
58
|
-
});
|
|
59
|
-
const allEpToDelete = Object.values(plan.regionalChangesets)
|
|
60
|
-
.map((changes) => changes.endpointsToDelete)
|
|
61
|
-
.reduce(functional_1.reduceFlat, [])
|
|
62
|
-
.sort(backend.compareFunctions);
|
|
63
|
-
if (allEpToDelete.length === 0) {
|
|
64
|
-
throw new error_1.FirebaseError(`The specified filters do not match any existing functions in project ${clc.bold(context.projectId)}.`);
|
|
65
|
-
}
|
|
66
39
|
const allEndpoints = backend.allEndpoints(existingBackend);
|
|
67
40
|
const collisions = helper.detectCodebaseAndIdCollisions(filters, activeCodebases, allEndpoints, projectConfig.DEFAULT_CODEBASE);
|
|
68
41
|
for (const c of collisions) {
|
|
69
42
|
utils.logLabeledBullet("functions", `Target '${clc.bold(c.filter)}' matches both a codebase and a function (${c.functionLabel}). Codebase deletion takes precedence. ` +
|
|
70
43
|
`(To delete the function instead, run: ${clc.bold(c.workaroundCommand)})`);
|
|
71
44
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
deleteList +
|
|
76
|
-
"\n Are you sure?",
|
|
77
|
-
default: false,
|
|
78
|
-
force: options.force,
|
|
79
|
-
nonInteractive: options.nonInteractive,
|
|
80
|
-
});
|
|
81
|
-
if (!confirmDeletion) {
|
|
82
|
-
throw new error_1.FirebaseError("Command aborted.");
|
|
83
|
-
}
|
|
84
|
-
const functionExecutor = new executor.QueueExecutor({
|
|
85
|
-
retries: 30,
|
|
86
|
-
backoff: 20000,
|
|
87
|
-
concurrency: 40,
|
|
88
|
-
maxBackoff: 40000,
|
|
89
|
-
});
|
|
90
|
-
try {
|
|
91
|
-
const fab = new fabricator.Fabricator({
|
|
92
|
-
functionExecutor,
|
|
93
|
-
runFunctionExecutor: functionExecutor,
|
|
94
|
-
appEngineLocation,
|
|
95
|
-
executor: new executor.QueueExecutor({}),
|
|
96
|
-
sources: {},
|
|
97
|
-
projectNumber: options.projectNumber || (await (0, getProjectNumber_1.getProjectNumber)({ projectId: context.projectId })),
|
|
98
|
-
projectId: context.projectId,
|
|
99
|
-
});
|
|
100
|
-
const summary = await fab.applyPlan({ default: plan });
|
|
101
|
-
await reporter.logAndTrackDeployStats(summary);
|
|
102
|
-
reporter.printErrors(summary);
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
throw new error_1.FirebaseError("Failed to delete functions", {
|
|
106
|
-
original: err,
|
|
107
|
-
exit: 1,
|
|
108
|
-
});
|
|
45
|
+
const deletionCount = await (0, delete_1.deleteFunctionsByEndpointFilters)(context, options);
|
|
46
|
+
if (deletionCount === 0) {
|
|
47
|
+
throw new error_1.FirebaseError(`The specified filters do not match any existing functions in project ${clc.bold(context.projectId)}.`);
|
|
109
48
|
}
|
|
110
49
|
});
|
|
@@ -10,6 +10,7 @@ exports.command = new command_1.Command("functions:kits:install")
|
|
|
10
10
|
.option("--package <package>", "NPM package name or specifier to install as a function kit")
|
|
11
11
|
.option("--directory <directory>", "path to a local functions codebase directory to install as a function kit")
|
|
12
12
|
.option(`--template <template>`, `template to use for the kit index file (${Object.keys(install_1.TEMPLATES).join("|")})`)
|
|
13
|
+
.option("--no-configure", "skip parameter prompting and configuration during installation")
|
|
13
14
|
.action(async (options) => {
|
|
14
15
|
experiments.assertEnabled("kits", "install a function kit");
|
|
15
16
|
if (!options.config) {
|
|
@@ -30,6 +31,8 @@ exports.command = new command_1.Command("functions:kits:install")
|
|
|
30
31
|
directory: options.directory,
|
|
31
32
|
template: options.template,
|
|
32
33
|
nonInteractive: options.nonInteractive,
|
|
34
|
+
force: options.force,
|
|
35
|
+
configure: options.configure,
|
|
33
36
|
project: options.project,
|
|
34
37
|
projectId: options.projectId,
|
|
35
38
|
rc: options.rc,
|
|
@@ -7,19 +7,11 @@ const config_1 = require("../functions/kits/config");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const error_1 = require("../error");
|
|
9
9
|
const prompt_1 = require("../prompt");
|
|
10
|
-
const functional_1 = require("../functional");
|
|
11
10
|
const posix_1 = require("path/posix");
|
|
12
11
|
const projectUtils_1 = require("../projectUtils");
|
|
13
12
|
const utils_1 = require("../utils");
|
|
14
|
-
const backend = require("../deploy/functions/backend");
|
|
15
|
-
const planner = require("../deploy/functions/release/planner");
|
|
16
|
-
const executor = require("../deploy/functions/release/executor");
|
|
17
|
-
const fabricator = require("../deploy/functions/release/fabricator");
|
|
18
|
-
const functionsDeployHelper_1 = require("../deploy/functions/functionsDeployHelper");
|
|
19
|
-
const functionsConfig = require("../functionsConfig");
|
|
20
|
-
const getProjectNumber_1 = require("../getProjectNumber");
|
|
21
|
-
const reporter = require("../deploy/functions/release/reporter");
|
|
22
13
|
const logger_1 = require("../logger");
|
|
14
|
+
const delete_1 = require("../deploy/functions/delete");
|
|
23
15
|
exports.command = new command_1.Command("functions:kits:uninstall")
|
|
24
16
|
.description("uninstall a function kit or kit instance from your project")
|
|
25
17
|
.before(requireConfig_1.requireConfig)
|
|
@@ -142,68 +134,10 @@ async function uninstallInstance(options, config, instanceId, instanceConfigDirP
|
|
|
142
134
|
}
|
|
143
135
|
async function uninstallProjectInstance(options, config, projectId, instanceId, kitInstancePath) {
|
|
144
136
|
const envFilePath = (0, path_1.join)(kitInstancePath, `.env.${projectId}`);
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const haveBackend = await backend.existingBackend(context);
|
|
150
|
-
const plan = await planner.createDeploymentPlan({
|
|
151
|
-
wantBackend: backend.empty(),
|
|
152
|
-
haveBackend: haveBackend,
|
|
153
|
-
codebase: "",
|
|
154
|
-
projectId: context.projectId,
|
|
155
|
-
filters: context.filters,
|
|
156
|
-
deleteAll: true,
|
|
157
|
-
});
|
|
158
|
-
const allEpToDelete = Object.values(plan.regionalChangesets)
|
|
159
|
-
.map((changes) => changes.endpointsToDelete)
|
|
160
|
-
.reduce(functional_1.reduceFlat, [])
|
|
161
|
-
.sort(backend.compareFunctions);
|
|
162
|
-
if (allEpToDelete.length > 0) {
|
|
163
|
-
const deleteList = allEpToDelete.map((func) => `\t${(0, functionsDeployHelper_1.getFunctionLabel)(func)}`).join("\n");
|
|
164
|
-
const confirmDeletion = await (0, prompt_1.confirm)({
|
|
165
|
-
message: "You are about to delete the following Cloud Functions:\n" +
|
|
166
|
-
deleteList +
|
|
167
|
-
"\n Are you sure?",
|
|
168
|
-
default: false,
|
|
169
|
-
force: options.force,
|
|
170
|
-
nonInteractive: options.nonInteractive,
|
|
171
|
-
});
|
|
172
|
-
if (!confirmDeletion) {
|
|
173
|
-
throw new error_1.FirebaseError("Command aborted.");
|
|
174
|
-
}
|
|
175
|
-
const functionExecutor = new executor.QueueExecutor({
|
|
176
|
-
retries: 30,
|
|
177
|
-
backoff: 20000,
|
|
178
|
-
concurrency: 40,
|
|
179
|
-
maxBackoff: 40000,
|
|
180
|
-
});
|
|
181
|
-
const appEngineLocation = functionsConfig.getAppEngineLocation(config);
|
|
182
|
-
try {
|
|
183
|
-
const fab = new fabricator.Fabricator({
|
|
184
|
-
functionExecutor,
|
|
185
|
-
runFunctionExecutor: functionExecutor,
|
|
186
|
-
appEngineLocation,
|
|
187
|
-
executor: new executor.QueueExecutor({}),
|
|
188
|
-
sources: {},
|
|
189
|
-
projectNumber: await (0, getProjectNumber_1.getProjectNumber)({ projectId: context.projectId }),
|
|
190
|
-
projectId: context.projectId,
|
|
191
|
-
});
|
|
192
|
-
const summary = await fab.applyPlan({ default: plan });
|
|
193
|
-
await reporter.logAndTrackDeployStats(summary);
|
|
194
|
-
reporter.printErrors(summary);
|
|
195
|
-
if (summary.results.some((r) => r.error)) {
|
|
196
|
-
throw new error_1.FirebaseError("Some functions deletions failed. Not modifying firebase.json.");
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
catch (err) {
|
|
200
|
-
throw new error_1.FirebaseError("Failed to delete functions", {
|
|
201
|
-
original: err,
|
|
202
|
-
exit: 1,
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
137
|
+
const epFilters = [{ codebase: instanceId }];
|
|
138
|
+
const deployContext = { projectId: projectId, filters: epFilters };
|
|
139
|
+
const deletionCount = await (0, delete_1.deleteFunctionsByEndpointFilters)(deployContext, options);
|
|
140
|
+
if (deletionCount === 0) {
|
|
207
141
|
logger_1.logger.info(`No deployed functions found for instance ${instanceId}. This is normal if firebase deploy was never run.`);
|
|
208
142
|
}
|
|
209
143
|
config.deleteProjectFile(envFilePath);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CRASHLYTICS_TELEMETRY_RESOURCE_TYPE = exports.CRASHLYTICS_TELEMETRY_SINK_ID = exports.CRASHLYTICS_TELEMETRY_BUCKET_ID = void 0;
|
|
3
|
+
exports.CRASHLYTICS_TELEMETRY_SERVICE = exports.CRASHLYTICS_TELEMETRY_RESOURCE_TYPE = exports.CRASHLYTICS_TELEMETRY_SINK_ID = exports.CRASHLYTICS_TELEMETRY_BUCKET_ID = void 0;
|
|
4
4
|
exports.onboardCrashlyticsWeb = onboardCrashlyticsWeb;
|
|
5
5
|
const ensureApiEnabled_1 = require("../ensureApiEnabled");
|
|
6
6
|
const error_1 = require("../error");
|
|
@@ -8,9 +8,12 @@ const cloudbilling_1 = require("../gcp/cloudbilling");
|
|
|
8
8
|
const cloudlogging_1 = require("../gcp/cloudlogging");
|
|
9
9
|
const firebasetelemetry_1 = require("./firebasetelemetry");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
|
+
const apikeys_1 = require("../gcp/apikeys");
|
|
12
|
+
const apps_1 = require("../management/apps");
|
|
11
13
|
exports.CRASHLYTICS_TELEMETRY_BUCKET_ID = "firebase-telemetry";
|
|
12
14
|
exports.CRASHLYTICS_TELEMETRY_SINK_ID = "firebase-telemetry-routing";
|
|
13
15
|
exports.CRASHLYTICS_TELEMETRY_RESOURCE_TYPE = "firebasetelemetry.googleapis.com/App";
|
|
16
|
+
exports.CRASHLYTICS_TELEMETRY_SERVICE = "firebasetelemetry.googleapis.com";
|
|
14
17
|
async function onboardCrashlyticsWeb(projectId, appId, options = {}) {
|
|
15
18
|
const billingEnabled = await (0, cloudbilling_1.checkBillingEnabled)(projectId);
|
|
16
19
|
if (!billingEnabled && options.nonInteractive) {
|
|
@@ -22,10 +25,28 @@ async function onboardCrashlyticsWeb(projectId, appId, options = {}) {
|
|
|
22
25
|
}
|
|
23
26
|
(0, utils_1.logLabeledBullet)("crashlytics", "Enabling required telemetry APIs...");
|
|
24
27
|
await Promise.all([
|
|
25
|
-
(0, ensureApiEnabled_1.ensure)(projectId,
|
|
28
|
+
(0, ensureApiEnabled_1.ensure)(projectId, exports.CRASHLYTICS_TELEMETRY_SERVICE, "crashlytics", false),
|
|
26
29
|
(0, ensureApiEnabled_1.ensure)(projectId, "firebasetelemetryadmin.googleapis.com", "crashlytics", false),
|
|
27
30
|
]);
|
|
28
31
|
(0, utils_1.logLabeledSuccess)("crashlytics", "Telemetry APIs enabled.");
|
|
32
|
+
const appConfig = await (0, apps_1.getAppConfig)(appId, apps_1.AppPlatform.WEB);
|
|
33
|
+
if ("apiKey" in appConfig && appConfig.apiKey) {
|
|
34
|
+
(0, utils_1.logLabeledBullet)("crashlytics", "Ensuring Crashlytics Telemetry API is permitted in API key restrictions...");
|
|
35
|
+
try {
|
|
36
|
+
await (0, apikeys_1.updateAppApiKeyRestriction)({
|
|
37
|
+
apiKey: appConfig.apiKey,
|
|
38
|
+
service: exports.CRASHLYTICS_TELEMETRY_SERVICE,
|
|
39
|
+
});
|
|
40
|
+
(0, utils_1.logLabeledSuccess)("crashlytics", "API key restrictions updated for Crashlytics Telemetry.");
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
(0, utils_1.logLabeledWarning)("crashlytics", err instanceof Error ? err.message : String(err));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
(0, utils_1.logLabeledWarning)("crashlytics", `No API key found for this app. If you configure an API key later, ` +
|
|
48
|
+
`please rerun this command or manually add '${exports.CRASHLYTICS_TELEMETRY_SERVICE}' to its allowed APIs in the Google Cloud Console if the key is restricted.`);
|
|
49
|
+
}
|
|
29
50
|
(0, utils_1.logLabeledBullet)("crashlytics", `Setting up Cloud Logging bucket '${exports.CRASHLYTICS_TELEMETRY_BUCKET_ID}'...`);
|
|
30
51
|
const bucket = await (0, cloudlogging_1.createOrUpdateLogBucket)(projectId, exports.CRASHLYTICS_TELEMETRY_BUCKET_ID, "global", true);
|
|
31
52
|
(0, utils_1.logLabeledSuccess)("crashlytics", "Cloud Logging bucket configured.");
|
|
@@ -11,6 +11,7 @@ const utils_1 = require("../../utils");
|
|
|
11
11
|
const util = require("./util");
|
|
12
12
|
const experiments = require("../../experiments");
|
|
13
13
|
const logger_1 = require("../../logger");
|
|
14
|
+
const constants_1 = require("../../apphosting/constants");
|
|
14
15
|
async function default_1(context, options) {
|
|
15
16
|
if (Object.entries(context.backendConfigs).length === 0) {
|
|
16
17
|
return;
|
|
@@ -79,7 +80,7 @@ async function default_1(context, options) {
|
|
|
79
80
|
const { bucket, object } = await gcs.uploadObject({
|
|
80
81
|
file: zippedSourcePath,
|
|
81
82
|
stream: fs.createReadStream(zippedSourcePath),
|
|
82
|
-
}, bucketName, isLocalBuild ? gcs.ContentType.TAR : gcs.ContentType.ZIP);
|
|
83
|
+
}, bucketName, isLocalBuild ? gcs.ContentType.TAR : gcs.ContentType.ZIP, isLocalBuild ? constants_1.CLOUD_RUN_SIZE_LIMIT_BYTES : undefined);
|
|
83
84
|
(0, utils_1.logLabeledBullet)("apphosting", `Uploaded at gs://${bucket}/${object}`);
|
|
84
85
|
context.backendStorageUris[cfg.backendId] =
|
|
85
86
|
`gs://${bucketName}/${path.basename(zippedSourcePath)}`;
|
|
@@ -130,6 +130,7 @@ async function default_1(context, options) {
|
|
|
130
130
|
}
|
|
131
131
|
const buildEnv = {};
|
|
132
132
|
const runtimeEnv = {};
|
|
133
|
+
const runConfigs = {};
|
|
133
134
|
for (const cfg of Object.values(context.backendConfigs)) {
|
|
134
135
|
if (!cfg.localBuild) {
|
|
135
136
|
continue;
|
|
@@ -154,7 +155,7 @@ async function default_1(context, options) {
|
|
|
154
155
|
const appDir = path.join(rootDir, cfg.rootDir || "");
|
|
155
156
|
(0, localbuilds_1.validateLocalBuildNodeVersion)(backend, appDir);
|
|
156
157
|
(0, utils_1.logLabeledBullet)("apphosting", `Starting local build for backend ${cfg.backendId}`);
|
|
157
|
-
await injectEnvVarsFromApphostingConfig(configs.filter((c) => c.backendId === cfg.backendId), options, buildEnv, runtimeEnv);
|
|
158
|
+
await injectEnvVarsFromApphostingConfig(configs.filter((c) => c.backendId === cfg.backendId), options, buildEnv, runtimeEnv, runConfigs);
|
|
158
159
|
await injectAutoInitEnvVars(cfg, backends, buildEnv, runtimeEnv);
|
|
159
160
|
const location = context.backendLocations[cfg.backendId];
|
|
160
161
|
await injectAngularEnvVars(cfg, rootDir, projectId, location, buildEnv, runtimeEnv);
|
|
@@ -165,6 +166,7 @@ async function default_1(context, options) {
|
|
|
165
166
|
const { outputFiles, buildConfig } = await (0, localbuilds_1.localBuild)(projectId, localBuildScratchDir, buildEnv[cfg.backendId] || {}, {
|
|
166
167
|
nonInteractive: options.nonInteractive,
|
|
167
168
|
allowLocalBuildSecrets: !!options.allowLocalBuildSecrets,
|
|
169
|
+
rootDir: cfg.rootDir,
|
|
168
170
|
});
|
|
169
171
|
context.backendLocalBuilds[cfg.backendId] = {
|
|
170
172
|
outputFiles,
|
|
@@ -172,6 +174,7 @@ async function default_1(context, options) {
|
|
|
172
174
|
buildConfig: {
|
|
173
175
|
...buildConfig,
|
|
174
176
|
env: mergeEnvVars(buildConfig.env || [], runtimeEnv[cfg.backendId] || {}),
|
|
177
|
+
...(runConfigs[cfg.backendId] ? { runConfig: runConfigs[cfg.backendId] } : {}),
|
|
175
178
|
},
|
|
176
179
|
};
|
|
177
180
|
}
|
|
@@ -181,13 +184,13 @@ async function default_1(context, options) {
|
|
|
181
184
|
}
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
|
-
async function injectEnvVarsFromApphostingConfig(configs, options, buildEnv, runtimeEnv) {
|
|
187
|
+
async function injectEnvVarsFromApphostingConfig(configs, options, buildEnv, runtimeEnv, runConfigs) {
|
|
185
188
|
for (const cfg of configs) {
|
|
186
189
|
const rootDir = options.projectRoot || process.cwd();
|
|
187
190
|
const appDir = path.join(rootDir, cfg.rootDir || "");
|
|
188
191
|
let yamlConfig = yaml_1.AppHostingYamlConfig.empty();
|
|
189
192
|
try {
|
|
190
|
-
yamlConfig = await (0, config_1.getAppHostingConfiguration)(appDir);
|
|
193
|
+
yamlConfig = await (0, config_1.getAppHostingConfiguration)(appDir, false);
|
|
191
194
|
}
|
|
192
195
|
catch (e) {
|
|
193
196
|
(0, utils_1.logLabeledWarning)("apphosting", `Failed to read apphosting.yaml, may be missing environment variables and other configs`);
|
|
@@ -195,6 +198,12 @@ async function injectEnvVarsFromApphostingConfig(configs, options, buildEnv, run
|
|
|
195
198
|
const { build, runtime } = (0, config_1.splitEnvVars)(yamlConfig.env);
|
|
196
199
|
buildEnv[cfg.backendId] = { ...buildEnv[cfg.backendId], ...build };
|
|
197
200
|
runtimeEnv[cfg.backendId] = { ...runtimeEnv[cfg.backendId], ...runtime };
|
|
201
|
+
if (runConfigs && yamlConfig.runConfig) {
|
|
202
|
+
const apiRunConfig = (0, yaml_1.toApiRunConfig)(yamlConfig.runConfig);
|
|
203
|
+
if (apiRunConfig) {
|
|
204
|
+
runConfigs[cfg.backendId] = { ...runConfigs[cfg.backendId], ...apiRunConfig };
|
|
205
|
+
}
|
|
206
|
+
}
|
|
198
207
|
}
|
|
199
208
|
}
|
|
200
209
|
async function injectAutoInitEnvVars(cfg, backends, buildEnv, runtimeEnv) {
|
|
@@ -30,6 +30,9 @@ async function default_1(context, options) {
|
|
|
30
30
|
rootDirectory,
|
|
31
31
|
runCommand: localBuild.buildConfig?.runCommand,
|
|
32
32
|
env: localBuild.buildConfig?.env,
|
|
33
|
+
...(localBuild.buildConfig?.runConfig
|
|
34
|
+
? { runConfig: localBuild.buildConfig.runConfig }
|
|
35
|
+
: {}),
|
|
33
36
|
},
|
|
34
37
|
}
|
|
35
38
|
: {
|
|
@@ -30,7 +30,9 @@ async function createLocalBuildTarArchive(config, rootDir, outputFiles, sizeLimi
|
|
|
30
30
|
ignoreStrings: ["firebase-debug.log", "firebase-debug.*.log"],
|
|
31
31
|
supportGitIgnore: false,
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
for (const rdrf of rdrFiles) {
|
|
34
|
+
allFiles.push(path.relative(rootDir, rdrf.name));
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
37
|
else {
|
|
36
38
|
allFiles.push(path.relative(rootDir, absolutePath));
|