Specify owner of cloned files in Pipelines builds

XMLWordPrintable

      Problem Definition

      In Pipelines builds that run on Atlassian's infrastructure, the owner of the cloned files is always root even when using the run-as-user option.

      This may create issues for users who need the owner to be a different user. One use case is starting a container within the build container, where the user is not root. A volume is shared with this new container, so permissions problems arise when the owner of the cloned files is root.

      Suggested Solution

      Provide an option to users to specify the owner of the cloned files in a Pipelines build.

      Workaround

      If pipelines is the name of a user and a group in the Docker image used as a build container, it is possible to change ownership of the files in the Bitbucket clone directory to this user and group by using a command like the following in the bitbucket-pipelines.yml file:

      - sudo chown -R pipelines:pipelines /opt/atlassian/pipelines/agent/build
      

            Assignee:
            Unassigned
            Reporter:
            Theodora Boudale (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: