From 4842ce10fb7378903ed7357ad19fc64f2ea93a1e Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Tue, 10 Oct 2023 13:32:36 +0200 Subject: [PATCH] Fix env variables and `npm run build` commands in several places I forgot to update them everywhere when I changed this. --- .github/create-release.sh | 10 +++++----- .github/workflows/ci.yml | 4 ++-- CONFIGURATION.md | 2 +- README.md | 16 ++++++++-------- src/about.tsx | 1 - src/settings.tsx | 12 ++++++------ 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/create-release.sh b/.github/create-release.sh index 9ad31d04..c5213e8d 100755 --- a/.github/create-release.sh +++ b/.github/create-release.sh @@ -16,8 +16,8 @@ fi npm ci # Build version for root path installation -export PUBLIC_URL=/ -npm run build +export PUBLIC_PATH=/ +npm run build:release FILENAME="oc-studio-$(date --utc +%F)-root.tar.gz" cd build @@ -27,9 +27,9 @@ cd .. # Build integrated version rm -rf build/ -export PUBLIC_URL=/studio -export REACT_APP_SETTINGS_PATH="/ui/config/studio/settings.toml" -npm run build +export PUBLIC_PATH=/studio +export SETTINGS_PATH="/ui/config/studio/settings.toml" +npm run build:release FILENAME="oc-studio-$(date --utc +%F)-integrated.tar.gz" cd build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c0f0a5f..5f72ce62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: # Prepare test deployment - name: Build for test deployment env: - REACT_APP_INCLUDE_LEGAL_NOTICES: 1 + INCLUDE_LEGAL_NOTICES: 1 run: | builddate="$(date --utc '+%Y-%m-%d_%H-%M-%S')" buildno="$(printf '%06d' "${{ github.run_id }}")" @@ -50,7 +50,7 @@ jobs: - name: Build for prod deployment if: github.repository_owner == 'elan-ev' && github.ref == 'refs/heads/master' env: - REACT_APP_INCLUDE_LEGAL_NOTICES: 1 + INCLUDE_LEGAL_NOTICES: 1 run: | rm -rf build npm run build:release diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 09705a8e..e5f22943 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -27,7 +27,7 @@ further below for information on that. # # Is loaded by Studio in the beginning. Default path is "settings.toml" # (relative to current URL), but can be overwritten via the environment variable -# `REACT_APP_SETTINGS_PATH` at build time. +# `SETTINGS_PATH` at build time. [opencast] diff --git a/README.md b/README.md index c98c8ad8..3d01177e 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ To build Studio yourself, execute these commands: % git clone git@github.com:elan-ev/opencast-studio.git % cd opencast-studio % npm install -% npm run build +% npm run build:release # or npm run build:dev for development ``` This will generate static content you can serve via any web server in `build/`. @@ -128,7 +128,7 @@ If you prefer to run a local development server directly, you can use this instead: ```sh -% npm run start +% npm start ``` ### Additional Build Options @@ -139,11 +139,11 @@ can apply these options by exporting them as environment variable before startin ```sh export OPTION=VALUE -npm run build +npm run build:release ``` -| Option | Example | Description -| --------------------------------- | ------------------ | ----------- -| `PUBLIC_URL` | `/studio` | Path from which Studio will be served -| `REACT_APP_SETTINGS_PATH` | `/mysettings.toml` | Path from which to load the configuration (see `CONFIGURATION.md` for more information) -| `REACT_APP_INCLUDE_LEGAL_NOTICES` | `1` | Set to `1` to include legal notices and information about ELAN e.V., any other value or having this variable not set will not include them. Unless you are working for ELAN e.V. there is probably no reason for you to use this variable. +| Option | Example | Description +| ----------------------- | ------------------ | ----------- +| `PUBLIC_URL` | `/studio` | Path from which Studio will be served +| `SETTINGS_PATH` | `/mysettings.toml` | Path from which to load the configuration (see `CONFIGURATION.md` for more information) +| `INCLUDE_LEGAL_NOTICES` | `1` | Set to `1` to include legal notices and information about ELAN e.V., any other value or having this variable not set will not include them. Unless you are working for ELAN e.V. there is probably no reason for you to use this variable. diff --git a/src/about.tsx b/src/about.tsx index b1eae24e..5646e246 100644 --- a/src/about.tsx +++ b/src/about.tsx @@ -101,7 +101,6 @@ export const About: React.FC = ({ close }) => ( - {/* process.env.REACT_APP_INCLUDE_LEGAL_NOTICES === '1' && */} {DEFINES.showLegalNotices && <>

ELAN e.V.

diff --git a/src/settings.tsx b/src/settings.tsx index 1dc43ea5..dcfbc8c9 100644 --- a/src/settings.tsx +++ b/src/settings.tsx @@ -218,9 +218,9 @@ export class SettingsManager { } /** - * Attempts to load `settings.toml` (or REACT_APP_SETTINGS_PATH is that's - * specified) from the server. If it fails for some reason, returns `null` and - * prints an appropriate message on console. + * Attempts to load `settings.toml` (or SETTINGS_PATH if that's specified) + * from the server. If it fails for some reason, returns `null` and prints an + * appropriate message on console. */ static async loadContextSettings() { // Try to retrieve the context settings. @@ -229,9 +229,9 @@ export class SettingsManager { basepath += "/"; } - // Construct path to settings file. If the `REACT_APP_SETTINGS_PATH` is - // given and starts with '/', it is interpreted as absolute path from the - // server root. + // Construct path to settings file. If the `SETTINGS_PATH` is given and + // starts with '/', it is interpreted as absolute path from the server + // root. let settingsPath = DEFINES.settingsPath || CONTEXT_SETTINGS_FILE; // If a custom file is given via query parameter, change the settings path