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