diff --git a/Jenkinsfile b/Jenkinsfile index 23b3c5b..e3a7a55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,15 +1,62 @@ 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')) + } + 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 + "
Autor: ${entry.author.fullName} ( ${entry.author} )
Commit: ${entry.msg}" + def files = new ArrayList(entry.affectedFiles) + message = message + '
Ficheiros:
' + } + } + } + } + } + } + + /******************************************************* + Stage BUILD + *******************************************************/ stage('Build') { steps { echo 'Construindo o projeto...' } } - stage('Deploys') { - steps { - echo 'DEploy o projeto...' - } + } + + post { + always { + // Clean up the workspace after the build + cleanWs() } } }