yocto-autobuilder-helper/scripts/buildhistory-init
Richard Purdie c3ff43bcbf Further development of the file
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-15 14:47:55 +00:00

647 B
Executable File

#!/bin/sh

Initialize Buildhistory for this branch

Called with $1 - The buildhistory directory

$2 - The remote repository url

$3 - The remote branch name

BUILDHISTDIR=$1 REMOTEREPO=$2 REMOTEBRANCH=$3

echo BH $@

exit 0

if [ ! -d $BUILDHISTDIR ]; then mkdir -p $BUILDHISTDIR git init $BUILDHISTDIR fi

if ! git ls-remote --exit-code $REMOTEREPO refs/heads/$REMOTEBRANCH > /dev/null; then cd $BUILDHISTDIR echo 'Initializing Repo' >> README git checkout -b $REMOTEBRANCH git add README git commit -s -m 'Initializing Repo' git push -q $REMOTEREPO $REMOTEBRANCH:$REMOTEBRANCH fi