]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding update-env.sh, updating python_fb_tools and requirements.txt
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 15:38:38 +0000 (16:38 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 15:38:38 +0000 (16:38 +0100)
python_fb_tools
requirements.txt
update-env.sh [new file with mode: 0755]

index 89a0d8b45c52afab975f3dee7c291e4a8199e603..2919e48b0e42b8aa092e5956dc325f0e881a9369 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 89a0d8b45c52afab975f3dee7c291e4a8199e603
+Subproject commit 2919e48b0e42b8aa092e5956dc325f0e881a9369
index 55568363cdada4d88ff6b13c938056b20089507f..e0188a94de77586121ea8750eab6968022f53200 100644 (file)
@@ -3,5 +3,3 @@ requests
 six
 pytz
 paramiko
-flake8
-pathlib
diff --git a/update-env.sh b/update-env.sh
new file mode 100755 (executable)
index 0000000..4e2b04a
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+base_dir=$( dirname $0 )
+cd ${base_dir}
+base_dir=$( readlink -f . )
+
+declare -a VALID_PY_VERSIONS=("3.8" "3.7" "3.6" "3.5")
+
+echo "Preparing virtual environment ..."
+echo
+if [[ ! -f venv/bin/activate ]] ; then
+    found="n"
+    for py_version in "${VALID_PY_VERSIONS[@]}" ; do
+        PYTHON="python${py_version}"
+        if type -t ${PYTHON} >/dev/null ; then
+            found="y"
+            echo
+            echo "Found ${PYTHON}."
+            echo
+            virtualenv --python=${PYTHON} venv
+            break
+        fi
+    done
+    if [[ "${found}" == "n" ]] ; then
+        echo >&2
+        echo "Did not found a usable Python version." >&2
+        echo "Usable Python versions are: ${VALID_PY_VERSIONS[*]}" >&2
+        echo >&2
+        exit 5
+    fi
+fi
+
+echo
+echo "---------------------------------------------------"
+echo "Updating Git submodule python_fb_tools ..."
+echo "git init ..."
+echo
+git submodule init
+echo
+echo "--------------"
+echo "git update ..."
+echo
+git submodule update --init --recursive python_fb_tools
+
+. venv/bin/activate || exit 5
+
+echo "---------------------------------------------------"
+echo "Installing and/or upgrading necessary modules ..."
+echo
+echo "From python_fb_tools ..."
+echo
+pip install --upgrade --upgrade-strategy eager --requirement python_fb_tools/requirements.txt
+echo
+echo "From own ..."
+echo
+pip install --upgrade --upgrade-strategy eager --requirement requirements.txt
+echo
+echo "---------------------------------------------------"
+echo "Installed modules:"
+echo
+pip list --format columns
+
+#if [[ -x compile-xlate-msgs.sh ]]; then
+#    echo
+#    echo "--------------"
+#    echo "Updating i18n files in ${base_dir} ..."
+#    echo
+#    ./compile-xlate-msgs.sh 
+#fi
+
+cd python_fb_tools
+if [[ -x compile-xlate-msgs.sh ]]; then
+    echo
+    echo "--------------"
+    echo "Updating i18n files in python_fb_tools ..."
+    echo
+    ./compile-xlate-msgs.sh 
+fi
+cd ..
+
+echo
+echo "-------"
+echo "Fertig."
+echo
+
+# vim: ts=4