2016-04-24 09:24:30 +00:00
|
|
|
#!/bin/sh
|
scripts/osmo-deps.sh: use osmo_git_clone_url
Instead of hardcoding https://git.osmocom.org for all clones, use
the osmo_git_clone_url function. This clones via https from gerrit where
possible, it should fix the many errors we are currently seeing from
the master-openbsc job:
+ osmo-deps.sh libosmo-sccp
+ project=libosmo-sccp
+ branch=master
+ git branch -a
+ grep -c remotes/origin/master$
+ [ x1 != x0 ]
+ branch=origin/master
+ test -d libosmo-sccp
+ git clone https://git.osmocom.org/libosmo-sccp libosmo-sccp
Cloning into 'libosmo-sccp'...
error: HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error (curl_result = 92, http_code = 0, sha1 = d23e38020fdbb685570145acd3a35e22a5a91344)
error: HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error (curl_result = 92, http_code = 0, sha1 = 68b450098714e3015a65b6628a7e61ac09dd4d47)
error: Unable to find 68b450098714e3015a65b6628a7e61ac09dd4d47 under https://git.osmocom.org/libosmo-sccp
Cannot obtain needed tree 68b450098714e3015a65b6628a7e61ac09dd4d47
while processing commit d23e38020fdbb685570145acd3a35e22a5a91344.
error: fetch failed.
Related: https://lists.osmocom.org/hyperkitty/list/openbsc@lists.osmocom.org/thread/RHMXTPTKU2SPGCVXF55RFJQ5GYBZ46CO/
Change-Id: I700d608ff74eca3981ed41f04ee9ced9629436aa
2022-08-22 11:59:53 +00:00
|
|
|
. "$(dirname "$0")/common.sh"
|
2016-12-10 23:58:00 +00:00
|
|
|
set -ex
|
2017-10-27 20:31:14 +00:00
|
|
|
project="$1"
|
2018-03-30 00:05:15 +00:00
|
|
|
branch="${2:-master}"
|
|
|
|
# If ref is really a branch, we want to track the remote one:
|
|
|
|
if [ "x$(git branch -a | grep -c "remotes/origin/$branch\$")" != "x0" ]; then
|
|
|
|
branch="origin/$branch"
|
|
|
|
fi
|
|
|
|
|
2016-04-24 09:24:30 +00:00
|
|
|
|
scripts/osmo-deps.sh: use osmo_git_clone_url
Instead of hardcoding https://git.osmocom.org for all clones, use
the osmo_git_clone_url function. This clones via https from gerrit where
possible, it should fix the many errors we are currently seeing from
the master-openbsc job:
+ osmo-deps.sh libosmo-sccp
+ project=libosmo-sccp
+ branch=master
+ git branch -a
+ grep -c remotes/origin/master$
+ [ x1 != x0 ]
+ branch=origin/master
+ test -d libosmo-sccp
+ git clone https://git.osmocom.org/libosmo-sccp libosmo-sccp
Cloning into 'libosmo-sccp'...
error: HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error (curl_result = 92, http_code = 0, sha1 = d23e38020fdbb685570145acd3a35e22a5a91344)
error: HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error (curl_result = 92, http_code = 0, sha1 = 68b450098714e3015a65b6628a7e61ac09dd4d47)
error: Unable to find 68b450098714e3015a65b6628a7e61ac09dd4d47 under https://git.osmocom.org/libosmo-sccp
Cannot obtain needed tree 68b450098714e3015a65b6628a7e61ac09dd4d47
while processing commit d23e38020fdbb685570145acd3a35e22a5a91344.
error: fetch failed.
Related: https://lists.osmocom.org/hyperkitty/list/openbsc@lists.osmocom.org/thread/RHMXTPTKU2SPGCVXF55RFJQ5GYBZ46CO/
Change-Id: I700d608ff74eca3981ed41f04ee9ced9629436aa
2022-08-22 11:59:53 +00:00
|
|
|
if ! test -d "$project"; then
|
|
|
|
git clone "$(osmo_git_clone_url "$project")" "$project"
|
2016-04-24 09:24:30 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-27 20:31:14 +00:00
|
|
|
cd "$project"
|
2017-11-07 15:32:55 +00:00
|
|
|
git fetch --tags origin
|
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
|
2017-10-28 02:19:23 +00:00
|
|
|
# this dep subdir separately, making sure to not pass in $deps as abspath.
|
|
|
|
deps="" osmo-clean-workspace.sh
|
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
|
|
|
|
2017-10-27 20:32:45 +00:00
|
|
|
git checkout -f "$branch"
|
2016-12-11 00:02:07 +00:00
|
|
|
git rev-parse HEAD
|