From: Kefu Chai Date: Thu, 23 Jul 2020 05:58:25 +0000 (+0800) Subject: ceph-debug-docker: add --flavor option X-Git-Tag: wip-pdonnell-testing-20200918.022351~572^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=932bbc5bcf158993f245d6fc68e6a8f2a1a8e71b;p=ceph-ci.git ceph-debug-docker: add --flavor option * add --flavor option, which is "default" by default, so one can, for example, pass "--flavor crimson" to ceph-debug-docker * extract $repo_url to avoid repeating the shared bits between centos and debian derivatives envs. Signed-off-by: Kefu Chai --- diff --git a/src/script/ceph-debug-docker.sh b/src/script/ceph-debug-docker.sh index 3751845e171..630cbd7f5bc 100755 --- a/src/script/ceph-debug-docker.sh +++ b/src/script/ceph-debug-docker.sh @@ -13,6 +13,7 @@ set -e CACHE="" +FLAVOR="default" function run { printf "%s\n" "$*" @@ -20,7 +21,7 @@ function run { } function main { - eval set -- $(getopt --name "$0" --options 'h' --longoptions 'help,no-cache' -- "$@") + eval set -- $(getopt --name "$0" --options 'h' --longoptions 'help,no-cache,flavor:' -- "$@") while [ "$#" -gt 0 ]; do case "$1" in @@ -32,6 +33,10 @@ function main { CACHE="--no-cache" shift ;; + --flavor) + FLAVOR=$2 + shift 2 + ;; --) shift break @@ -79,6 +84,7 @@ function main { T=$(mktemp -d) pushd "$T" + repo_url="https://shaman.ceph.com/api/repos/ceph/${branch}/${sha}/${env/://}/flavors/${FLAVOR}/repo" if grep ubuntu <<<"$env" > /dev/null 2>&1; then # Docker makes it impossible to access anything outside the CWD : / cp -- /ceph/shaman/cephdev.asc . @@ -90,7 +96,7 @@ RUN apt-get update --yes --quiet && \ apt-get install --yes --quiet screen gdb software-properties-common apt-transport-https curl COPY cephdev.asc cephdev.asc RUN apt-key add cephdev.asc && \ - curl -L https://shaman.ceph.com/api/repos/ceph/${branch}/${sha}/${env/://}/repo | tee /etc/apt/sources.list.d/ceph_dev.list && \ + curl -L $repo_url | tee /etc/apt/sources.list.d/ceph_dev.list && \ apt-get update --yes && \ DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get --assume-yes -q --no-install-recommends install -o Dpkg::Options::=--force-confnew --allow-unauthenticated ceph ceph-osd-dbg ceph-mds-dbg ceph-mgr-dbg ceph-mon-dbg ceph-common-dbg ceph-fuse-dbg ceph-test-dbg radosgw-dbg python3-cephfs python3-rados EOF @@ -106,14 +112,13 @@ EOF ceph_debuginfo="ceph-base-debuginfo" ;; esac - IFS=":" read -r distro distro_release <<< "$env" time run docker build $CACHE --tag "$tag" - <