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

This commit is contained in:
Alex Moreno 2025-01-31 10:07:41 +01:00
parent 2e793164ec
commit d9602307c9
1 changed files with 36 additions and 20 deletions

26
Jenkinsfile vendored
View File

@ -73,28 +73,44 @@ pipeline {
environment { environment {
CREDENTIALS = credentials('docker-registry') CREDENTIALS = credentials('docker-registry')
} }
steps {
script { script {
def packageJson = readJSON file: 'package.json' def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
} }
stages {
stage('Network') {
steps {
// sh "docker network rm e2e_default || true" // sh "docker network rm e2e_default || true"
// sh 'docker network create e2e_default || true' // sh 'docker network create e2e_default || true'
}
}
stage('DB') {
steps {
sh 'rm -rf salix' sh 'rm -rf salix'
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git' sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
// Db
sh 'cd salix && pnpm i --prefer-offline @verdnatura/myt && npx myt run -t -d' sh 'cd salix && pnpm i --prefer-offline @verdnatura/myt && npx myt run -t -d'
// Backend }
}
stage('Back') {
steps {
sh 'docker build -f ./salix/back/Dockerfile -t back ./salix' sh 'docker build -f ./salix/back/Dockerfile -t back ./salix'
sh 'docker run -d --name salix --net=host -v $(pwd)/test/cypress/storage:/salix/storage back' sh 'docker run -d --name salix --net=host -v $(pwd)/test/cypress/storage:/salix/storage back'
// Frontend }
}
stage('Front') {
steps {
sh 'quasar build' sh 'quasar build'
sh 'docker-compose -f docker-compose.e2e.yml build front' sh 'docker-compose -f docker-compose.e2e.yml build front'
sh 'docker-compose -f docker-compose.e2e.yml up -d front' sh 'docker-compose -f docker-compose.e2e.yml up -d front'
// E2E }
}
stage('Test') {
steps {
sh 'docker-compose -f docker-compose.e2e.yml build e2e' sh 'docker-compose -f docker-compose.e2e.yml build e2e'
sh 'docker-compose -f docker-compose.e2e.yml up e2e' sh 'docker-compose -f docker-compose.e2e.yml up e2e'
} }
}
}
post { post {
always { always {
junit( junit(