feat: refs #6695 run front
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2024-10-21 11:34:39 +02:00
parent ca2e0cb277
commit c3fa4839c0
6 changed files with 26 additions and 17 deletions

View File

@ -2,5 +2,5 @@ FROM node:stretch-slim
RUN corepack enable pnpm RUN corepack enable pnpm
RUN pnpm install -g @quasar/cli RUN pnpm install -g @quasar/cli
WORKDIR /app WORKDIR /app
COPY dist/spa ./ COPY dist/spa proxy.mjs ./
CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"] CMD ["quasar", "serve", "./", "--history", "--hostname", "0.0.0.0"]

14
Jenkinsfile vendored
View File

@ -114,13 +114,13 @@ pipeline {
sh 'git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git' sh 'git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git'
// sh 'cd front' // sh 'cd front'
// sh '# export VERSION=e2e-try' // sh '# export VERSION=e2e-try'
sh 'docker build -f salix/back/Dockerfile -t back ./salix' // sh 'docker build -f salix/back/Dockerfile -t back ./salix'
sh 'docker-compose -f docker-compose.e2e.yml up -d --build front' sh 'docker-compose -f docker-compose.e2e.yml up front --build'
sh 'pnpm i @verdnatura/myt' // sh 'pnpm i @verdnatura/myt'
sh 'cd salix && npx myt run -t --ci -d -n front_default' // 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-compose -f docker-compose.e2e.yml up --build db'
sh 'docker run --net=host -v ./test/cypress/storage:/salix/storage -d back' // 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-compose -f docker-compose.e2e.yml up e2e'
} }
post { post {

View File

@ -1,9 +1,10 @@
services: services:
front: front:
image: registry.verdnatura.es/salix-frontend:${VERSION:?} image: registry.verdnatura.es/salix-frontend:${VERSION:?}
command: quasar serve --history --proxy ./proxy.mjs --hostname localhost --port 9000
build: build:
context: . context: .
dockerfile: ./Dockerfile.e2e dockerfile: ./Dockerfile
network_mode: host network_mode: host
e2e: e2e:
image: registry.verdnatura.es/salix-frontend:${VERSION:?} image: registry.verdnatura.es/salix-frontend:${VERSION:?}

16
e2e.sh
View File

@ -1,11 +1,13 @@
git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git git clone --branch dev https://gitea.verdnatura.es/verdnatura/salix.git
cd front cd front
# export VERSION=e2e-try export VERSION=e2e-try
docker buildx build -f salix/back/Dockerfile -t back ./salix # docker buildx build -f salix/back/Dockerfile -t back ./salix
docker-compose -f docker-compose.e2e.yml up db # pnpm i @verdnatura/myt
docker run --net=host -v ./test/cypress/storage:/salix/storage -d back # cd salix && npx myt run -t --ci -d -n front_default
docker-compose -f docker-compose.e2e.yml -d up front # 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 docker-compose -f docker-compose.e2e.yml up e2e --build

6
proxy.mjs Normal file
View File

@ -0,0 +1,6 @@
export default [
{
path: '/api',
rule: { target: 'http://localhost:3000' },
},
];

View File

@ -109,7 +109,7 @@ module.exports = configure(function (/* ctx */) {
}, },
proxy: { proxy: {
'/api': { '/api': {
target: 'http://back:3000', target: 'http://localhost:3000',
logLevel: 'debug', logLevel: 'debug',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,