2016-04-24 09:24:30 +00:00
|
|
|
#!/bin/sh
|
2016-12-10 23:58:00 +00:00
|
|
|
set -ex
|
2017-10-27 20:31:14 +00:00
|
|
|
project="$1"
|
|
|
|
branch="${2:-origin/master}"
|
2016-04-24 09:24:30 +00:00
|
|
|
|
2017-10-27 20:31:14 +00:00
|
|
|
if ! test -d "$project";
|
2016-04-24 09:24:30 +00:00
|
|
|
then
|
2017-10-27 20:31:14 +00:00
|
|
|
git clone "git://git.osmocom.org/$project" "$project"
|
2016-04-24 09:24:30 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-27 20:31:14 +00:00
|
|
|
cd "$project"
|
2016-04-24 09:24:30 +00:00
|
|
|
git fetch origin
|
add osmo-clean-workspace.sh, use in osmo-deps.sh
So far, each jenkins job does its own cleanup, more or less well. Also, jenkins
git config offers the 'Clean before checkout' option, which seems to fail when
there are non-writable leftovers from a failed 'make distcheck'.
Furthermore, our jenkins build slaves have unused compiled binaries piling up
by the gigabytes: each matrix build x each parallel build and each compiled
dependency therein builds .o, .a, .so and executables plus installs them to a
local prefix, and just leaves them sitting around to rot until the job runs
again. Instead, we want to clean them out when building is done.
All of this calls for a unified cleanup script that knows how to clean a
workspace properly, to run once before and once after each jenkins build.
Here it is.
Use that function in osmo-deps.sh instead of duplicating cleanup steps.
Change-Id: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
2017-10-27 20:10:17 +00:00
|
|
|
|
|
|
|
# Cleanup should already have happened during a global osmo-clean-workspace.sh,
|
|
|
|
# but in case the caller did not (want to) call that, let's also do cleanup in
|
|
|
|
# the dep subdir separately:
|
|
|
|
osmo-clean-workspace.sh
|
|
|
|
|
2017-10-27 20:31:14 +00:00
|
|
|
git reset --hard "$branch"
|
2016-12-11 00:02:07 +00:00
|
|
|
git rev-parse HEAD
|