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