JOB_WORKSPACE should be ONEDEV_WORKSPACE in run container step help (OD-1484)
doubleplusc opened 2 years ago

I am extremely new to Docker so apologies if I am missing something obvious.

My OneDev instance is running in a Docker container. I have a set of published artifacts in the job workspace that I want to process in another Docker container. That container starts inside the home directory.

I don't quite understand how to use the environment variable JOB_WORKSPACE as explained in the Run Docker Container step type. I cannot use @JOB_WORKSPACE@, ${JOB_WORKSPACE}, or $JOB_WORKSPACE in Working Directory. Is the variable supposed to be manually set or referenced in a different way?

  • Robin Shen commented 2 years ago

    You may use job dependency to retrieve published artifacts of another job into workspace of current job.

  • Robin Shen commented 2 years ago
  • doubleplusc commented 2 years ago

    Thanks for your response, Robin. Much headbanging later, I sort of figured out the issue.

    In the second job, my container default directory is /. For debug purposes I have a bash container that runs ls. I have to go into /onedev-build/workspace to access the artifacts.

    My question is now a little different. For running separate Docker containers, is putting /onedev-build/workspace as the working directory the expectation? Where does the env var JOB_WORKSPACE tie into all of this? The note at the top is somewhat misleading if setting the proper working directory has nothing to do with JOB_WORKSPACE.

    i.imgur.com/LdZKz5O.png

  • Robin Shen commented 2 years ago

    Sorry there is a mistake here. The environment varibale should be ONEDEV_WORKSPACE instead of JOB_WORKSPACE here. It points to /onedev-build/workspace which will always be mounted to contain job workspace files (shared with other steps).

    Another approach is to mount the job workspace into your container via volume mounts. To mount job workspace itself, specify the source path as .

  • Robin Shen changed fields 2 years ago
    Name Previous Value Current Value
    Type
    Support Request
    Bug
    Affected Versions
    empty
    <=8.6.2
  • Robin Shen changed title 2 years ago
    Previous Value Current Value
    Using JOB_WORKSPACE in Run Docker Containers step
    JOB_WORKSPACE should be ONEDEV_WORKSPACE in run container step help
  • Robin Shen changed fields 2 years ago
    Name Previous Value Current Value
    Affected Versions
    <=8.6.2
    <=8.6.3
  • Robin Shen changed fields 2 years ago
    Name Previous Value Current Value
    Priority
    Normal
    Minor
  • doubleplusc commented 2 years ago

    Awesome, thanks for looking into it!

  • OneDev changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 2 years ago

    State changed as code fixing the issue is committed (94979a94)

  • OneDev changed state to 'Released' 2 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 2 years ago

    State changed as build #3946 is successful

issue 1/1
Type
Bug
Priority
Minor
Assignee
Affected Versions
<=8.6.3
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-1484
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover