Skip to content

Commit e703b34

Browse files
authored
chore: fix env vars customizations in all-in-one image (baserow#4614)
* Fix production images * Please linter and fix the use of the linter cache * Polish frontend commands * Remove build-local * Fix dev server * Address copilot feedback
1 parent c449c0a commit e703b34

File tree

28 files changed

+257
-261
lines changed

28 files changed

+257
-261
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ jobs:
235235
password: ${{ secrets.GITHUB_TOKEN }}
236236

237237
- name: Run frontend lint
238-
run: docker run --rm ${{ needs.build-frontend.outputs.image }} lint
238+
run: |
239+
docker run --rm \
240+
${{ needs.build-frontend.outputs.image }} lint
239241
240242
dockerfile-lint:
241243
name: Dockerfile Lint (hadolint)
@@ -693,7 +695,7 @@ jobs:
693695
-e PRIVATE_BACKEND_URL=http://backend:8000 \
694696
-e FEATURE_FLAGS="*" \
695697
-p 3000:3000 \
696-
${{ needs.build-frontend.outputs.image }} nuxt-local &
698+
${{ needs.build-frontend.outputs.image }} nuxt-prod &
697699
698700
# Wait for all docker run commands to complete
699701
wait

deploy/all-in-one/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ ARG GID
9393

9494
# Web-frontend
9595
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/web-frontend /baserow/web-frontend
96-
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/premium/web-frontend /baserow/premium/web-frontend
97-
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/enterprise/web-frontend /baserow/enterprise/web-frontend
9896

9997
# Backend
10098
COPY --chown=$UID:$GID --from=backend_image /baserow/backend /baserow/backend
@@ -144,8 +142,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
144142

145143
# Web-frontend
146144
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/web-frontend /baserow/web-frontend
147-
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/premium/web-frontend /baserow/premium/web-frontend
148-
COPY --chown=$UID:$GID --from=web_frontend_image /baserow/enterprise/web-frontend /baserow/enterprise/web-frontend
149145

150146
# Backend
151147
COPY --chown=$UID:$GID --from=backend_image /baserow/backend /baserow/backend

deploy/all-in-one/supervisor/default_baserow_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if [[ "${BASEROW_ALL_IN_ONE_DEV_MODE:-}" == "true" ]]; then
6060
DEFAULT_CELERY_BEAT_STARTUP_COMMAND='celery-beat'
6161
else
6262
DEFAULT_DJANGO_SETTINGS_MODULE='baserow.config.settings.base'
63-
DEFAULT_WEB_FRONTEND_STARTUP_COMMAND='nuxt-local'
63+
DEFAULT_WEB_FRONTEND_STARTUP_COMMAND='nuxt-prod'
6464
DEFAULT_BACKEND_STARTUP_COMMAND='gunicorn'
6565
DEFAULT_CELERY_WORKER_STARTUP_COMMAND='celery-worker'
6666
DEFAULT_CELERY_EXPORT_WORKER_STARTUP_COMMAND='celery-exportworker'

deploy/plugins/install_plugin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ if [[ -d "/baserow/web-frontend" && -d "$PLUGIN_WEBFRONTEND_FOLDER" ]]; then
245245
run_as_docker_user yarn add "$PLUGIN_WEBFRONTEND_FOLDER" && yarn cache clean
246246

247247
# We only load web-frontend modules into nuxt which have a built marker. Touch
248-
# it now so the build-local picks up the newly installed module and builds it.
248+
# it now so the build picks up the newly installed module and builds it.
249249
touch "$WEBFRONTEND_BUILT_MARKER"
250250
function finish {
251251
rm -f "$WEBFRONTEND_BUILT_MARKER"
252252
}
253253
trap finish EXIT
254254

255255
if [[ "$dev" != true ]]; then
256-
run_as_docker_user /baserow/web-frontend/docker/docker-entrypoint.sh build-local
256+
run_as_docker_user /baserow/web-frontend/docker/docker-entrypoint.sh build
257257
else
258258
log "Installing plugins dev dependencies..."
259259
# In dev mode yarn install the plugins own dependencies so they are available

deploy/plugins/uninstall_plugin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ if [[ -d "/baserow/web-frontend" && -d "$PLUGIN_WEBFRONTEND_FOLDER" ]]; then
6969
check_and_run_script "$PLUGIN_WEBFRONTEND_FOLDER" uninstall.sh
7070
run_as_docker_user yarn remove "$package_name"
7171

72-
# We must delete the web-frontend plugin entirely so the build-local doesn't
72+
# We must delete the web-frontend plugin entirely so the build doesn't
7373
# pick it up and build it.
7474
rm -rf "$PLUGIN_WEBFRONTEND_FOLDER"
7575
# We need to rebuild to ensure nuxt no longer has the plugin.
76-
run_as_docker_user /baserow/web-frontend/docker/docker-entrypoint.sh build-local
76+
run_as_docker_user /baserow/web-frontend/docker/docker-entrypoint.sh build
7777
rm -f /baserow/container_markers/"$plugin_name".web-frontend-built
7878
rm -f /baserow/container_markers/"$plugin_name".web-frontend-runtime-setup
7979
found_sub_module="true"

docs/installation/install-using-standalone-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ images:
3030
* `baserow/backend:2.0.6` (default command is `gunicorn`)
3131
* `baserow/backend:2.0.6` with command `celery-worker`
3232
* `baserow/backend:2.0.6` with command `celery-export-worker`
33-
* `baserow/web-frontend:2.0.6` (default command is `nuxt-local`)
33+
* `baserow/web-frontend:2.0.6` (default command is `nuxt-prod`)
3434
* A postgres database
3535
* A redis server
3636

e2e-tests/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ up: _ensure-images
202202
-e PRIVATE_BACKEND_URL=http://e2e-backend:8000 \
203203
-e FEATURE_FLAGS="*" \
204204
-p 3000:3000 \
205-
{{ frontend_image }} nuxt-local
205+
{{ frontend_image }} nuxt-prod
206206
fi
207207
208208
echo ""

enterprise/web-frontend/eslint.config.mjs

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
// Please keep in sync with the premium/enterprise eslintrc.js
2-
import withNuxt from './.nuxt/eslint.config.mjs'
1+
// @ts-check
2+
import withNuxt from './web-frontend/.nuxt/eslint.config.mjs'
3+
import globals from './web-frontend/node_modules/globals/index.js'
4+
import vitest from './web-frontend/node_modules/eslint-plugin-vitest/dist/index.mjs'
5+
import eslintConfigPrettier from './web-frontend/node_modules/eslint-config-prettier/index.js'
36

4-
import globals from 'globals'
5-
import vitest from 'eslint-plugin-vitest'
6-
import eslintConfigPrettier from 'eslint-config-prettier'
7-
8-
export default [
7+
export default withNuxt([
98
{
109
ignores: [
11-
'.nuxt/**',
1210
'**/node_modules/**',
13-
'coverage/**',
11+
'**/.nuxt/**',
12+
'**/coverage/**',
1413
'**/generated/**',
15-
'.nuxt-storybook/**',
14+
'**/.nuxt-storybook/**',
15+
'**/dist/**',
16+
'**/.output/**',
17+
'**/.storybook/**',
18+
'**/vitest.setup.ts',
1619
],
1720
},
1821
eslintConfigPrettier, // deactivate eslint rules that conflict with prettier
1922
{
23+
files: [
24+
'web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}',
25+
'premium/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}',
26+
'enterprise/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}',
27+
],
2028
languageOptions: {
2129
globals: {
2230
...globals.browser,
@@ -40,7 +48,17 @@ export default [
4048
'no-empty': 'off',
4149
},
4250
},
43-
51+
// Premium and Enterprise-specific overrides
52+
{
53+
files: [
54+
'premium/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}',
55+
'enterprise/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}',
56+
],
57+
rules: {
58+
'vue/order-in-components': 'off',
59+
},
60+
},
61+
// Test files configuration
4462
{
4563
files: [
4664
'**/*.{test,spec}.{js,ts,jsx,tsx}',
@@ -56,4 +74,4 @@ export default [
5674
...vitest.configs.recommended.rules,
5775
},
5876
},
59-
]
77+
])

plugin-boilerplate/{{ cookiecutter.project_slug }}/plugins/{{ cookiecutter.project_module }}/web-frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"lint": "yarn eslint && yarn stylelint",
1111
"dev": "cd /baserow/web-frontend/ && nuxt --hostname 0.0.0.0 --config-file ./config/nuxt.config.dev.js",
1212
"build": "cd /baserow/web-frontend/ && nuxt build --config-file ./config/nuxt.config.dev.js",
13-
"build-local": "cd /baserow/web-frontend/ && nuxt build --config-file ./config/nuxt.config.local.ts",
1413
"start": "cd /baserow/web-frontend/ && nuxt start --hostname 0.0.0.0 --config-file ./config/nuxt.config.local.ts"
1514
},
1615
"dependencies": {

0 commit comments

Comments
 (0)