Skip to content

Commit

Permalink
Merge pull request #81 from hrw/2022/ci-improvements
Browse files Browse the repository at this point in the history
CI related improvements
  • Loading branch information
hrw authored Aug 3, 2022
2 parents 0a0c89d + b229f54 commit 7f5471e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-cirros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
ARCHES: ${{ matrix.arch }}
BOOTTEST: "true"
QUIET: 1
CI_BUILD: "true"
CI_BUILD_OUT: "build-ci/"

steps:
- name: Pull cirros source artifacts
Expand Down Expand Up @@ -51,4 +53,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: cirros-${{ matrix.arch }}
path: release/
path: build-ci/release/
33 changes: 26 additions & 7 deletions bin/build-release
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ MY_D=${ME%/*}
PATH=${MY_D}:$PATH
QUIET=${QUIET:-}
BOOTTEST=${BOOTTEST:-false}
CI_BUILD=${CI_BUILD:-false}
CI_BUILD_OUT=${CI_BUILD_OUT:-}

case "$BOOTTEST" in
true|false) :;;
*) echo "Unknown value for BOOTTEST: ${BOOTTEST}"; exit 1;;
esac

case "$CI_BUILD" in
true|false) :;;
*) echo "Unknown value for CI_BUILD: ${CI_BUILD}"; exit 1;;
esac

MAKE_QUIET=
if [ ! -z $QUIET ]; then
MAKE_QUIET="-s"
Expand All @@ -53,7 +60,11 @@ fi
set -e
set -o pipefail

OUT="$PWD/../build-$VER"
if [ "$CI_BUILD" = "true" ]; then
OUT="$PWD/$CI_BUILD_OUT"
else
OUT="$PWD/../build-$VER"
fi
LOGFILE="$OUT/date.txt"
export TMPDIR="$OUT/tmp"
mkdir -p "$OUT" "$TMPDIR"
Expand Down Expand Up @@ -143,9 +154,13 @@ tstart=${_RET}

# Stage 1: DOWNLOAD
logevent "start download" -
rm -f download
mkdir -p ../download
ln -snf ../download download
if [ "$CI_BUILD" = "true" ]; then
mkdir -p download
else
rm -f download
mkdir -p ../download
ln -snf ../download download
fi
brtgz="buildroot-${BR_VER}.tar.gz"
dl "http://buildroot.uclibc.org/downloads/$brtgz" "download/$brtgz"
logevent "end download"
Expand All @@ -167,7 +182,7 @@ echo "$VER" > "src/etc/cirros/version"
logevent "end unpack"

logevent "start br-source" -
make $MAKE_QUIET ARCH=${ARCHES%% *} br-source
make $MAKE_QUIET ARCH=${ARCHES%% *} "OUT_D=$OUT/build/$arch" br-source
logevent "end br-source"

logevent "start kernel and grub downloads" -
Expand Down Expand Up @@ -199,8 +214,12 @@ logevent "end kernel and grub downloads" "$kstart"
# STAGE 2: BUILD
jobs_flag=""
parallel=true
mkdir -p ../ccache
ln -snf ../ccache ccache
if [ "$CI_BUILD" = "true" ]; then
mkdir -p ccache
else
mkdir -p ../ccache
ln -snf ../ccache ccache
fi
case "${CIRROS_PARALLEL:-none}" in
none) parallel=false;;
0|true) :;;
Expand Down

0 comments on commit 7f5471e

Please sign in to comment.