Skip to content

Commit

Permalink
Merge pull request #277 from f-laurens/pr277
Browse files Browse the repository at this point in the history
setup: make sure shallow clone is generated with adequate branch
  • Loading branch information
Olivier Mével authored Jun 12, 2021
2 parents c166980 + 8d5a647 commit 8c046ca
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions setup
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#!/bin/bash
set -uo pipefail
shopt -s extglob
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
IFS=$'\n\t'

# Source for this script:
# https://github.com/kr15h/travis-raspbian-image
# https://disconnected.systems/blog/custom-rpi-image-with-github-travis/

pynab_repository=${GITHUB_REPOSITORY:-nabaztag2018/pynab}
pynab_branch=${GITHUB_BRANCH:-release}
case ${pynab_branch} in
v+([0-9]).+([0-9]).+([0-9])*)
# vX.Y.Z tag-driven build: assume release branch
pynab_tag=" (tag ${pynab_branch})"
pynab_branch=release
;;
*)
# sssume branch-driven build on given branch
pynab_tag=""
;;
esac
echo "Doing setup for ${pynab_repository} ${pynab_branch} branch${pynab_tag}."

GPU_MEM=16
LC_ALL=C

Expand Down Expand Up @@ -105,11 +121,9 @@ make
sudo make install
make clean

repository=${GITHUB_REPOSITORY:-nabaztag2018/pynab}
branch=${GITHUB_BRANCH:-release}
echo "Cloning Pynab ${branch} branch from ${repository}."
echo "Cloning Pynab ${pynab_branch} branch from ${pynab_repository}."
cd /home/pi
sudo -u pi git clone --depth 1 -b ${branch} https://github.com/${repository}.git
sudo -u pi git clone --depth 1 -b ${pynab_branch} https://github.com/${pynab_repository}.git

echo "Installing NabBlockly."
sudo apt-get install --no-install-recommends -y erlang-base erlang-dev erlang-inets erlang-tools erlang-xmerl
Expand Down

0 comments on commit 8c046ca

Please sign in to comment.