fixeria has submitted this change. (
https://gerrit.osmocom.org/c/pysim/+/42657?usp=email )
Change subject: contrib/jenkins.sh: add setup_venv()
......................................................................
contrib/jenkins.sh: add setup_venv()
Reduece code duplication by factoring out virtualenv setup and
activation into a shell function.
Change-Id: Ibb193d12d5502c78104ef53badc6037f08e92df1
---
M contrib/jenkins.sh
1 file changed, 10 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 74198d7..fa2575b 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -10,6 +10,11 @@
export PYTHONUNBUFFERED=1
+setup_venv() {
+ virtualenv -p python3 venv --system-site-packages
+ . venv/bin/activate
+}
+
if [ ! -d "./tests/" ] ; then
echo "###############################################"
echo "Please call from pySim-prog top directory"
@@ -23,8 +28,7 @@
case "$JOB_TYPE" in
"test")
- virtualenv -p python3 venv --system-site-packages
- . venv/bin/activate
+ setup_venv
pip install -r requirements.txt
pip install pyshark
@@ -36,8 +40,7 @@
tests/pySim-trace_test/pySim-trace_test.sh
;;
"card-test") # tests requiring physical cards
- virtualenv -p python3 venv --system-site-packages
- . venv/bin/activate
+ setup_venv
pip install -r requirements.txt
@@ -53,8 +56,7 @@
tests/pySim-smpp2sim_test/pySim-smpp2sim_test.sh
;;
"distcheck")
- virtualenv -p python3 venv --system-site-packages
- . venv/bin/activate
+ setup_venv
pip install .
pip install pyshark
@@ -67,8 +69,7 @@
# Print pylint version
pip3 freeze | grep pylint
- virtualenv -p python3 venv --system-site-packages
- . venv/bin/activate
+ setup_venv
pip install .
@@ -86,8 +87,7 @@
contrib/*.py
;;
"docs")
- virtualenv -p python3 venv --system-site-packages
- . venv/bin/activate
+ setup_venv
pip install -r requirements.txt
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42657?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ibb193d12d5502c78104ef53badc6037f08e92df1
Gerrit-Change-Number: 42657
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>