mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00
40 lines
934 B
Bash
Executable File
40 lines
934 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Called with $1 - The target name
|
|
# $2 - The buildhistory directory
|
|
# $3 - The remote repository url
|
|
# $4 - The remote branch name
|
|
#
|
|
TARGETNAME=$1
|
|
BUILDHISTDIR=$2
|
|
REMOTEREPO=$3
|
|
REMOTEBRANCH=$4
|
|
|
|
echo BH $@
|
|
|
|
exit 0
|
|
|
|
# Example code dumped from an existing nightly-arm buildhistory step for reference
|
|
|
|
if [ ! -d $BUILDHISTDIR ]; then
|
|
mkdir -p $BUILDHISTDIR
|
|
git init $BUILDHISTDIR
|
|
fi
|
|
|
|
rm -rf $BUILDHISTDIR
|
|
mkdir -p $BUILDHISTDIR
|
|
git init $BUILDHISTDIR
|
|
|
|
if git ls-remote --exit-code $REMOTEREPO refs/heads/$REMOTEBRANCH> /dev/null; then
|
|
git push -q $REMOTEREPO :$REMOTEBRANCH
|
|
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
|