File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
packages/wrangler/src/triggers Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " wrangler " : minor
3+ ---
4+
5+ Adds ` wrangler triggers deploy --force-subdomain-deploy ` flag.
6+
7+ Wrangler will sometimes skip the API call if the config file matches
8+ the remote state. However, we need to be able to force it in some
9+ cases.
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ type Props = {
3030 legacyEnv : boolean | undefined ;
3131 dryRun : boolean | undefined ;
3232 assetsOptions : AssetsOptions | undefined ;
33+ forceSubdomainDeploy ?: boolean ;
3334} ;
3435
3536export default async function triggersDeploy (
@@ -90,7 +91,8 @@ export default async function triggersDeploy(
9091 envName ,
9192 workerUrl ,
9293 routes ,
93- deployments
94+ deployments ,
95+ props . forceSubdomainDeploy ?? false
9496 ) ;
9597
9698 if ( ! wantWorkersDev && workersDevInSync && routes . length !== 0 ) {
@@ -315,7 +317,8 @@ async function subdomainDeploy(
315317 envName : string ,
316318 workerUrl : string ,
317319 routes : Route [ ] ,
318- deployments : Array < Promise < string [ ] > >
320+ deployments : Array < Promise < string [ ] > > ,
321+ forceSubdomainDeploy : boolean
319322) {
320323 const { config } = props ;
321324
@@ -375,7 +378,7 @@ async function subdomainDeploy(
375378
376379 // Update subdomain enablement status if needed.
377380
378- if ( ! allInSync ) {
381+ if ( ! allInSync || forceSubdomainDeploy ) {
379382 await fetchResult ( config , `${ workerUrl } /subdomain` , {
380383 method : "POST" ,
381384 body : JSON . stringify ( {
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ export const triggersDeployCommand = createCommand({
4848 describe : "Use legacy environments" ,
4949 hidden : true ,
5050 } ,
51+ "force-subdomain-deploy" : {
52+ type : "boolean" ,
53+ describe :
54+ "Force deployment of subdomain triggers, even if the they are in sync." ,
55+ } ,
5156 } ,
5257 behaviour : {
5358 warnIfMultipleEnvsConfiguredButNoneSpecified : true ,
@@ -74,6 +79,7 @@ export const triggersDeployCommand = createCommand({
7479 legacyEnv : isLegacyEnv ( config ) ,
7580 dryRun : args . dryRun ,
7681 assetsOptions,
82+ forceSubdomainDeploy : args . forceSubdomainDeploy ,
7783 } ) ;
7884 } ,
7985} ) ;
You can’t perform that action at this time.
0 commit comments