A
Size: a a a
A
A
A
CI/CD-Environments/someenv
?AK
KI
BG
SP
AK
/opt/gitlab/embedded/service/gitlab-shell/hooks
pre-receive.d
туда закинуть 3 баш скрипта disable-force-push-develop.sh
AK
AK
#!/bin/sh
# <oldrev> <newrev> <refname>
# update a blame tree
while read oldrev newrev ref ; do
# old revision is blank - branch creation
if [ "$oldrev" = "0000000000000000000000000000000000000000" ] ||
# new revision is blank - branch deletion
[ "$newrev" = "0000000000000000000000000000000000000000" ] ||
# branch != develop - pass through
[ "$ref" != "refs/heads/develop" ] ;
then
# create new or delete old branch
continue;
fi
base=$(git merge-base $oldrev $newrev);
echo $ref >> /test.txt
if [ "$base" != "$oldrev" ] ; then
# non fast forward merge
echo "Force pushing of $ref is forbidden to master";
exit 1;
fi
done
AK
#!/bin/sh
# <oldrev> <newrev> <refname>
# update a blame tree
while read oldrev newrev ref ; do
# old revision is blank - branch creation
if [ "$oldrev" = "0000000000000000000000000000000000000000" ] ||
# new revision is blank - branch deletion
[ "$newrev" = "0000000000000000000000000000000000000000" ] ||
# branch != develop - pass through
[ "$ref" != "refs/heads/develop" ] ;
then
# create new or delete old branch
continue;
fi
base=$(git merge-base $oldrev $newrev);
echo $ref >> /test.txt
if [ "$base" != "$oldrev" ] ; then
# non fast forward merge
echo "Force pushing of $ref is forbidden to master";
exit 1;
fi
done
AK
SP
AK
YP
BG
YP