This commit is contained in:
parent
940bc7f1ff
commit
caf76e4071
|
@ -66,75 +66,73 @@ pipeline {
|
|||
sh 'pnpm install --prefer-offline'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Unit') {
|
||||
when {
|
||||
expression { !PROTECTED_BRANCH }
|
||||
stage('Test: Unit') {
|
||||
when {
|
||||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
}
|
||||
steps {
|
||||
sh 'pnpm run test:unit:ci'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
}
|
||||
}
|
||||
stage('Test: E2E') {
|
||||
when {
|
||||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
}
|
||||
stages {
|
||||
stage('Setup') {
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
cleanDockerE2E()
|
||||
}
|
||||
sh 'rm -rf salix'
|
||||
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'pnpm run test:unit:ci'
|
||||
stage('Up') {
|
||||
parallel {
|
||||
stage('Database & Backend') {
|
||||
steps {
|
||||
sh 'cd salix && pnpm i --prefer-offline @verdnatura/myt && npx myt run -t -d'
|
||||
sh 'docker build -f ./salix/back/Dockerfile -t back ./salix'
|
||||
sh 'docker run -d --name salix_e2e --net=host -v $(pwd)/test/cypress/storage:/salix/storage back'
|
||||
}
|
||||
}
|
||||
stage('Frontend') {
|
||||
steps {
|
||||
sh 'docker-compose -f docker-compose.e2e.yml up -d --build front'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
stage('Run E2E') {
|
||||
steps {
|
||||
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('E2E') {
|
||||
when {
|
||||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
}
|
||||
stages {
|
||||
stage('Setup') {
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
cleanDockerE2E()
|
||||
}
|
||||
sh 'rm -rf salix'
|
||||
sh 'git clone https://gitea.verdnatura.es/verdnatura/salix.git'
|
||||
}
|
||||
}
|
||||
stage('Up') {
|
||||
parallel {
|
||||
stage('Database & Backend') {
|
||||
steps {
|
||||
sh 'cd salix && pnpm i --prefer-offline @verdnatura/myt && npx myt run -t -d'
|
||||
sh 'docker build -f ./salix/back/Dockerfile -t back ./salix'
|
||||
sh 'docker run -d --name salix_e2e --net=host -v $(pwd)/test/cypress/storage:/salix/storage back'
|
||||
}
|
||||
}
|
||||
stage('Frontend') {
|
||||
steps {
|
||||
sh 'docker-compose -f docker-compose.e2e.yml up -d --build front'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run E2E') {
|
||||
steps {
|
||||
sh 'docker-compose -f docker-compose.e2e.yml up e2e'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanDockerE2E()
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanDockerE2E()
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue