mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-26 04:54:44 +00:00
topotests: Allow runing under both docker and podman
Signed-off-by: famfo <famfo@famfo.xyz>
This commit is contained in:
parent
bcf6e53314
commit
d87ec38dfd
@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
# Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
|
# Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
|
||||||
|
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
exec docker build --pull \
|
exec $(command -v docker || command -v podman) build --pull \
|
||||||
--compress \
|
--compress \
|
||||||
-t frrouting/topotests:latest \
|
-t frrouting/topotests:latest \
|
||||||
.
|
.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
# Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
|
# Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
|
||||||
@ -113,10 +113,12 @@ if [ -z "$TOPOTEST_FRR" ]; then
|
|||||||
git -C "$TOPOTEST_FRR" ls-files -z > "${TOPOTEST_LOGS}/git-ls-files"
|
git -C "$TOPOTEST_FRR" ls-files -z > "${TOPOTEST_LOGS}/git-ls-files"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cmd="$(command -v docker || command -v podman)"
|
||||||
|
|
||||||
if [ -z "$TOPOTEST_BUILDCACHE" ]; then
|
if [ -z "$TOPOTEST_BUILDCACHE" ]; then
|
||||||
TOPOTEST_BUILDCACHE=topotest-buildcache
|
TOPOTEST_BUILDCACHE=topotest-buildcache
|
||||||
docker volume inspect "${TOPOTEST_BUILDCACHE}" &> /dev/null \
|
"${cmd}" volume inspect "${TOPOTEST_BUILDCACHE}" &> /dev/null \
|
||||||
|| docker volume create "${TOPOTEST_BUILDCACHE}"
|
|| "${cmd}" volume create "${TOPOTEST_BUILDCACHE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$TMUX" ]]; then
|
if [[ -n "$TMUX" ]]; then
|
||||||
@ -145,4 +147,4 @@ if [ -t 0 ]; then
|
|||||||
set -- -t "$@"
|
set -- -t "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec docker run "$@"
|
exec "${cmd}" run "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user