Jenkins Commit

This commit is contained in:
Marco Santos
2024-11-15 11:10:12 +00:00
parent 85d4c90aeb
commit 022c427d15

55
Jenkinsfile vendored
View File

@@ -1,15 +1,62 @@
pipeline { pipeline {
agent any 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'))
}
stages { stages {
/*******************************************************
Stage BUILD
*******************************************************/
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 + "<br>Autor: ${entry.author.fullName} ( ${entry.author} ) <br> Commit: ${entry.msg}"
def files = new ArrayList(entry.affectedFiles)
message = message + '<br>Ficheiros:<br><ul>'
for (int k = 0; k < files.size(); k++) {
def file = files[k]
message = message + "<li> ${file.path} ( ${file.editType.name} ) </li>"
}
message = message + '</ul>'
}
}
}
}
}
}
/*******************************************************
Stage BUILD
*******************************************************/
stage('Build') { stage('Build') {
steps { steps {
echo 'Construindo o projeto...' echo 'Construindo o projeto...'
} }
} }
stage('Deploys') { }
steps {
echo 'DEploy o projeto...' post {
} always {
// Clean up the workspace after the build
cleanWs()
} }
} }
} }