Skip to content

Commit c44eb50

Browse files
committed
builder - allow automatic switching to different remote branch
ENV variables __builder_repo && __builder_branch are used to switch to another repository/branch for building. This is used to more easily build binaries before branches are merged into master. Primarily for SDL binaries, but simplifies testing for other modules.
1 parent fee0add commit c44eb50

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scriptmodules/admin/builder.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,24 @@ function chroot_build_builder() {
127127
mkdir -p "$scriptdir/$archive_dir" "$chroot_rps_dir/$archive_dir"
128128
rsync -av "$scriptdir/$archive_dir/" "$chroot_rps_dir/$archive_dir/"
129129
else
130-
rp_callModule image chroot "$chroot_dir" git -C /home/pi/RetroPie-Setup pull
130+
rp_callModule image chroot "$chroot_dir" bash -c "
131+
cd ~/RetroPie-Setup
132+
git checkout master
133+
git pull
134+
if git remote | grep -q builder; then
135+
git branch -D builder-branch
136+
git remote remove builder
137+
fi
138+
"
139+
# if we have a __builder_repo and __builder_branch set, check out the branch and use that
140+
if [[ -n "$__builder_repo" && "$__builder_branch" ]]; then
141+
rp_callModule image chroot "$chroot_dir" bash -c "
142+
cd ~/RetroPie-Setup
143+
git remote add builder $__builder_repo
144+
git fetch -q builder
145+
git checkout builder/$__builder_branch -b builder-branch
146+
"
147+
fi
131148
fi
132149

133150
for platform in $platforms; do

0 commit comments

Comments
 (0)