From c3fa4839c0ddeca09800d356ba51b9de5ddf1d41 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 21 Oct 2024 11:34:39 +0200 Subject: [PATCH] feat: refs #6695 run front --- Dockerfile | 2 +- Jenkinsfile | 14 +++++++------- docker-compose.e2e.yml | 3 ++- e2e.sh | 16 +++++++++------- proxy.mjs | 6 ++++++ quasar.config.js | 2 +- 6 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 proxy.mjs diff --git a/Dockerfile b/Dockerfile index 1906dc920..6f6c43e5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,5 +2,5 @@ FROM node:stretch-slim RUN corepack enable pnpm RUN pnpm install -g @quasar/cli WORKDIR /app -COPY dist/spa ./ +COPY dist/spa proxy.mjs ./ CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"] diff --git a/Jenkinsfile b/Jenkinsfile index 433de1d17..e0e27524b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,13 +114,13 @@ pipeline { sh 'git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git' // sh 'cd front' // sh '# export VERSION=e2e-try' - sh 'docker build -f salix/back/Dockerfile -t back ./salix' - sh 'docker-compose -f docker-compose.e2e.yml up -d --build front' - sh 'pnpm i @verdnatura/myt' - sh 'cd salix && npx myt run -t --ci -d -n front_default' - // sh 'docker-compose -f docker-compose.e2e.yml up --build db' - sh 'docker run --net=host -v ./test/cypress/storage:/salix/storage -d back' - sh 'docker-compose -f docker-compose.e2e.yml up e2e' + // sh 'docker build -f salix/back/Dockerfile -t back ./salix' + sh 'docker-compose -f docker-compose.e2e.yml up front --build' + // sh 'pnpm i @verdnatura/myt' + // sh 'cd salix && npx myt run -t --ci -d -n front_default' + // // sh 'docker-compose -f docker-compose.e2e.yml up --build db' + // sh 'docker run --net=host -v ./test/cypress/storage:/salix/storage -d back' + // sh 'docker-compose -f docker-compose.e2e.yml up e2e' } post { diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 82b6fb3d9..6b36bf486 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -1,9 +1,10 @@ services: front: image: registry.verdnatura.es/salix-frontend:${VERSION:?} + command: quasar serve --history --proxy ./proxy.mjs --hostname localhost --port 9000 build: context: . - dockerfile: ./Dockerfile.e2e + dockerfile: ./Dockerfile network_mode: host e2e: image: registry.verdnatura.es/salix-frontend:${VERSION:?} diff --git a/e2e.sh b/e2e.sh index 1ca5fcf38..67b6ce035 100644 --- a/e2e.sh +++ b/e2e.sh @@ -1,11 +1,13 @@ git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git cd front -# export VERSION=e2e-try -docker buildx build -f salix/back/Dockerfile -t back ./salix -docker-compose -f docker-compose.e2e.yml up db -docker run --net=host -v ./test/cypress/storage:/salix/storage -d back -docker-compose -f docker-compose.e2e.yml -d up front +export VERSION=e2e-try +# docker buildx build -f salix/back/Dockerfile -t back ./salix +# pnpm i @verdnatura/myt +# cd salix && npx myt run -t --ci -d -n front_default +# docker run --net=host -v ./test/cypress/storage:/salix/storage -d back +# docker-compose -f docker-compose.e2e.yml -d up front +# docker-compose -f docker-compose.e2e.yml up e2e --build + +docker-compose -f docker-compose.e2e.yml up front --build -d docker-compose -f docker-compose.e2e.yml up e2e --build - - diff --git a/proxy.mjs b/proxy.mjs new file mode 100644 index 000000000..378368dd4 --- /dev/null +++ b/proxy.mjs @@ -0,0 +1,6 @@ +export default [ + { + path: '/api', + rule: { target: 'http://localhost:3000' }, + }, +]; diff --git a/quasar.config.js b/quasar.config.js index 822f62e1d..e6445310c 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -109,7 +109,7 @@ module.exports = configure(function (/* ctx */) { }, proxy: { '/api': { - target: 'http://back:3000', + target: 'http://localhost:3000', logLevel: 'debug', changeOrigin: true, secure: false,