aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4')
-rw-r--r--moonv4/bin/moon_lib_update.sh (renamed from moonv4/bin/moon_utilities_update.sh)28
-rw-r--r--moonv4/moon_db/Changelog10
-rw-r--r--moonv4/moon_db/moon_db/__init__.py2
-rw-r--r--moonv4/moon_db/moon_db/db_manager.py15
4 files changed, 36 insertions, 19 deletions
diff --git a/moonv4/bin/moon_utilities_update.sh b/moonv4/bin/moon_lib_update.sh
index 9dc42179..1d9d4cb3 100644
--- a/moonv4/bin/moon_utilities_update.sh
+++ b/moonv4/bin/moon_lib_update.sh
@@ -1,26 +1,34 @@
#!/usr/bin/env bash
-VERSION=moon_utilities-$(grep __version__ moon_utilities/__init__.py | cut -d "\"" -f 2)
+# usage: moon_update.sh {build,upload,copy} {db,utilities} <GPG_ID>
+
+CMD=$1
+COMPONENT=$2
+GPG_ID=$3
+
+VERSION=moon_${COMPONENT}-$(grep __version__ moon_${COMPONENT}/moon_${COMPONENT}/__init__.py | cut -d "\"" -f 2)
+
+cd moon_${COMPONENT}
python3 setup.py sdist bdist_wheel
-if [ "$1" = "upload" ]; then
+if [ "$CMD" = "upload" ]; then
# Instead of "A0A96E75", use your own GPG ID
rm dist/*.asc 2>/dev/null
- gpg --detach-sign -u "A0A96E75" -a dist/${VERSION}-py3-none-any.whl
- gpg --detach-sign -u "A0A96E75" -a dist/${VERSION}.tar.gz
+ gpg --detach-sign -u "${GPG_ID}" -a dist/${VERSION}-py3-none-any.whl
+ gpg --detach-sign -u "${GPG_ID}" -a dist/${VERSION}.tar.gz
twine upload dist/${VERSION}-py3-none-any.whl dist/${VERSION}-py3-none-any.whl.asc
twine upload dist/${VERSION}.tar.gz dist/${VERSION}.tar.gz.asc
fi
-rm -f ../moon_manager/dist/moon_utilities*
-rm -f ../moon_orchestrator/dist/moon_utilities*
-rm -f ../moon_wrapper/dist/moon_utilities*
-rm -f ../moon_interface/dist/moon_utilities*
-rm -f ../moon_authz/dist/moon_utilities*
+rm -f ../moon_manager/dist/moon_${COMPONENT}*
+rm -f ../moon_orchestrator/dist/moon_${COMPONENT}*
+rm -f ../moon_wrapper/dist/moon_${COMPONENT}*
+rm -f ../moon_interface/dist/moon_${COMPONENT}*
+rm -f ../moon_authz/dist/moon_${COMPONENT}*
-if [ "$1" = "copy" ]; then
+if [ "$CMD" = "copy" ]; then
mkdir -p ../moon_manager/dist/ 2>/dev/null
cp -v dist/${VERSION}-py3-none-any.whl ../moon_manager/dist/
mkdir -p ../moon_orchestrator/dist/ 2>/dev/null
diff --git a/moonv4/moon_db/Changelog b/moonv4/moon_db/Changelog
index c1e8a770..6f5619d1 100644
--- a/moonv4/moon_db/Changelog
+++ b/moonv4/moon_db/Changelog
@@ -35,4 +35,12 @@ CHANGES
1.2.0
-----
-- Update the db_manager in order to use it for tests \ No newline at end of file
+- Update the db_manager in order to use it for tests
+
+1.2.1
+-----
+- Update moon_db_manager in order to use it for unit tests
+
+1.2.2
+-----
+- Fix a bug in moon_db_manager
diff --git a/moonv4/moon_db/moon_db/__init__.py b/moonv4/moon_db/moon_db/__init__.py
index 515227fa..6aead152 100644
--- a/moonv4/moon_db/moon_db/__init__.py
+++ b/moonv4/moon_db/moon_db/__init__.py
@@ -3,5 +3,5 @@
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
-__version__ = "1.2.1"
+__version__ = "1.2.2"
diff --git a/moonv4/moon_db/moon_db/db_manager.py b/moonv4/moon_db/moon_db/db_manager.py
index 88d5b7d3..75cbcdb0 100644
--- a/moonv4/moon_db/moon_db/db_manager.py
+++ b/moonv4/moon_db/moon_db/db_manager.py
@@ -52,11 +52,7 @@ def init_engine():
return create_engine(db_conf['url'])
-# def format_data(ext):
-# return ext.name, ext.obj.upgrade()
-
-
-def run(command, logger, engine):
+def main(command, logger, engine):
files = glob.glob(versions.__path__[0] + "/[0-9][0-9][0-9]*.py")
for filename in files:
filename = os.path.basename(filename).replace(".py", "")
@@ -75,7 +71,12 @@ def run(command, logger, engine):
else:
logger.critical("Cannot understand the command!")
-if __name__ == "__main__":
+
+def run():
args, logger = init_args()
engine = init_engine()
- run(args.command[0], logger, engine)
+ main(args.command[0], logger, engine)
+
+
+if __name__ == "__main__":
+ run()