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_IMAGE = 'GeradoresWs/api'
DOCKER_TAG = "${env.BUILD_ID}"
DOCKER_REGISTRY = 'Shini89'
REMOTE_DOCKER_HOST = '192.168.2.20'
REMOTE_DOCKER_USER = 'admin'
REMOTE_DOCKER_PORT = '2375'
REACT_DIR = 'geradoresfe' // Diret�rio do frontend React
SERVICE_DIR = 'GeradoresService' // Diret�rio do projeto DLL
API_DIR = 'GeradoresWS' // Diret�rio do Web API
DOCKER_REGISTRY = 'your-docker-registry.com' // Registro Docker
}
stages {
stage('Check for Changes') {
steps {
script {
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: