diff --git a/Jenkinsfile b/Jenkinsfile
index 122f265..d3327a8 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,171 +1,100 @@
-
pipeline {
agent any
- parameters {
- booleanParam(name: 'DeployAll', defaultValue: false, description: 'Deploy Site/WS ?')
- booleanParam(name: 'deploySite', defaultValue: false, description: 'Deploy Site ?')
- }
-
- triggers {
- pollSCM('* * * * *')
- }
-
-/*
environment {
- now = new Date().format('yyyyMMdd-HHmm', TimeZone.getTimeZone('UTC'))
- DOCKER_HOST = 'tcp://192.168.2.20:2375'
+ DOCKER_REGISTRY = 'git.homeware.pt'
DOCKER_TAG = "${env.BUILD_ID}"
- DOCKER_REGISTRY = 'Shini89' //'your-docker-registry.com' // Registro Docker
- REACT_DIR = 'geradoresfe'
- REACT_DOCKER_IMAGE = 'shini89/geradoresfe:lastest'
-
- SERVICE_DIR = 'GeradoresService'
- API_DIR = 'GeradoresWS'
- API_DOCKER_IMAGE = 'shini89/geradoresws:lastest'
- }
- */
-
- environment {
- DOCKER_HOST = 'tcp://192.168.2.20:2375'
- DOCKER_REGISTRY = 'docker.io/shini89'
- DOCKER_TAG = "${env.BUILD_ID}" // Tag única para builds
REACT_DIR = 'geradoresfe'
SERVICE_DIR = 'GeradoresService'
API_DIR = 'GeradoresWS'
+
+ REACT_IMAGE = "${DOCKER_REGISTRY}/geradores/fe:${DOCKER_TAG}"
+ WS_IMAGE = "${DOCKER_REGISTRY}/geradores/ws:${DOCKER_TAG}"
+
+ DOCKER_CREDENTIALS_ID = 'docker-registry-creds'
+ KUBECONFIG_CREDENTIALS_ID = 'kubeconfig-jenkins'
}
stages {
- stage('Validate Docker Connection') {
+
+ stage('Preparar Ambiente') {
steps {
script {
- echo "Validando conexão com Docker remoto: ${DOCKER_HOST}"
- // Testa a conexão com o Docker remoto
- sh 'docker --version'
+ echo "Verificar Docker local"
+ sh 'docker version'
}
}
}
- stage('Check for Changes') {
+ stage('Checkout Repositório') {
steps {
- script {
- def message = ""
- CodeChanges = currentBuild.changeSets != []
- if (CodeChanges) {
- def changeLogSets = currentBuild.changeSets
- for (int i = 0; i < changeLogSets.size(); i++) {
- def entries = changeLogSets[i].items
- for (int j = 0; j < entries.length; j++) {
- def entry = entries[j]
- message = message + "
Autor: ${entry.author.fullName} ( ${entry.author} )
Commit: ${entry.msg}"
- def files = new ArrayList(entry.affectedFiles)
- message = message + '
Ficheiros: