aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/bin
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/bin')
-rw-r--r--moonv4/bin/moon_lib_update.sh (renamed from moonv4/bin/moon_utilities_update.sh)28
1 files changed, 18 insertions, 10 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