Changeset 8a63547 for Jenkinsfile


Ignore:
Timestamp:
Jun 6, 2016, 11:44:19 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
57aa6f5
Parents:
b67dc146
Message:

Jenkinsfile now uses git reflog instead of build parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rb67dc146 r8a63547  
    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.