1*b0a86db1SAndrew Geissler#!/bin/bash -xe
2*b0a86db1SAndrew Geissler#
3*b0a86db1SAndrew Geissler# Purpose:
4*b0a86db1SAndrew Geissler#  This script is responsible for setting up a openbmc/openbmc build
5*b0a86db1SAndrew Geissler#  environment for a meta-* repository.
6*b0a86db1SAndrew Geissler#
7*b0a86db1SAndrew Geissler# Required Inputs:
8*b0a86db1SAndrew Geissler#  WORKSPACE:      Directory which contains the extracted meta-*
9*b0a86db1SAndrew Geissler#                  layer test is running against
10*b0a86db1SAndrew Geissler#  GERRIT_PROJECT: openbmc/meta-* layer under test (i.e. openbmc/meta-phosphor)
11*b0a86db1SAndrew Geissler
12*b0a86db1SAndrew Geisslerexport LANG=en_US.UTF8
13*b0a86db1SAndrew Geisslercd $WORKSPACE
14*b0a86db1SAndrew Geissler
15*b0a86db1SAndrew Geissler# Grab this for the downstream job
16*b0a86db1SAndrew Geisslergit clone https://github.com/openbmc/openbmc-test-automation.git
17*b0a86db1SAndrew Geissler
18*b0a86db1SAndrew Geisslerexport META_REPO=`basename $GERRIT_PROJECT`
19*b0a86db1SAndrew Geissler
20*b0a86db1SAndrew Geissler# Move the extracted meta layer to a dir based on it's meta-* name
21*b0a86db1SAndrew Geisslermv $GERRIT_PROJECT $META_REPO
22*b0a86db1SAndrew Geissler
23*b0a86db1SAndrew Geissler# Clone openbmc/openbmc
24*b0a86db1SAndrew Geisslergit clone https://github.com/openbmc/openbmc.git
25*b0a86db1SAndrew Geissler
26*b0a86db1SAndrew Geissler# Make sure meta-* directory is there
27*b0a86db1SAndrew Geisslermkdir -p ./openbmc/$META_REPO/
28*b0a86db1SAndrew Geissler
29*b0a86db1SAndrew Geissler# Clean out the dir to handle delete/rename of files
30*b0a86db1SAndrew Geisslerrm -rf ./openbmc/$META_REPO/*
31*b0a86db1SAndrew Geissler
32*b0a86db1SAndrew Geissler# Copy the extracted meta code into it
33*b0a86db1SAndrew Geisslercp -Rf $META_REPO/* ./openbmc/$META_REPO/
34*b0a86db1SAndrew Geissler
35*b0a86db1SAndrew Geissler# Create a dummy commit so code update will pick it up
36*b0a86db1SAndrew Geisslercd openbmc
37*b0a86db1SAndrew Geisslergit add -A && git commit -m "Dummy commit to cause code update"
38