diff --git a/build-fakeyou.sh b/build-fakeyou.sh index 4c23a2c458..3f59ea1687 100755 --- a/build-fakeyou.sh +++ b/build-fakeyou.sh @@ -12,9 +12,11 @@ mv packages/fakeyou/build/ fakeyou/build/ # Add the GIT SHA to the build # COMMIT_REF is defined by Netlify to be the commit SHA # We want a short 8 character reference. +echo "Labelling build with short SHA..." SHORT_SHA=$(echo "${COMMIT_REF}" | cut -c1-8) -# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + # Mac-friendly version find . -type f -exec sed -i "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + +# The above command won't work with Mac's version of find/sed. The following is a Mac-friendly version: +# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + echo "Copying redirects configuration to Netlify build dir..." cp _redirects fakeyou/build/ diff --git a/build-storyteller-home.sh b/build-storyteller-home.sh index 9a0c1fcde1..a9e7eb747d 100755 --- a/build-storyteller-home.sh +++ b/build-storyteller-home.sh @@ -9,6 +9,15 @@ yarn build-storyteller-home --verbose --ignore-optional --ignore-engines mkdir storyteller-home mv packages/storyteller-home/build/ storyteller-home/build/ +# Add the GIT SHA to the build +# COMMIT_REF is defined by Netlify to be the commit SHA +# We want a short 8 character reference. +echo "Labelling build with short SHA..." +SHORT_SHA=$(echo "${COMMIT_REF}" | cut -c1-8) +find . -type f -exec sed -i "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + +# The above command won't work with Mac's version of find/sed. The following is a Mac-friendly version: +# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + + echo "Copying redirects configuration to Netlify build dir..." cp _redirects storyteller-home/build/ diff --git a/build-storyteller-obs.sh b/build-storyteller-obs.sh index ff815cc6a4..83caee9d47 100755 --- a/build-storyteller-obs.sh +++ b/build-storyteller-obs.sh @@ -9,6 +9,15 @@ yarn build-storyteller-obs --verbose --ignore-optional --ignore-engines mkdir storyteller-obs mv packages/storyteller-obs/build/ storyteller-obs/build/ +# Add the GIT SHA to the build +# COMMIT_REF is defined by Netlify to be the commit SHA +# We want a short 8 character reference. +echo "Labelling build with short SHA..." +SHORT_SHA=$(echo "${COMMIT_REF}" | cut -c1-8) +find . -type f -exec sed -i "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + +# The above command won't work with Mac's version of find/sed. The following is a Mac-friendly version: +# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + + echo "Copying redirects configuration to Netlify build dir..." cp _redirects storyteller-obs/build/ diff --git a/build-storyteller-stream.sh b/build-storyteller-stream.sh index 27a1831166..c917d74e48 100755 --- a/build-storyteller-stream.sh +++ b/build-storyteller-stream.sh @@ -9,6 +9,15 @@ yarn build-storyteller-stream --verbose --ignore-optional --ignore-engines mkdir storyteller-stream mv packages/storyteller-stream/build/ storyteller-stream/build/ +# Add the GIT SHA to the build +# COMMIT_REF is defined by Netlify to be the commit SHA +# We want a short 8 character reference. +echo "Labelling build with short SHA..." +SHORT_SHA=$(echo "${COMMIT_REF}" | cut -c1-8) +find . -type f -exec sed -i "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + +# The above command won't work with Mac's version of find/sed. The following is a Mac-friendly version: +# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + + echo "Copying redirects configuration to Netlify build dir..." cp _redirects storyteller-stream/build/ diff --git a/packages/storyteller-home/src/App.scss b/packages/storyteller-home/src/App.scss index 6b3abd16c7..ba51f8cd34 100644 --- a/packages/storyteller-home/src/App.scss +++ b/packages/storyteller-home/src/App.scss @@ -19,4 +19,9 @@ body { .mainwrap { max-width: 1000px; margin: auto; -} \ No newline at end of file +} + +.git-sha { + color: #999; + font-size: 0.8rem; +} diff --git a/packages/storyteller-home/src/common/Footer.tsx b/packages/storyteller-home/src/common/Footer.tsx index cd61b8b99e..b98e1bcc80 100644 --- a/packages/storyteller-home/src/common/Footer.tsx +++ b/packages/storyteller-home/src/common/Footer.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { GitSha } from '@storyteller/components/src/elements/GitSha'; interface Props { } @@ -11,6 +12,9 @@ function Footer(props: Props) {

Copyright © 2020 — 2022 Learning Machines, Inc. (makers of FakeYou and Storyteller)

+

+ +

diff --git a/packages/storyteller-stream/src/App.scss b/packages/storyteller-stream/src/App.scss index 6b3abd16c7..ba51f8cd34 100644 --- a/packages/storyteller-stream/src/App.scss +++ b/packages/storyteller-stream/src/App.scss @@ -19,4 +19,9 @@ body { .mainwrap { max-width: 1000px; margin: auto; -} \ No newline at end of file +} + +.git-sha { + color: #999; + font-size: 0.8rem; +} diff --git a/packages/storyteller-stream/src/App.tsx b/packages/storyteller-stream/src/App.tsx index f22b14aa25..8894b4b57e 100644 --- a/packages/storyteller-stream/src/App.tsx +++ b/packages/storyteller-stream/src/App.tsx @@ -3,6 +3,7 @@ import './App.scss'; import React from 'react'; import { BrowserRouter, Route, Switch } from "react-router-dom"; +import { GitSha } from '@storyteller/components/src/elements/GitSha'; import { ListTtsModels, TtsModelListItem } from '@storyteller/components/src/api/tts/ListTtsModels'; import StreamPage from './pages/stream/StreamPage'; import i18n from 'i18next'; @@ -185,6 +186,17 @@ class App extends React.Component { + +