Skip to content
Snippets Groups Projects
Commit 827291fc authored by BRONES Romain's avatar BRONES Romain
Browse files

feat: Add version number in help and log

parent 0dacb360
No related branches found
No related tags found
No related merge requests found
__version__ = "AUTOVERSIONREPLACE"
......@@ -28,7 +28,7 @@ if __name__ == '__main__':
sh.setFormatter(logging.Formatter("{levelname:8}: {message}", style='{'))
logger.addHandler(sh)
parser = argparse.ArgumentParser("FofbTool")
parser = argparse.ArgumentParser("FofbTool", description="version {}".format(FofbTool.__version__))
parser.add_argument("--log", default="info",
help="Log level (error, warning, info, debug)")
......@@ -71,6 +71,7 @@ if __name__ == '__main__':
logger.setLevel(getattr(logging, args.log.upper()))
logger.debug(args)
logger.info("FofbTool version {}".format(FofbTool.__version__))
if not args.fileconfig is None:
FofbTool.Configuration.loadconfig(args.fileconfig)
......
......@@ -2,6 +2,9 @@
echo "Deploy module and CLI in RCM environment"
# Get the current version
version=$(git describe --tags)
# Copy Python module
ipath=/home/operateur/.local/lib/python3.6/site-packages/FofbTool
mkdir -p $ipath
......@@ -13,3 +16,6 @@ cp bin/FofbTool /home/production/scripts/DG/python/bin/ -vf
# Put exec rights
chmod +x /home/production/scripts/DG/python/bin/FofbTool
# AWK the __init__.py file to replace the version variable
awk -v version="$version" '{ gsub("AUTOVERSIONREPLACE",version) ; print}' FofbTool/__init__.py > $ipath/__init__.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment