Jenkins Commit
This commit is contained in:
53
Jenkinsfile
vendored
53
Jenkinsfile
vendored
@@ -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 + "<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') {
|
||||
steps {
|
||||
echo 'Construindo o projeto...'
|
||||
}
|
||||
}
|
||||
stage('Deploys') {
|
||||
steps {
|
||||
echo 'DEploy o projeto...'
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
// Clean up the workspace after the build
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user