Project

General

Profile

Bug #4243

master-simtrace2 failed to build from October 19 onwards: $WORKSPACE environment missing

Added by laforge about 1 month ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
10/30/2019
Due date:
% Done:

100%

Spec Reference:

Description

When we write a "contrib/jenkins.sh" job, we assume that all the jenkins environment variables as documented at https://wiki.jenkins.io/display/JENKINS/Building+a+software+project are available to the script. In the specific case, $WORKSPACE was used, which failed after the job had been moved inside docker.

I think it's generally a good idea to make sure all the jenkins environment variables as described at the link above are passed into the docker container, so authors of contrib/jenkins.sh don't have to consider undocumented osmocom-docker-specific restrictions but can use the normal set of environment variables..

For $WORKSPACE, it's questionable what to do. Probably best we mount it into the docker container, and then specify that mount point as "-e WORKSPACE"?

History

#1 Updated by osmith 14 days ago

I would prefer if jenkins.sh scripts tried to avoid using these variables. Because the more jenkins specific variables they use, the more effort it is to run the jenkins.sh script locally, outside of jenkins, for testing (as one has to provide dummy values for all of them). And the more room there is for errors, when getting one of the variables wrong and having the script potentially taking a different code path.

With that in mind, I would not pass any of these variables to docker.

Is that fine with you?

#2 Updated by laforge 12 days ago

you have a valid point. However, the problem is we then have to specify what kind of assumptions we can make when writing those scripts. For example, using "/build" suffers from exactly the same problem as you describe, just that instead of $WORKSPACE (which you as the user can override) you now have to locally create a /build directory and give write permissions for your local user to it :/

#3 Updated by osmith 9 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 90

I have updated the wiki page "Jenkins build verification jobs" to list all available environment variables:

https://osmocom.org/projects/osmocom-servers/wiki/Jenkins_build_verification_jobs

Here is a patch to add it to the yml files, so we remember to keep them in sync:

https://gerrit.osmocom.org/c/osmo-ci/+/16461

#4 Updated by osmith 8 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)