refactor: centralize server IP configuration
This commit is contained in:
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user