Fix building and serving a dev bundle
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2021-07-25 14:34:39 +02:00
parent 1fc2eb8e9c
commit 52f37bb9fb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 20 additions and 7 deletions

View File

@ -78,7 +78,19 @@ steps:
depends_on:
- dependencies
- name: build
# Building in dev mode to avoid the service worker for testing
- name: build-dev
image: node:16
pull: true
environment:
YARN_CACHE_FOLDER: .cache/yarn/
CYPRESS_CACHE_FOLDER: .cache/cypress/
commands:
- yarn build:dev
depends_on:
- dependencies
- name: build-prod
image: node:16
pull: true
environment:
@ -106,11 +118,12 @@ steps:
CYPRESS_CACHE_FOLDER: .cache/cypress/
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
commands:
- sed -i 's/localhost/api/g' index.html
- yarn serve -l warn & npx wait-on http://localhost:5000
- sed -i 's/localhost/api/g' dist-dev/index.html
- yarn serve:dist-dev & npx wait-on http://localhost:8000
- yarn test:frontend --browser chrome
depends_on:
- dependencies
- build-dev
- name: upload-test-results
image: plugins/s3:1

View File

@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:5000",
"baseUrl": "http://localhost:8000",
"env": {
"API_URL": "http://localhost:3456/api/v1",
"TEST_SECRET": "testingS3cr3et"

View File

@ -4,9 +4,9 @@
"private": true,
"scripts": {
"serve": "vite",
"serve:dist": "vite preview",
"serve:dist-dev": "node scripts/serve-dist.js",
"build": "vite build && rollup -c ./rollup.sw.js && workbox copyLibraries dist/",
"build:dev": "vite build -m development --outDir dist-dev/ && workbox copyLibraries dist-dev/",
"build:dev": "vite build -m development --outDir dist-dev/",
"build:report": "vue-cli-service build --report",
"lint": "vue-cli-service lint --ignore-pattern '*.test.*'",
"cypress:open": "cypress open",

View File

@ -2,7 +2,7 @@ const path = require('path')
const express = require('express')
const app = express()
const p = path.join(__dirname, '..', 'dist')
const p = path.join(__dirname, '..', 'dist-dev')
const port = 8000
app.use(express.static(p))