From 05ee40d778e4d19e631f38877cebc2af447b53c7 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 30 Jan 2023 16:06:46 +0000 Subject: [PATCH] FIX: Perform git operations as owning user (#672) The `git` version in our discourse_test docker image was recently updated to include a permissions check before running any git commands. For this to pass, git operations must be performed by the user which owns the git repository's directory. --- templates/web.template.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index 9e645e6..e574210 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -86,12 +86,12 @@ run: cd: $home hook: code cmd: - - git reset --hard - - git clean -f - - git remote set-branches --add origin main - - git remote set-branches origin $version - - git fetch --depth 1 origin $version - - git checkout $version + - sudo -H -E -u discourse git reset --hard + - sudo -H -E -u discourse git clean -f + - sudo -H -E -u discourse git remote set-branches --add origin main + - sudo -H -E -u discourse git remote set-branches origin $version + - sudo -H -E -u discourse git fetch --depth 1 origin $version + - sudo -H -E -u discourse git checkout $version - mkdir -p tmp - chown discourse:www-data tmp - mkdir -p tmp/pids -- 2.25.1