-
Notifications
You must be signed in to change notification settings - Fork 27
/
gatsby-config.js
148 lines (140 loc) · 4.69 KB
/
gatsby-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
const path = require(`path`)
const crypto = require(`crypto`)
const digitalData = require("./src/utils/digital-data")
const consts = {
githubRepoName: "galasa.dev",
githubOrgName: "galasa-dev",
twitterUrl: "",
slackUrl: "https://openmainframeproject.slack.com/signup#/domain-signup",
algolia: {
appId: "0CBS2VLS6S",
apiKey: "46b619eff7e9e3900835e17fc7aa880b", //#gatsby recommended application of api key //pragma: allowlist secret
indexName: "galasa",
},
}
consts.githubOrgUrl = `https://github.com/${consts.githubOrgName}`
consts.githubRepoUrl = `${consts.githubOrgUrl}/${consts.githubRepoName}`
consts.githubRepoSlug = `${consts.githubOrgName}/${consts.githubRepoName}`
const buildRepoSlug = process.env.PR_REPO_SLUG || process.env.BASE_REPO_SLUG || consts.githubRepoSlug
consts.buildRepoUrl = `https://github.com/${buildRepoSlug}`
consts.buildBranch = process.env.PR_BRANCH_NAME || process.env.BRANCH_NAME || "main"
function createHash(value) {
if (process.env.GATSBY_GALASA_ENV !== "LOCAL") {
return `'sha256-${crypto.createHash('sha256').update(value).digest('base64')}'`
} else {
return ''
}
}
const gatsbyRequiredRules = path.join(
process.cwd(),
"node_modules",
"gatsby",
"dist",
"utils",
"eslint-rules"
);
const eslintOptions = process.env.CI === `true` ? {
failOnError: true,
failOnWarning: true,
} : {};
module.exports = {
siteMetadata: {
title: `galasa`,
description: `Galasa is an open source deep integration test framework for teams looking to give more power to their testers.`,
siteUrl: `https://galasa.dev`,
consts,
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `markdown-pages`,
path: path.join(__dirname, `src`, `markdown-pages`),
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: path.join(__dirname, `src`, `images`),
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `data`,
path: path.join(__dirname, `src`, `data`),
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1080,
},
},
`gatsby-remark-prismjs`,
`gatsby-remark-copy-linked-files`,
],
},
},
{
resolve: 'gatsby-plugin-eslint',
options: {
rulePaths: [gatsbyRequiredRules],
stages: ['develop', 'build-javascript'],
...eslintOptions,
}
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-layout`,
options: {
component: require.resolve(`./src/components/layout`),
},
},
`gatsby-plugin-sass`,
`gatsby-plugin-catch-links`,
`gatsby-transformer-yaml`,
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /\.inline\.svg$/
}
}
},
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Galasa`,
short_name: `Galasa`,
start_url: `/`,
background_color: `#EFEFEF`,
theme_color: `#212121`,
display: `browser`,
icon: `src/images/identifier.inline.svg`
},
},
{
resolve: `gatsby-plugin-csp`,
options: {
mergeStyleHashes: false,
directives: {
"style-src": "'unsafe-inline' https://fonts.googleapis.com",
"script-src": `'self' 'unsafe-hashes' https://*.www.s81c.com https://*.ibm.com tags.tiqcdn.com consent.truste.com https://bat.bing.com https://scripts.demandbase.com https://www.googletagmanager.com https://pixel.mathtag.com https://*.tealiumiq.com https://consent.trustarc.com https://cdn.trackjs.com https://dpm.demdex.net https://www.google-analytics.com ${createHash(digitalData)}`,
"font-src": "'self' data: https://fonts.gstatic.com https://*.www.s81c.com",
"connect-src": "'self' https://*.ibm.com https://dbdm-events.mybluemix.net https://*.algolia.net https://*.algolianet.com https://dpm.demdex.net https://*.tealiumiq.com https://api.company-target.com https://www.google-analytics.com https://stats.g.doubleclick.net",
"img-src": "'self' data: https://consent.trustarc.com https://consent-pref.trustarc.com https://bat.bing.com https://id.rlcdn.com https://www.google-analytics.com https://cm.everesttech.net https://pixel.mathtag.com https://dpm.demdex.net https://sync.crwdcntrl.net",
"frame-src": "'self' https://*.trustarc.com https://pixel.mathtag.com https://ibm.demdex.net",
}
}
}
],
trailingSlash: "never",
}