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 |
| 19 | else |
| 20 | echo "Unrecognized job name, cannot determine defconfig target" |
| 21 | exit 1 |
| 22 | fi |
| 23 | |
Jan Kundrát | f5a026c | 2019-06-06 17:01:35 +0200 | [diff] [blame] | 24 | 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] | 25 | make source -j${CI_PARALLEL_JOBS} --output-sync=target |
Jan Kundrát | a4fbff2 | 2019-03-01 11:03:21 +0100 | [diff] [blame] | 26 | |
Jan Kundrát | 623bf87 | 2019-10-23 18:37:36 +0200 | [diff] [blame] | 27 | make -j${CI_PARALLEL_JOBS} --output-sync=target rootfs-czechlight-rauc |
Jan Kundrát | a4fbff2 | 2019-03-01 11:03:21 +0100 | [diff] [blame] | 28 | mv images/update.raucb ~/zuul-output/artifacts/ |
| 29 | |
| 30 | if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then |
| 31 | mv images/u-boot-spl.kwb ~/zuul-output/artifacts/ |
| 32 | fi |
| 33 | |
| 34 | # TODO: USB image as well? (`fallocate -d` to make it sparse) |
| 35 | # TODO: make legal-info |