xref: /openbmc/openbmc-build-scripts/jenkins/build-seed (revision 17c69eda1542e82c537268ad2a4ce84caf569938)
1#!/bin/bash -xe
2#
3# Purpose:
4#  This script is responsible for building all CI machines to get a
5#  new CI systems sstate and download caches setup.
6#
7# This script assumes openbmc-build-scripts has been cloned into
8# the WORKSPACE directory.
9#
10# Required Inputs:
11#  WORKSPACE:      Directory to run the builds out of
12
13export LANG=en_US.UTF8
14
15cd "${WORKSPACE}"
16if [ -d openbmc ]; then
17    git -C openbmc fetch
18    git -C openbmc rebase
19else
20    git clone https://github.com/openbmc/openbmc.git
21fi
22
23# Ensure everything is built on same filesystem
24export build_dir="${WORKSPACE}/build"
25
26SEED_MACHINES=(
27    gsj
28    p10bmc
29    palmetto
30    romulus
31    tiogapass
32    witherspoon
33    yosemitev2
34    zaius
35)
36
37for m in "${SEED_MACHINES[@]}"; do
38    echo "Seeding $m"
39    export target=$m
40    "${WORKSPACE}/openbmc-build-scripts/build-setup.sh" || \
41        echo "Build failed for $m; continuing."
42    rm -rf "${WORKSPACE}/openbmc/build"
43    rm -rf "${build_dir}"
44done
45