@@ -234,22 +234,28 @@ const hiveConfigSecret = new ServiceSecret('hive-config-secret', {
234234 usageAccessToken : hiveConfig . requireSecret ( 'cliAccessToken' ) ,
235235} ) ;
236236
237- const publishGraphQLSchemaCommand = publishGraphQLSchema ( {
238- graphql,
239- registry : {
240- endpoint : `https://${ environment . appDns } /registry` ,
241- accessToken : hiveConfigSecret . raw . usageAccessToken ,
242- target : hiveConfig . require ( 'target' ) ,
243- } ,
244- version : {
245- commit : imagesTag ,
246- } ,
247- schemaPath : graphqlSchemaAbsolutePath ,
248- } ) ;
237+ // You can change this to `false` in cases when you don't want to publish commands.
238+ // For example, if the entire env is down or if you are having SSL issues.
239+ const RUN_PUBLISH_COMMANDS : boolean = true ;
240+
241+ const publishGraphQLSchemaCommand = RUN_PUBLISH_COMMANDS
242+ ? publishGraphQLSchema ( {
243+ graphql,
244+ registry : {
245+ endpoint : `https://${ environment . appDns } /registry` ,
246+ accessToken : hiveConfigSecret . raw . usageAccessToken ,
247+ target : hiveConfig . require ( 'target' ) ,
248+ } ,
249+ version : {
250+ commit : imagesTag ,
251+ } ,
252+ schemaPath : graphqlSchemaAbsolutePath ,
253+ } )
254+ : null ;
249255
250256let publishAppDeploymentCommand : pulumi . Resource | undefined ;
251257
252- if ( hiveAppPersistedDocumentsAbsolutePath ) {
258+ if ( hiveAppPersistedDocumentsAbsolutePath && RUN_PUBLISH_COMMANDS ) {
253259 publishAppDeploymentCommand = publishAppDeployment ( {
254260 appName : 'hive-app' ,
255261 registry : {
@@ -268,7 +274,7 @@ if (hiveAppPersistedDocumentsAbsolutePath) {
268274 dockerSecret : docker . secret ,
269275 } ,
270276 // We need to wait until the new GraphQL schema is published before we can publish the app deployment.
271- dependsOn : [ publishGraphQLSchemaCommand ] ,
277+ dependsOn : publishGraphQLSchemaCommand ? [ publishGraphQLSchemaCommand ] : [ ] ,
272278 } ) ;
273279}
274280
@@ -316,18 +322,6 @@ deployCloudFlareSecurityTransform({
316322 '/api/github' ,
317323 '/api/slack' ,
318324 ] ,
319- ignoredHosts : [
320- // Ignore CSP for Production CDN
321- 'cdn.graphql-hive.com' ,
322- // Staging
323- 'staging.graphql-hive.com' ,
324- 'app.staging.graphql-hive.com' ,
325- 'cdn.staging.graphql-hive.com' ,
326- // Dev
327- 'dev.graphql-hive.com' ,
328- 'app.dev.graphql-hive.com' ,
329- 'cdn.dev.graphql-hive.com' ,
330- ] ,
331325} ) ;
332326
333327export const graphqlApiServiceId = graphql . service . id ;
0 commit comments