From b15d8458c8f41673260b6857c365933cbeb488bf Mon Sep 17 00:00:00 2001 From: Andil Date: Mon, 10 Aug 2026 19:23:52 +0000 Subject: [PATCH] refactor: centralize server IP configuration --- Jenkinsfile | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5c175cf..d57f215 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,7 @@ pipeline { environment { REGISTRY = "localhost:5000" + SERVER_IP = "192.168.1.95" BACKEND_IMAGE = "${REGISTRY}/the-tip-top/backend" FRONTEND_IMAGE = "${REGISTRY}/the-tip-top/frontend" @@ -48,7 +49,7 @@ pipeline { env.COMPOSE_PROJECT = 'tiptop-dev' env.DEPLOY_NETWORK = 'tiptop-dev' - env.FRONTEND_API_URL = 'http://192.168.1.23:5001' + env.FRONTEND_API_URL = "http://${SERVER_IP}:5001" } else if (env.BRANCH_NAME.startsWith('release-')) { env.DEPLOY_ENABLED = 'true' @@ -58,7 +59,7 @@ pipeline { env.COMPOSE_PROJECT = 'tiptop-preprod' env.DEPLOY_NETWORK = 'tiptop-preprod' - env.FRONTEND_API_URL = 'http://192.168.1.23:5002' + env.FRONTEND_API_URL = "http://${SERVER_IP}:5002" } else if (env.BRANCH_NAME == 'main') { env.DEPLOY_ENABLED = 'true' @@ -68,7 +69,7 @@ pipeline { env.COMPOSE_PROJECT = 'tiptop-prod' env.DEPLOY_NETWORK = 'tiptop-prod' - env.FRONTEND_API_URL = 'http://192.168.1.23:5003' + env.FRONTEND_API_URL = "http://${SERVER_IP}:5003" } else { env.DEPLOY_ENABLED = 'false' @@ -84,6 +85,8 @@ pipeline { echo "Tag Docker : ${env.IMAGE_TAG}" echo "Environnement : ${env.DEPLOY_ENV}" echo "Déploiement activé : ${env.DEPLOY_ENABLED}" + echo "Serveur : ${env.SERVER_IP}" + echo "API frontend : ${env.FRONTEND_API_URL}" } } } @@ -163,21 +166,21 @@ pipeline { ''' } - post { - always { - junit( - testResults: 'backend/test-results/*.xml', - allowEmptyResults: true - ) + post { + always { + junit( + testResults: 'backend/test-results/*.xml', + allowEmptyResults: true + ) - archiveArtifacts( - artifacts: 'backend/coverage/**', - fingerprint: true, - allowEmptyArchive: true - ) + archiveArtifacts( + artifacts: 'backend/coverage/**', + fingerprint: true, + allowEmptyArchive: true + ) + } } - } - } + } stage('Frontend - Lint et Build') { steps {