Commit Graph

12 Commits

Author SHA1 Message Date
Oliver Smith 9d9a8661d6 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 14:07:59 +02:00
Harald Welte 5455b42405 update git URLs (git -> https; gitea/gerrit)
Unencrypted git:// protocol offers no integrity or authentication,
making it subject to tampering.  Use https:// instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
https://blog.readthedocs.com/github-git-protocol-deprecation/

Change-Id: Ia44e4127ff87a3d4d747225d3258188a0a891f1b
2022-08-13 04:02:51 +07:00
Pau Espin 5cd1529182 scripts: osmo-deps.sh: Allow building against tags
In case we provide a tag, origin/$tag doesn't resolve correctly, we must
use $tag. Same happens probably if we want to build against a specific
commit hash.

Change-Id: Ica50080c8b3e20686fe6f47a2b61718ef4a66d95
2018-04-02 19:35:36 +00:00
Pau Espin adc35d0e69 osmo-deps.sh: Force fetching git tags
It was recently spotted, in a osmo-msc jenkins build, that an updated
dependency (new commits to be fetched) contained a new tag which was
not fetched with the commit. It resulted in the Makefile generating an
old .version file, which ended up generating a library version in the
.pc which later in the build make the configure script fail while
checking at the dependencies.

As far as I could understand after reading several discussion threads,
it seems git fetch doesn't necessarily fetch and store locally all new
tags found in the remote, and we need to explicitly add the --tags
parameter to be sure all of them are downloaded.

This patch adds a new fetch line instead of patching the one already
present because it seems in old versions of git the --tags parameter had
a different behaviour, in which only tags and not branches are fetched.
This way is ensured that we get both correct regardless of git version.

Change-Id: I4bfe4846959c70e435d6792a755a6f2a6f0a932c
2017-11-07 16:40:00 +01:00
Neels Hofmeyr 135f448545 osmo-deps.sh: fix: add 'origin/' to branch, to properly update
If I have a git clone that once did 'checkout [-f] branch', and if then
origin/branch gets updates, doing another 'checkout -f branch' only goes back
to the local tracking-branch of origin/branch. We never pull in changes from
origin/branch anymore as soon as a local branch exists. Always prepend
'origin/', so that 'checkout -f' goes into detached-HEAD state onto the newest
fetched revision.

Change-Id: Ia715a100b5beaf7e612c2c64cdad8819aa00c8bd
2017-11-01 13:47:31 +01:00
Neels Hofmeyr 6350953170 osmo-deps.sh: make sure to not clean all deps when inside a dep dir
Make sure osmo-deps.sh passes no $deps in to osmo-clean-workspace.sh.

In most builds, $deps is a relative path, and when within a dir that contains
no such subir, calling osmo-clean-workspace.sh has no effect. However, in some,
$deps is passed in as absolute path, so when within a deps/... subdir in
osmo-deps.sh, the script would still find the abspath and clean out all deps
subdirs; for example in osmo-bts.

Change-Id: I431d20aedefc708645a1f1862334cffaef20b928
2017-10-28 04:19:23 +02:00
Neels Hofmeyr f9c1cb2777 scripts: use 'git checkout -f' instead of 'reset --hard'
'checkout -f' more accurately does what is intended. 'reset' changes the
current branch to some hash, 'checkout -f' force-checkouts another branch.

Change-Id: Ic6279ebaf8160bceb3fa2ab40eff0b888ecd5009
2017-10-27 22:37:22 +02:00
Neels Hofmeyr 7c5e34cba0 osmo-build-dep: offload branch checkout to osmo-deps.sh
In osmo-deps.sh, add second arg $branch, and also name the first one (i.e.
$project). Use the passed branch or 'origin/master' by default.

In osmo-build-dep.sh, it's not necessary to do a second 'git rev-parse HEAD',
osmo-deps.sh already does it.

Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44
2017-10-27 22:37:22 +02:00
Neels Hofmeyr f42a1cfa50 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 22:37:22 +02:00
Neels Hofmeyr a0a2e0ffa7 scripts/osmo-deps.sh: show complete git hash of cloned HEAD revision
Change-Id: I0e1a65d864b075bd1dbfb579d308631f745d6937
2016-12-11 01:02:07 +01:00
Neels Hofmeyr 5044f45935 scripts/osmo-deps.sh: set -ex to log actions and exit on error
Change-Id: Ic61a51bd639e44cbb19ec67a90ab04825e512314
2016-12-11 00:58:00 +01:00
Holger Hans Peter Freyther 483c54f0ab Initial commit for a CI repository 2016-04-24 11:24:30 +02:00