blob: 16c4f7154a95e7db25b9df6d395a146a53531689 [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
19else
20 echo "Unrecognized job name, cannot determine defconfig target"
21 exit 1
22fi
23
Jan Kundrátf5a026c2019-06-06 17:01:35 +020024echo 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 +010025make source -j${CI_PARALLEL_JOBS} --output-sync=target
Jan Kundráta4fbff22019-03-01 11:03:21 +010026
Jan Kundrát11a48c62019-03-08 14:44:53 +010027make -j${CI_PARALLEL_JOBS} --output-sync=target
Jan Kundráta4fbff22019-03-01 11:03:21 +010028mv images/update.raucb ~/zuul-output/artifacts/
29
30if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then
31 mv images/u-boot-spl.kwb ~/zuul-output/artifacts/
32fi
33
34# TODO: USB image as well? (`fallocate -d` to make it sparse)
35# TODO: make legal-info