xref: /openbmc/openbmc-build-scripts/jenkins/build-seed (revision 260e85deff1c60d0f0cb92a71bc9bffe83aa036b)
1d51439ffSAndrew Geissler#!/bin/bash -xe
2d51439ffSAndrew Geissler#
3d51439ffSAndrew Geissler# Purpose:
4d51439ffSAndrew Geissler#  This script is responsible for building all CI machines to get a
5d51439ffSAndrew Geissler#  new CI systems sstate and download caches setup.
6d51439ffSAndrew Geissler#
7d51439ffSAndrew Geissler# This script assumes openbmc-build-scripts has been cloned into
8d51439ffSAndrew Geissler# the WORKSPACE directory.
9d51439ffSAndrew Geissler#
10d51439ffSAndrew Geissler# Required Inputs:
11d51439ffSAndrew Geissler#  WORKSPACE:      Directory to run the builds out of
12d51439ffSAndrew Geissler
13d51439ffSAndrew Geisslerexport LANG=en_US.UTF8
14d51439ffSAndrew Geissler
15e000d5ddSPatrick Williamscd "${WORKSPACE}"
160775972cSPatrick Williamsif [ -d openbmc ]; then
170775972cSPatrick Williams    git -C openbmc fetch
180775972cSPatrick Williams    git -C openbmc rebase
190775972cSPatrick Williamselse
20d51439ffSAndrew Geissler    git clone https://github.com/openbmc/openbmc.git
210775972cSPatrick Williamsfi
22d51439ffSAndrew Geissler
23d51439ffSAndrew Geissler# Ensure everything is built on same filesystem
24e000d5ddSPatrick Williamsexport build_dir="${WORKSPACE}/build"
25d51439ffSAndrew Geissler
26247ae50aSPatrick WilliamsSEED_MACHINES=(
279968f96cSAndrew Geissler    ahe50dc
285b2f4ab5SAndrew Geissler    bletchley
295b2f4ab5SAndrew Geissler    e3c246d4i
3001370f2eSAndrew Geissler    gbs
31247ae50aSPatrick Williams    gsj
3217c69edaSAdriana Kobylak    p10bmc
33247ae50aSPatrick Williams    palmetto
349968f96cSAndrew Geissler    romed8hm3
35247ae50aSPatrick Williams    romulus
36247ae50aSPatrick Williams    tiogapass
37247ae50aSPatrick Williams    witherspoon
38247ae50aSPatrick Williams    yosemitev2
39*260e85deSPatrick Williams    yosemite4
40247ae50aSPatrick Williams    zaius
41247ae50aSPatrick Williams)
42247ae50aSPatrick Williams
43e000d5ddSPatrick Williamsfor m in "${SEED_MACHINES[@]}"; do
44e000d5ddSPatrick Williams    echo "Seeding $m"
45e000d5ddSPatrick Williams    export target=$m
466c420e74SPatrick Williams    "${WORKSPACE}/openbmc-build-scripts/build-setup.sh" || \
476c420e74SPatrick Williams        echo "Build failed for $m; continuing."
48e000d5ddSPatrick Williams    rm -rf "${WORKSPACE}/openbmc/build"
49124607f2SPatrick Williams    rm -rf "${build_dir}"
50e000d5ddSPatrick Williamsdone
51