@@ -40,25 +40,31 @@ const configEntries = Object.entries(AWS_RENDER_CONFIGS);
4040
4141console . log ( `\nDeploying ${ configEntries . length } Lambda function(s)...\n` ) ;
4242
43- // Deploy Lambda function for each configuration
43+ // Deploy Lambda function for each configuration (failures don't block site deployment)
44+ const functionFailures = [ ] ;
4445for ( const [ configKey , config ] of configEntries ) {
4546 console . log ( `[${ configKey } ] Deploying Lambda function...` ) ;
4647 console . log (
4748 ` Memory: ${ config . memory } MB, Disk: ${ config . disk } MB, Timeout: ${ config . timeout } s` ,
4849 ) ;
4950
50- const { functionName, alreadyExisted : functionAlreadyExisted } =
51- await deployFunction ( {
52- createCloudWatchLogGroup : true ,
53- memorySizeInMb : config . memory ,
54- region : region ,
55- timeoutInSeconds : config . timeout ,
56- diskSizeInMb : config . disk ,
57- } ) ;
51+ try {
52+ const { functionName, alreadyExisted : functionAlreadyExisted } =
53+ await deployFunction ( {
54+ createCloudWatchLogGroup : true ,
55+ memorySizeInMb : config . memory ,
56+ region : region ,
57+ timeoutInSeconds : config . timeout ,
58+ diskSizeInMb : config . disk ,
59+ } ) ;
5860
59- console . log (
60- ` ✓ ${ functionName } ${ functionAlreadyExisted ? '(already existed)' : '(created)' } \n` ,
61- ) ;
61+ console . log (
62+ ` ✓ ${ functionName } ${ functionAlreadyExisted ? '(already existed)' : '(created)' } \n` ,
63+ ) ;
64+ } catch ( err ) {
65+ console . log ( ` ✗ Failed: ${ err . message } \n` ) ;
66+ functionFailures . push ( { configKey, error : err } ) ;
67+ }
6268}
6369
6470// Ensure bucket (shared across all configs)
@@ -86,14 +92,27 @@ console.log(siteName);
8692
8793console . log ( ) ;
8894console . log ( '✓ Deployment complete!' ) ;
89- console . log (
90- `✓ Deployed ${ configEntries . length } Lambda function(s) for all configurations:` ,
91- ) ;
92- configEntries . forEach ( ( [ key , config ] ) => {
95+ if ( functionFailures . length > 0 ) {
9396 console . log (
94- ` - ${ key } : ${ config . memory } MB RAM, ${ config . disk } MB disk, ${ config . timeout } s timeout ` ,
97+ `⚠ ${ configEntries . length - functionFailures . length } / ${ configEntries . length } Lambda function(s) deployed ( ${ functionFailures . length } failed): ` ,
9598 ) ;
96- } ) ;
99+ configEntries . forEach ( ( [ key , config ] ) => {
100+ const failed = functionFailures . find ( ( f ) => f . configKey === key ) ;
101+ const status = failed ? '✗ FAILED' : '✓' ;
102+ console . log (
103+ ` - ${ key } : ${ config . memory } MB RAM, ${ config . disk } MB disk, ${ config . timeout } s timeout [${ status } ]` ,
104+ ) ;
105+ } ) ;
106+ } else {
107+ console . log (
108+ `✓ Deployed ${ configEntries . length } Lambda function(s) for all configurations:` ,
109+ ) ;
110+ configEntries . forEach ( ( [ key , config ] ) => {
111+ console . log (
112+ ` - ${ key } : ${ config . memory } MB RAM, ${ config . disk } MB disk, ${ config . timeout } s timeout` ,
113+ ) ;
114+ } ) ;
115+ }
97116console . log ( ) ;
98117console . log ( 'You now have everything you need to render videos!' ) ;
99118console . log ( 'Re-run this command when:' ) ;
0 commit comments