Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Agent.BuildDirectory instead of Agent.WorkFolder #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grotkiv
Copy link

@grotkiv grotkiv commented Apr 21, 2022

Agent.WorkFolder is not mounted as docker volume by Azure Pipelines, if
containers are used. This causes the SynopsisDetectTask to fail because
the detect folder cannot be created.

This commit changes the WorkingDirectory to Agent.BuildDirectory. The
detect folder can be created and the detect script can be downloaded
properly even from a container.

Agent.WorkFolder is not mounted as docker volume by Azure Pipelines, if
containers are used. This causes the SynopsisDetectTask to fail because
the detect folder cannot be created.

This commit changes the WorkingDirectory to Agent.BuildDirectory. The
detect folder can be created and the detect script can be downloaded
properly even from a container.
@grotkiv grotkiv marked this pull request as ready for review May 18, 2022 13:03
@grotkiv
Copy link
Author

grotkiv commented May 18, 2022

Unfortunately, I'm not able to test this patch in our environment properly. Because the patch is just using another azure variable, I assumed it would be fine. As a quick fix this patch might be sufficient and helps others to get their container jobs running again. But the correct solution might be to use the Agent.ToolDirectory to download/install the detect.sh script.

In the meanwhile my workaround is to create a local directory (e.g. /home/build/synopsisDetect) on my build agents and mount this path as volume for my container job:

- job: Blackduck
  container:
    image: some-image:latest
    volumes:
    - /home/build/synopsisDetect:$(Agent.WorkFolder)/detect

Ensure the folder is writeable by the build user from within the container. This way the detect folder already exists and the detect script can be stored properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant