speed up script

This commit is contained in:
Lukas Ziegler 2022-03-19 15:00:02 +01:00
parent d33d30be97
commit df214e419a

View File

@ -3,38 +3,30 @@
apk update apk update
apk add jq apk add jq
for i in {1..3}; do for a in 2.0 2.0-upstream 2.0-fixed; do
repos=$(curl -s "https://gitlab.com/api/v4/groups/flectra-community/projects?per_page=100&page=${i}") git checkout ${a}
git config --global merge.ours.driver true for i in {1..3}; do
for row in $(echo "${repos}" | jq -r '.[] | @base64'); do repos=$(curl -s "https://gitlab.com/api/v4/groups/flectra-community/projects?per_page=100&page=${i}")
_jq() { git config --global merge.ours.driver true
echo ${row} | base64 --decode | jq -r ${1} for row in $(echo "${repos}" | jq -r '.[] | @base64'); do
} _jq() {
url=$(_jq '.http_url_to_repo') echo ${row} | base64 --decode | jq -r ${1}
name=$(_jq '.name') }
url=$(_jq '.http_url_to_repo')
name=$(_jq '.name')
echo ${name} echo ${name}
echo ${url} echo ${url}
if [ $name != 'l10n_switzerland' ] if [ $name != 'l10n-switzerland' ]
then then
git remote add $name $url git remote add $name $url
git fetch $name git fetch $name
git checkout 2.0 git merge --no-edit --allow-unrelated-histories $name/${a}
git merge --no-edit --allow-unrelated-histories $name/2.0 git remote remove $name
git checkout 2.0-fixed fi
git merge --no-edit --allow-unrelated-histories $name/2.0-fixed done
git checkout 2.0-upstream
git merge --no-edit --allow-unrelated-histories $name/2.0-upstream
git checkout 1.0
git merge --no-edit --allow-unrelated-histories $name/1.0
git checkout 1.0-fixed
git merge --no-edit --allow-unrelated-histories $name/1.0-fixed
git checkout 1.0-upstream
git merge --no-edit --allow-unrelated-histories $name/1.0-upstream
git remote remove $name
git gc --prune=now
fi
done done
git gc --prune=now
done done
git push --all git push --all