Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
The End ?
Browse files Browse the repository at this point in the history
  • Loading branch information
Capryc0rne committed Aug 26, 2024
1 parent 4eb9943 commit 6099a8a
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,48 @@ pipeline {
}
}

//stage('Run Backend Tests') {
// steps {
// // Tests PHPUnit
// dir('backend') {
// sh 'docker-compose exec -T laravel php artisan test'
// }
// }
//}
//
//stage('Run Frontend Tests') {
// steps {
// dir('frontend') {
// // Get the Docker network name used by your services
// sh '''
// NETWORK_NAME=$(docker-compose ps -q | xargs docker inspect -f '{{json .NetworkSettings.Networks }}' | jq -r 'keys[]' | head -n 1)
//
// # Run Cypress tests
// docker run --rm \
// --network ${NETWORK_NAME} \
// -v $PWD:/e2e \
// -w /e2e \
// -e NO_COLOR=1 \
// cypress/included:13.13.3 \
// npx cypress run
// '''
// }
// }
//}
stage('Run Backend Tests') {
steps {
// Tests PHPUnit
dir('backend') {
sh 'docker-compose exec -T laravel php artisan test'
}
}
}

stage('Run Frontend Tests') {
steps {
dir('frontend') {
// Get the Docker network name used by your services
sh '''
NETWORK_NAME=$(docker-compose ps -q | xargs docker inspect -f '{{json .NetworkSettings.Networks }}' | jq -r 'keys[]' | head -n 1)
# Run Cypress tests
docker run --rm \
--network ${NETWORK_NAME} \
-v $PWD:/e2e \
-w /e2e \
-e NO_COLOR=1 \
cypress/included:13.13.3 \
npx cypress run
'''
}
}
}
}

post {
success {
echo 'Build and tests succeeded!'
sh 'pwd'
sh 'docker-compose down'
sh'''
cd /srv/aio-tools/ressources_relationnelles
pwd
docker-compose down
git fetch
git checkout jenkins
git pull
pwd
docker-compose up --build -d
'''
sh 'pwd'
}
failure {
echo 'Build or tests failed.'
Expand Down

0 comments on commit 6099a8a

Please sign in to comment.