Skip to content

Commit

Permalink
Fix env variables and npm run build commands in several places (#1139)
Browse files Browse the repository at this point in the history
I forgot to update them everywhere when I changed this.
  • Loading branch information
LukasKalbertodt committed Oct 10, 2023
2 parents 60ccf40 + 4842ce1 commit 02f909a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .github/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}")"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/`.
Expand All @@ -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
Expand All @@ -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.
1 change: 0 additions & 1 deletion src/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export const About: React.FC<Props> = ({ close }) => (
</li>
</ul>

{/* process.env.REACT_APP_INCLUDE_LEGAL_NOTICES === '1' && <LegalNotices /> */}
{DEFINES.showLegalNotices && <>
<h2>ELAN e.V.</h2>

Expand Down
12 changes: 6 additions & 6 deletions src/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 02f909a

Please sign in to comment.