From c86e3c17b4f5fc431ad02d748be5a8bc63b019ae Mon Sep 17 00:00:00 2001
From: Operateur <operateur@synchrotron-soleil.fr>
Date: Tue, 6 Feb 2024 11:21:33 +0100
Subject: [PATCH] feat(deploy): add version tag on the way

---
 deploy_rcm.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/deploy_rcm.sh b/deploy_rcm.sh
index b0470d8..b6fdeeb 100755
--- a/deploy_rcm.sh
+++ b/deploy_rcm.sh
@@ -2,8 +2,15 @@
 
 echo "Deploy module in RCM environment"
 
+
+# Get the current version
+version=$(git describe --tags)
+
 # Copy Python module
 ipath=/home/operateur/.local/lib/python3.6/site-packages/ArchiveExtractor
 mkdir -p $ipath
 cp ArchiveExtractor/*.py $ipath/ -rvf
 
+# cwAWKSed the __init__.py file to replace the version variable
+awk -v version="$version" '{ gsub("AUTOVERSIONREPLACE",version) ; print}' ArchiveExtractor/__init__.py > $ipath/__init__.py
+
-- 
GitLab