Merge pull request #1443 from kauden/patch-2

Accelerate map_uidgid
This commit is contained in:
Sameer Naik 2020-05-06 14:36:49 +05:30 committed by GitHub
commit 780e8d455b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1316,7 +1316,7 @@ map_uidgid() {
echo "Mapping UID and GID for ${GITLAB_USER}:${GITLAB_USER} to $USERMAP_UID:$USERMAP_GID"
groupmod -o -g ${USERMAP_GID} ${GITLAB_USER}
sed -i -e "s|:${USERMAP_ORIG_UID}:${USERMAP_GID}:|:${USERMAP_UID}:${USERMAP_GID}:|" /etc/passwd
find ${GITLAB_HOME} -path ${GITLAB_DATA_DIR}/\* -prune -o -print0 | xargs -0 chown -h ${GITLAB_USER}:
find ${GITLAB_HOME} -path ${GITLAB_DATA_DIR}/\* \( ! -uid ${USERMAP_ORIG_UID} -o ! -gid ${USERMAP_ORIG_GID} \) -print0 | xargs -0 chown -h ${GITLAB_USER}: ${GITLAB_HOME}
fi
}