Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import * as AuthTarget from "./auth";
import { prepareFrameworks } from "../frameworks";
import { Context as HostingContext } from "./hosting/context";
import { Context as FunctionsContext } from "./functions/args";
import { addPinnedFunctionsToOnlyString, hasPinnedFunctions } from "./hosting/prepare";
import { isRunningInGithubAction } from "../utils";
import { TARGET_PERMISSIONS } from "../commands/deploy";
Expand Down Expand Up @@ -48,9 +49,9 @@

export type DeployOptions = Options & { dryRun?: boolean };

type Chain = ((context: any, options: any, payload: any) => Promise<unknown>)[];

Check warning on line 52 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 52 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 52 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

const chain = async function (fns: Chain, context: any, options: any, payload: any): Promise<void> {

Check warning on line 54 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 54 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 54 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
for (const latest of fns) {
await latest(context, options, payload);
}
Expand Down Expand Up @@ -89,7 +90,7 @@
* number of deploy targets. This allows deploys to be done all together or
* for individual deployable elements to be deployed as such.
*/
export const deploy = async function (

Check warning on line 93 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
targetNames: (keyof typeof TARGETS)[],
options: DeployOptions,
customContext = {},
Expand Down Expand Up @@ -198,11 +199,24 @@

const deployedHosting = includes(targetNames, "hosting");
logger.info(bold("Project Console:"), consoleUrl(options.project ?? "_", "/overview"));

// TODO: Remove this temporary Cloud Run link once Dart support lands in the Firebase Console.
const fContext = context as FunctionsContext;
const hasDartFunctions = Object.values(fContext.codebaseDeployEvents ?? {}).some(
(e) => e.runtime && typeof e.runtime === "string" && e.runtime.startsWith("dart"),
);
if (hasDartFunctions && projectId) {
logger.info(
bold("Cloud Run services:"),
`https://console.cloud.google.com/run/services?project=${projectId}`,
);
}

if (deployedHosting) {
each(context.hosting?.deploys, (deploy) => {
logger.info(bold("Hosting URL:"), addSubdomain(hostingOrigin(), deploy.config.site));
});
const versionNames = context.hosting?.deploys.map((deploy: any) => deploy.version);

Check warning on line 219 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe return of an `any` typed value

Check warning on line 219 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .version on an `any` value

Check warning on line 219 in src/deploy/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
return { hosting: versionNames?.length === 1 ? versionNames[0] : versionNames };
} else {
return { hosting: undefined };
Expand Down
Loading