-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker_ifexgen: Update wrapper to run "containerized" ifexgen
This is a wrapper that the user can invoke instead of ifexgen to execute the tool in the container installation instead of a local installation. The usage should be identical, hopefully. (It existed before but is now matching the updated container setup) EDIT: Add similar support for D-Bus generator Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
- Loading branch information
Gunnar Andersson
committed
Aug 15, 2023
1 parent
c605565
commit 0a5bf89
Showing
3 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh -e | ||
|
||
# SPDX-FileCopyrightText: Copyright (c) 2023 Novaspring AB | ||
# SPDX-License-Identifier: MPL-2.0 | ||
# | ||
# This file is part of IFEX project | ||
# --------------------------------------------------------------------------- | ||
|
||
IMAGE_NAME=ifex_local/ifex_alpine | ||
CTR_NAME=ifex-docker | ||
|
||
# Normalize directory location | ||
cd "$(dirname "$0")" # (the directory this script is in) | ||
cd .. | ||
|
||
command="$(basename "$0")" | ||
case $command in | ||
docker_ifexgen) | ||
runcmd=ifexgen ;; | ||
docker_ifexgen_dbus) | ||
runcmd=ifexgen_dbus ;; | ||
*) | ||
echo FAIL && exit 1 ;; | ||
esac | ||
|
||
if ! docker images | grep -F -q "$IMAGE_NAME"; then | ||
echo Image never built from Dockerfile -- building... | ||
cd docker && make build | ||
fi | ||
|
||
if docker ps -a | grep -F -q "$CTR_NAME"; then | ||
echo Removing old container $CTR_NAME | ||
docker rm "$CTR_NAME" | ||
fi | ||
|
||
# SELINUX required flag | ||
fgrep -Fq redhat /etc/os-release && ZFLAG=:z || ZFLAG= | ||
|
||
set -x | ||
docker run --rm -ti -v $PWD:/work${ZFLAG} --name "$CTR_NAME" "$IMAGE_NAME" /ifex/venv/bin/$runcmd "$@" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker_ifexgen |