<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/docker-playground/+/23151">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">kernel-test: verify REMOTE_NAME and URL<br><br>If the checked out git repository already has a remote with the name<br>KERNEL_REMOTE_NAME, make sure that the KERNEL_URL matches the remote<br>URL.<br><br>Motivation for this change is osmo-ci<br>I5d4202a67a24d9c15a5b211fa29ce9d5b5a9d9c1, which will expose the<br>parameters in the jenkins job.<br><br>Related: OS#3208<br>Change-Id: I18b29011e3e8e2577bdf1a9c64c4370309cc8399<br>---<br>M scripts/kernel-test/kernel-build.sh<br>1 file changed, 19 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/51/23151/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/scripts/kernel-test/kernel-build.sh b/scripts/kernel-test/kernel-build.sh</span><br><span>index d261051..5f246ae 100755</span><br><span>--- a/scripts/kernel-test/kernel-build.sh</span><br><span>+++ b/scripts/kernel-test/kernel-build.sh</span><br><span>@@ -9,6 +9,8 @@</span><br><span> </span><br><span> # Add the kernel repository as git remote, fetch it, checkout the given branch</span><br><span> prepare_git_repo() {</span><br><span style="color: hsl(120, 100%, 40%);">+   local url</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if ! [ -d "$KERNEL_DIR" ]; then</span><br><span>            mkdir -p "$KERNEL_DIR"</span><br><span>             git -C "$KERNEL_DIR" init</span><br><span>@@ -18,6 +20,23 @@</span><br><span> </span><br><span>         if ! git remote | grep -q "^$KERNEL_REMOTE_NAME$"; then</span><br><span>            git remote add "$KERNEL_REMOTE_NAME" "$KERNEL_URL"</span><br><span style="color: hsl(120, 100%, 40%);">+        else</span><br><span style="color: hsl(120, 100%, 40%);">+          url="$(git remote get-url "$KERNEL_REMOTE_NAME")"</span><br><span style="color: hsl(120, 100%, 40%);">+         if [ "$url" != "$KERNEL_URL" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+                      set +x</span><br><span style="color: hsl(120, 100%, 40%);">+                        echo "ERROR: the checked out repository already has" \</span><br><span style="color: hsl(120, 100%, 40%);">+                              "a remote with the same name, pointing to a" \</span><br><span style="color: hsl(120, 100%, 40%);">+                              "different URL!"</span><br><span style="color: hsl(120, 100%, 40%);">+                    echo</span><br><span style="color: hsl(120, 100%, 40%);">+                  echo "KERNEL_REMOTE_NAME:       $KERNEL_REMOTE_NAME"</span><br><span style="color: hsl(120, 100%, 40%);">+                        echo "KERNEL_URL (parameter):   $KERNEL_URL"</span><br><span style="color: hsl(120, 100%, 40%);">+                        echo "KERNEL_URL (checked out): $url"</span><br><span style="color: hsl(120, 100%, 40%);">+                       echo</span><br><span style="color: hsl(120, 100%, 40%);">+                  echo "Please restart the job, and either change the" \</span><br><span style="color: hsl(120, 100%, 40%);">+                              "KERNEL_URL parameter to the same value, or" \</span><br><span style="color: hsl(120, 100%, 40%);">+                              "use a different KERNEL_REMOTE_NAME."</span><br><span style="color: hsl(120, 100%, 40%);">+                       exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+                fi</span><br><span>   fi</span><br><span> </span><br><span>       git fetch "$KERNEL_REMOTE_NAME"</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/docker-playground/+/23151">change 23151</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/docker-playground/+/23151"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: docker-playground </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I18b29011e3e8e2577bdf1a9c64c4370309cc8399 </div>
<div style="display:none"> Gerrit-Change-Number: 23151 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>