Skip to content

Commit 92305af

Browse files
authored
Reorder deploy output when deploying a container worker (#9516)
Reorder the deploy output when using a container worker so that: * We can fail to trigger the new worker if the container build or deploy fails * The url for the worker is at the bottom of the output instead of the top
1 parent b609bc2 commit 92305af

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/rich-bottles-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Reorder deploy output when deploying a container worker so the worker url is printed last and the worker triggers aren't deployed until the container has been built and deployed successfully.

packages/wrangler/src/__tests__/deploy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8893,9 +8893,9 @@ addEventListener('fetch', event => {});`
88938893
env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object
88948894
88958895
Uploaded test-name (TIMINGS)
8896+
Building image my-container:Galaxy
88968897
Deployed test-name triggers (TIMINGS)
88978898
https://test-name.test-sub-domain.workers.dev
8898-
Building image my-container:Galaxy
88998899
Current Version ID: Galaxy-Class"
89008900
`);
89018901
expect(std.err).toMatchInlineSnapshot(`""`);

packages/wrangler/src/deploy/deploy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,6 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
10071007
return { versionId, workerTag };
10081008
}
10091009

1010-
// deploy triggers
1011-
const targets = await triggersDeploy(props);
1012-
10131010
if (config.containers) {
10141011
assert(versionId && accountId);
10151012
await deployContainers(config, {
@@ -1021,6 +1018,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
10211018
});
10221019
}
10231020

1021+
// deploy triggers
1022+
const targets = await triggersDeploy(props);
1023+
10241024
logger.log("Current Version ID:", versionId);
10251025

10261026
return {

0 commit comments

Comments
 (0)