]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
start.sh: Use current branch by default
authorZack Cerza <zack@redhat.com>
Mon, 21 Mar 2022 16:47:12 +0000 (10:47 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 28 Mar 2022 21:31:40 +0000 (15:31 -0600)
Since the main use-case for this work at the moment is self-testing
teuthology, let's make it easy to test the same branch that's being
worked on.

Signed-off-by: Zack Cerza <zack@redhat.com>
docs/docker-compose/start.sh

index bb50dad7196ed872d7f1d5e2cbfebc36ae7f9e31..9c71889af50848a505467e440dd69d02edf48858 100755 (executable)
@@ -1,6 +1,12 @@
 #!/bin/bash
-# Clone teuthology
-git clone https://github.com/ceph/teuthology.git
+set -e
+if [ -z "$TEUTHOLOGY_BRANCH" -a -n "$GITHUB_HEAD_REF" ]; then
+    TEUTHOLOGY_BRANCH=${GITHUB_HEAD_REF}
+fi
+git clone \
+  --depth 1 \
+  -b ${TEUTHOLOGY_BRANCH:-$(git branch --show-current)} \
+  https://github.com/ceph/teuthology.git
 
 # Check for .teuthology.yaml file and copy it to teuthology
 if [ -f ".teuthology.yaml" ];