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 pnpm install -g @quasar/cli
WORKDIR /app
COPY dist/spa ./
COPY dist/spa proxy.mjs ./
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 '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 {

View File

@ -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:?}

16
e2e.sh
View File

@ -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

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: {
'/api': {
target: 'http://back:3000',
target: 'http://localhost:3000',
logLevel: 'debug',
changeOrigin: true,
secure: false,