travis build script: retrieve old builds from orgin

This commit is contained in:
Maximilian Keßler 2021-10-22 09:57:47 +02:00
parent 0bde1c9cc5
commit 75149559e3

View file

@ -1,19 +1,19 @@
# ! /bin/sh # ! /bin/sh
TRAVIS_BRANCH=algebraic-geometr TRAVIS_BRANCH=algebraic-geometry
rm -rf LatexPackagesBuild rm -rf LatexPackagesBuild
git clone https://github.com/kesslermaximilian/LatexPackagesBuild.git LatexPackagesBuild git clone https://github.com/kesslermaximilian/LatexPackagesBuild.git LatexPackagesBuild
cd LatexPackagesBuild cd LatexPackagesBuild
FOUND=$(git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n "/^${TRAVIS_BRANCH}$/p") REMOTE_BRANCH=$(git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n "/^${TRAVIS_BRANCH}$/p")
echo ${FOUND} echo ${REMOTE_BRANCH}
if [ "$FOUND" = "" ];then if [ "$REMOTE_BRANCH" = "" ];then
git checkout --orphan ${TRAVIS_BRANCH}-build git checkout --orphan ${TRAVIS_BRANCH}-build
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r git rm --cached ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r git rm --cached
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r rm -rf ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r rm -rf
else else
echo "found" echo "found"
git checkout -b ${FOUND}-build origin/${FOUND}-build git checkout -b ${REMOTE_BRANCH}-build origin/${REMOTE_BRANCH}-build
fi fi