blob: e3078e2564a7fe5889820e76ee51fa4de588d234 [file] [log] [blame]
Jan Kundráta4fbff22019-03-01 11:03:21 +01001#!/bin/bash
2
3set -eux -o pipefail
4shopt -s failglob
5
6ZUUL_JOB_NAME=$(jq < ~/zuul-env.json -r '.job')
7ZUUL_PROJECT_SRC_DIR=$HOME/$(jq < ~/zuul-env.json -r '.project.src_dir')
8ZUUL_PROJECT_SHORT_NAME=$(jq < ~/zuul-env.json -r '.project.short_name')
Jan Kundrát11a48c62019-03-08 14:44:53 +01009CI_PARALLEL_JOBS=$(awk -vcpu=$(getconf _NPROCESSORS_ONLN) 'BEGIN{printf "%.0f", cpu*1.3+1}')
Jan Kundráta4fbff22019-03-01 11:03:21 +010010
11BUILD_DIR=~/build
12mkdir ${BUILD_DIR}
13cd ${BUILD_DIR}
14
15${ZUUL_PROJECT_SRC_DIR}/dev-setup-git.sh
16
17if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then
18 make czechlight_clearfog_defconfig
Jan Kundrát6100cf92019-12-05 16:01:33 +010019elif [[ "${ZUUL_JOB_NAME}" =~ beagleboneblack ]]; then
20 make czechlight_beaglebone_defconfig
Jan Kundráta4fbff22019-03-01 11:03:21 +010021else
22 echo "Unrecognized job name, cannot determine defconfig target"
23 exit 1
24fi
25
Jan Kundrátf5a026c2019-06-06 17:01:35 +020026echo BR2_PRIMARY_SITE=\"https://object-store.cloud.muni.cz/swift/v1/ci-artifacts-public/mirror/buildroot\" >> .config
Jan Kundrát11a48c62019-03-08 14:44:53 +010027make source -j${CI_PARALLEL_JOBS} --output-sync=target
Jan Kundráta4fbff22019-03-01 11:03:21 +010028
Jan Kundrát623bf872019-10-23 18:37:36 +020029make -j${CI_PARALLEL_JOBS} --output-sync=target rootfs-czechlight-rauc
Jan Kundráta4fbff22019-03-01 11:03:21 +010030mv images/update.raucb ~/zuul-output/artifacts/
31
32if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then
33 mv images/u-boot-spl.kwb ~/zuul-output/artifacts/
34fi
35
36# TODO: USB image as well? (`fallocate -d` to make it sparse)
37# TODO: make legal-info