Hello, I am building my windows software on Linux. It involves using jenkins to checkout source code, then using a windows VM with a mounted folder to run msbuild (visual studio) to compile the project.
I have jenkins running inside a docker container to checkout the source files, then the folder containing the source is mounted to the VM where the build runs.
The source code ends up being owned as ‘ubuntu’ (uid 1000) and the VM performing the build is running as another user, lets say ‘dave’. Unfortunately ‘dave’ cannot write the build directory so the build fails on the VM.
I have been reading online and come across various different suggestions for how to solve this:
- bindfs mount
- chmod + chown after checkout
- run jenkins as another user
- maybe something else?
I don’t know which approach is the correct solution, how do I ensure the files that jenkins checks out are owned by the user that needs to do the build?
What is the ‘correct’ solution for this?