osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43167?usp=email )

Change subject: deps: move "git clone" logic into update.sh
......................................................................

deps: move "git clone" logic into update.sh

Prepare to have more logic for cloning and updating git repositories in
the script, see follow-up patches. The purpose of this patch series is
to fix the rate limiting errors we are seeing from gitlab eclipse, that
lead to aborts of our ttcn3 jobs:

  [titan.ProtocolModules.ROSE] Updating URL to 
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ROSE
  remote: You have reached the limit of requests you can make to Eclipse 
GitLab. This could be caused by too many open tabs, which query the GitLab 
server in the background. Please close unused tabs, or put them to sleep so 
they don't issue requests needlessly.
  fatal: unable to access 
'https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.M3UA/': The 
requested URL returned error: 429
  make[1]: *** [Makefile:174: titan.ProtocolModules.M3UA/update] Error 128

Change-Id: I7c1647edd11afac657acaf6add08903373eae585
---
M deps/Makefile
M deps/update.sh
2 files changed, 15 insertions(+), 8 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/deps/Makefile b/deps/Makefile
index 306f1b2..4a6bd90 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -135,12 +135,8 @@
 $(1)_HEAD!=    if [ -d $(1) ]; then cd $(1) && git describe --tags 2>/dev/null 
|| git rev-parse HEAD; fi
 $(1)_MODIFIED!=        if [ -d $(1) ]; then cd $(1) && git diff --quiet 
--exit-code || echo -n "1"; fi

-$(1):
-       @echo "[$(1)] Initial git clone"
-       @git clone -q $(2)/$(1)
-
 .PHONY: $(1)/update
-$(1)/update: $(1)
+$(1)/update:
 ifeq ($$($(1)_MODIFIED),1)
        @echo "WARNING: $(1) skipped because it contains uncommitted 
modifications!"
 else
@@ -149,16 +145,21 @@
        @cd $(1) && git remote set-url origin $(2)/$(1) && git fetch
 endif
 ifneq ($$($(1)_HEAD),$($(1)_commit))
-       @./update.sh "$(1)" "$($(1)_commit)"
+       @./update.sh "$(1)" "$($(1)_commit)" "$(2)"
 endif
 endif

 .PHONY: $(1)/clean
-$(1)/clean: $(1)
+$(1)/clean:
 ifeq ($$($(1)_MODIFIED),1)
        @echo "WARNING: $(1) skipped because it contains uncommitted 
modifications!"
 else
-       cd $(1) && git fetch && git checkout -q -f "$($(1)_commit)" && git 
reset --hard
+       if [ -d $(1) ]; then \
+               cd $(1) && \
+               git fetch && \
+               git checkout -q -f "$($(1)_commit)" && \
+               git reset --hard; \
+       fi
 endif

 .PHONY: $(1)/distclean
diff --git a/deps/update.sh b/deps/update.sh
index 8099ed7..4a52279 100755
--- a/deps/update.sh
+++ b/deps/update.sh
@@ -1,6 +1,12 @@
 #!/bin/sh -e
 DIR="$1"
 COMMIT="$2"
+URL_PREFIX="$3"
+
+if ! [ -d "$DIR" ]; then
+       echo "[$DIR] Initial git clone"
+       git clone -q "$URL_PREFIX"/"$DIR"
+fi

 cd "$DIR"


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43167?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7c1647edd11afac657acaf6add08903373eae585
Gerrit-Change-Number: 43167
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to