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 "/^${CI_COMMIT_REF_NAME}$/p")
echo${REMOTE_BRANCH}
if["$REMOTE_BRANCH"=""];then
echo"This is the first build on this branch, creating new branch in build repository to push to"
git checkout --orphan ${CI_COMMIT_REF_NAME}-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 rm -rf