From 7a5866dc31aef0d1c9b2dd5900afe21df8914077 Mon Sep 17 00:00:00 2001 From: lbaker Date: Wed, 24 Jun 2020 10:41:23 -0700 Subject: [PATCH 1/3] chore: Add amplify.yml --- amplify.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 amplify.yml diff --git a/amplify.yml b/amplify.yml new file mode 100644 index 000000000..d99a1de0f --- /dev/null +++ b/amplify.yml @@ -0,0 +1,21 @@ +version: 0.1 +frontend: + phases: + preBuild: + commands: + - npm ci + build: + commands: + - | + if [ "${AWS_BRANCH}" = "master" ]; then + npm run build:production; + else + npm run build:staging; + fi + artifacts: + baseDirectory: public + files: + - '**/*' + cache: + paths: + - node_modules/**/* From 49dbe83c4481235d3c2aecf574e8a70b6a3aec6c Mon Sep 17 00:00:00 2001 From: lbaker Date: Wed, 24 Jun 2020 10:41:49 -0700 Subject: [PATCH 2/3] chore: Add and configure gatsby-plugin-newrelic --- gatsby-config.js | 27 +++++++++++++++++++++++++++ package-lock.json | 7 +++++++ package.json | 3 +++ 3 files changed, 37 insertions(+) diff --git a/gatsby-config.js b/gatsby-config.js index 20bf1e8f6..6493c7dd8 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -71,5 +71,32 @@ module.exports = { }, 'gatsby-plugin-sitemap', 'gatsby-plugin-meta-redirect', + { + resolve: 'gatsby-plugin-newrelic', + options: { + configs: { + production: { + instrumentationType: 'proAndSPA', + accountId: '10175106', + trustKey: '1', + agentID: '22273498', + licenseKey: '23448da482', + applicationID: '22273498', + beacon: 'staging-bam.nr-data.net', + errorBeacon: 'staging-bam.nr-data.net', + }, + development: { + instrumentationType: 'proAndSPA', + accountId: '10175106', + trustKey: '1', + agentID: '22273531', + licenseKey: '23448da482', + applicationID: '22273531', + beacon: 'staging-bam.nr-data.net', + errorBeacon: 'staging-bam.nr-data.net', + }, + }, + }, + }, ], }; diff --git a/package-lock.json b/package-lock.json index f5f4fa9cd..67a2d7007 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13734,6 +13734,13 @@ } } }, + "gatsby-plugin-newrelic": { + "version": "github:newrelic/gatsby-plugin-newrelic#5cd42e832f0588764dc332ce7ebd05794de5106a", + "from": "github:newrelic/gatsby-plugin-newrelic#5cd42e832f0588764dc332ce7ebd05794de5106a", + "requires": { + "@babel/runtime": "^7.0.0" + } + }, "gatsby-plugin-offline": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/gatsby-plugin-offline/-/gatsby-plugin-offline-3.1.4.tgz", diff --git a/package.json b/package.json index 700f35c3f..3287ddc70 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "gatsby-plugin-manifest": "^2.3.5", "gatsby-plugin-mdx": "^1.2.11", "gatsby-plugin-meta-redirect": "^1.1.1", + "gatsby-plugin-newrelic": "newrelic/gatsby-plugin-newrelic.git#5cd42e832f0588764dc332ce7ebd05794de5106a", "gatsby-plugin-offline": "^3.1.4", "gatsby-plugin-react-helmet": "^3.2.4", "gatsby-plugin-robots-txt": "^1.5.1", @@ -57,6 +58,8 @@ "license": "MIT", "scripts": { "build": "gatsby build", + "build:production": "GATSBY_NEWRELIC_ENV=production gatsby build", + "build:staging": "GATSBY_NEWRELIC_ENV=staging gatsby build", "develop": "gatsby develop", "format": "prettier --write \"**/*.{js,jsx,json,md}\"", "start": "npm run develop", From c3c531d1db293a09cd9437c58286c006a5099d9a Mon Sep 17 00:00:00 2001 From: lbaker Date: Wed, 24 Jun 2020 10:53:49 -0700 Subject: [PATCH 3/3] chore: Swap development for staging in config --- gatsby-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 6493c7dd8..58bda4c1d 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -85,7 +85,7 @@ module.exports = { beacon: 'staging-bam.nr-data.net', errorBeacon: 'staging-bam.nr-data.net', }, - development: { + staging: { instrumentationType: 'proAndSPA', accountId: '10175106', trustKey: '1',