Changes in / [e229c22:57aa6f5]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    re229c22 r57aa6f5  
    7474
    7575        //Properties sent by the git-hooks (ref name, latest commit hash, previous commit hash)
    76         properties( [[$class: 'ParametersDefinitionProperty', parameterDefinitions: \
    77                         [[$class: 'StringParameterDefinition', name: 'GitRefName',     defaultValue: 'master', description: 'name of the ref that changed' ], \
    78                          [$class: 'StringParameterDefinition', name: 'GitRefNewValue', defaultValue: 'HEAD',   description: 'new commit of the reference' ],  \
    79                          [$class: 'StringParameterDefinition', name: 'GitRefOldValue', defaultValue: 'HEAD~1', description: 'old commit of the reference']]   \
    80                 ]] )
     76        // properties( [[$class: 'ParametersDefinitionProperty', parameterDefinitions: \
     77        //              [[$class: 'StringParameterDefinition', name: 'GitRefName',     defaultValue: 'master', description: 'name of the ref that changed' ], \
     78        //               [$class: 'StringParameterDefinition', name: 'GitRefNewValue', defaultValue: 'HEAD',   description: 'new commit of the reference' ],  \
     79        //               [$class: 'StringParameterDefinition', name: 'GitRefOldValue', defaultValue: 'HEAD~1', description: 'old commit of the reference']]   \
     80        //      ]] )
    8181
    8282        try {
     83
     84                sh 'git reflog > GIT_COMMIT'
     85                git_reflog = readFile('GIT_COMMIT')
     86                gitRefName = env.BRANCH_NAME
     87                gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
     88                gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
     89
    8390                echo "Properties-start"
    84                 echo "ref name      : ${GitRefName}"
    85                 echo "ref new value : ${GitRefNewValue}"
    86                 echo "ref old value : ${GitRefOldValue}"
     91                echo "ref name      : ${gitRefName}"
     92                echo "ref new value : ${gitRefNewValue}"
     93                echo "ref old value : ${gitRefOldValue}"
    8794                echo "Properties-stop"
    8895
Note: See TracChangeset for help on using the changeset viewer.