2018-05-13 23:12:30 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e -x
|
|
|
|
|
|
|
|
source default-config
|
|
|
|
|
|
|
|
if [[ "$SOURCES_METHOD" == "clone" ]]; then
|
2018-05-14 18:49:51 +00:00
|
|
|
./install-os-packages.sh git
|
2018-05-13 23:12:30 +00:00
|
|
|
SOURCES_DIR="${WORKSPACE}/sources"
|
|
|
|
mkdir -p "${SOURCES_DIR}"
|
|
|
|
git clone --recursive --branch "$SOURCES_BRANCH" "$SOURCES_CLONE_URL" "${SOURCES_DIR}"
|
|
|
|
pushd "${SOURCES_DIR}"
|
2018-05-14 18:49:51 +00:00
|
|
|
git checkout --recurse-submodules "$SOURCES_COMMIT"
|
2018-05-13 23:12:30 +00:00
|
|
|
popd
|
|
|
|
elif [[ "$SOURCES_METHOD" == "local" ]]; then
|
|
|
|
ln -f -s "${PROJECT_ROOT}" "${WORKSPACE}/sources"
|
|
|
|
else
|
|
|
|
die "Unknown SOURCES_METHOD"
|
|
|
|
fi
|