pipeline.groovy
changeset 96 12b2d2bbd417
parent 90 9f574fad295d
parent 80 c213d491e876
child 103 fda494c2564b
equal deleted inserted replaced
95:c313d3ec37f8 96:12b2d2bbd417
    32                         if [ -f Jenkinsfile.rb ]; then
    32                         if [ -f Jenkinsfile.rb ]; then
    33                             hg pull ${scm.getSource()}
    33                             hg pull ${scm.getSource()}
    34                         else
    34                         else
    35                             hg clone ${scm.getSource()} .
    35                             hg clone ${scm.getSource()} .
    36                         fi
    36                         fi
    37                         hg up ${scm.getBranch()}
    37                         hg up ${branch()}
    38                         """
    38                         """
    39                     sh  "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --arch ${env.ARCH}  update"
    39                     sh  "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --arch ${env.ARCH}  update"
    40                 }
    40                 }
    41             }
    41             }
    42 
    42 
   152             sh "rake \"workflow:push-upstream[${user}, ${pass}]\""
   152             sh "rake \"workflow:push-upstream[${user}, ${pass}]\""
   153         }
   153         }
   154     }
   154     }
   155 }
   155 }
   156 
   156 
   157 
       
   158 
       
   159 
       
   160 /*
   157 /*
   161  * A test pipeline. Does not build anything but usefull for
   158  * A helper function to return a currently used Rakefiles
   162  * testing configuration and matrix() / any() functions
   159  * branch.
       
   160  *
       
   161  * For normal jobs this is the value of 'Branch'
       
   162  * field from SCM configuration.
       
   163  *
       
   164  * For multibranch jobs, this is the value of BRANCH_NAME environment
       
   165  * variable.
   163  */
   166  */
   164 def test_pipeline() {
   167 def branch() {
   165     matrix( configurations ) {
   168     if (env.BRANCH_NAME == null) {
   166         echo "Testing matrix() ${env.NODE}, ${env.ARCH}"
   169         return scm.getBranch();
   167     }
   170     } else {
   168 
   171         return env.BRANCH_NAME;
   169     any ( configurations ) {
       
   170         echo "Testing any() ${env.NODE}, ${env.ARCH}"
       
   171     }
   172     }
   172 }
   173 }
   173 
   174 
       
   175 
   174 return this;
   176 return this;