# Pastebin 5EpJXbLj #!/bin/bash if [ "$#" -lt 2 ]; then echo "Usage: $0 TAG [--no-clean] [--upstream UPSTREAM] [--branch BRANCH]" exit 1 fi # Check that we're in the U-Boot directory if [ ! -d api ]; then echo Must be run from the U-Boot source directory exit 1 fi LOG=$HOME/logs/`git describe --abbrev=0`/`date +"%Y-%m-%d-%H%M"`.txt BRANCH=master UPSTREAM=master NOCLEAN= while test $# -gt 1; do if [ "$1" == "--branch" ]; then BRANCH=$2 shift 2 elif [ "$1" == "--upstream" ]; then UPSTREAM=$2 shift 2 elif [ "$1" == "--no-clean" ]; then NOCLEAN=$1 shift 1 fi done # Fetch the updates and reset to tag git clean -dfxq git worktree prune git checkout master git reset --hard master git branch -D ${BRANCH} || true git fetch --prune origin git checkout ${BRANCH} git branch -u origin/${UPSTREAM} # Run the build if [ -f .gitlab-ci.yml ]; then IMG=`grep image: .gitlab-ci.yml | cut -d ' ' -f 2` else IMG=`git grep image: origin/master -- .gitlab-ci.yml | cut -d ' ' -f 2` fi sudo docker run --rm -it --pull=missing \ -u 1003:1003 \ -v /build/trini:/build/trini \ -v /home/trini:/home/trini \ -w /home/trini/u-boot/u-boot \ -e HOME=/home/trini -e USER=trini \ $IMG /home/trini/bin/uboot-world-build.sh $NOCLEAN \ --upstream $UPSTREAM --branch $BRANCH $LOG # Read the log less $LOG