Changeset fc664b9 in OpenModelica


Ignore:
Timestamp:
2018-08-09T13:40:14+02:00 (6 years ago)
Author:
Martin Sjölund <martin+github@…>
Branches:
Added-citation-metadata, maintenance/v1.13, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
5e22e1b4
Parents:
9207981
git-author:
Martin Sjölund <martin.sjolund@…> (08/09/18 13:09:43)
git-committer:
Martin Sjölund <martin+github@…> (08/09/18 13:40:14)
Message:

Jenkins does not inherit env.vars

Use a function instead of env.variable to calculate the name of the
branch instead of using a top-level environment variable since it
might not be inherited properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r9207981 rfc664b9  
    66  environment {
    77    LC_ALL = 'C.UTF-8'
    8     CACHE_BRANCH = "${env.CHANGE_TARGET ?: env.GIT_BRANCH}"
    98  }
    109  // stages are ordered according to execution time; highest time first
     
    431430void makeLibsAndCache(libs='core') {
    432431  // If we don't have any result, copy to the master to get a somewhat decent cache
    433   sh "cp -f ${env.RUNTESTDB}/${env.CACHE_BRANCH}/runtest.db.* testsuite/ || " +
     432  sh "cp -f ${env.RUNTESTDB}/${cacheBranch()}/runtest.db.* testsuite/ || " +
    434433     "cp -f ${env.RUNTESTDB}/master/runtest.db.* testsuite/ || true"
    435434  // env.WORKSPACE is null in the docker agent, so link the svn/git cache afterwards
     
    478477  sh "test -f ${env.COMPLIANCEPREFIX}.xml"
    479478  // Only publish openmodelica-current.html if we are running master
    480   sh "cp -p ${env.COMPLIANCEPREFIX}-current.html ${env.COMPLIANCEPREFIX}${env.CACHE_BRANCH=='master' ? '' : ('-' + env.CACHE_BRANCH).replace('/','-')}-${getVersion()}.html"
    481   sh "test ! '${env.CACHE_BRANCH}' = 'master' || rm -f ${env.COMPLIANCEPREFIX}-current.html"
     479  sh "cp -p ${env.COMPLIANCEPREFIX}-current.html ${env.COMPLIANCEPREFIX}${cacheBranch()=='master' ? '' : ('-' + cacheBranch()).replace('/','-')}-${getVersion()}.html"
     480  sh "test ! '${cacheBranch()}' = 'master' || rm -f ${env.COMPLIANCEPREFIX}-current.html"
    482481  stash name: "${env.COMPLIANCEPREFIX}", includes: "${env.COMPLIANCEPREFIX}-*.html"
    483482  archiveArtifacts "${env.COMPLIANCEPREFIX}*${getVersion()}.html, ${env.COMPLIANCEPREFIX}.failures"
     
    487486}
    488487
     488def cacheBranch() {
     489  return "${env.CHANGE_TARGET ?: env.GIT_BRANCH}"
     490}
     491
    489492/* Note: If getting "Unexpected end of /proc/mounts line" , flatten the docker image:
    490493 * https://stackoverflow.com/questions/46138549/docker-openmpi-and-unexpected-end-of-proc-mounts-line
Note: See TracChangeset for help on using the changeset viewer.