Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Add app version to index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Oct 19, 2023
1 parent 6f85b50 commit 04b47fd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<head>
<meta charset="utf-8" />
<meta name="theme-color" content="#000000" />
<meta name="ui-version" content="%GIT_SHA%">
<meta name="git-hash" content="%GIT_SHA%" />
<meta name="package-version" content="%APP_VERSION%" />
<script type="text/javascript">
if ("%REACT_APP_RELEASE_STAGE%" === "production" || "%REACT_APP_RELEASE_STAGE%" === "beta") {
;window.NREUM||(NREUM={});NREUM.init={privacy:{cookies_enabled:true}};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:local": "env-cmd -e local -r .env-cmdrc.local.json yarn build",
"build:prod": "env-cmd -e production yarn build",
"build:staging": "env-cmd -e staging yarn build",
"build": "GIT_SHA=`git rev-parse HEAD` vite build",
"build": "GIT_SHA=`git rev-parse HEAD` APP_VERSION=$npm_package_version vite build",
"check-types": "tsc -p tsconfig.json --noEmit",
"clean": "rm -rf node_modules && rm -rf build && yarn install",
"codegen": "graphql-codegen --config codegen.ts",
Expand Down
18 changes: 0 additions & 18 deletions scripts/deploy/app-version.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@
echo "Deploying to S3"
aws s3 sync build/ s3://"${BUCKET}"/ --acl public-read --follow-symlinks --delete --exclude .env-cmdrc.json
echo "Deployed to S3"

# If the above step succeeds, run this step
echo "Exporting REACT_APP_VERSION variable"
./scripts/deploy/app-version.sh
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default defineConfig({
injectVariablesInHTML({
files: "build/index.html",
variables: [
"%APP_VERSION%",
"%GIT_SHA%",
"%REACT_APP_RELEASE_STAGE%",
"%REACT_APP_NEW_RELIC_ACCOUNT_ID%",
Expand Down

0 comments on commit 04b47fd

Please sign in to comment.