PIP installation and management scripts

This post needs to start with an apology - it’s too arrogant what I’m doing here. But at the end of the day - you are warned, and thus this has the chance to cause a little more use than harm.

First time in my life, I tried some serious shell scripting and created a set of scripts to manage PIP installations with virtual environments. At present, you could do:

  • an install from scratch
  • a small update within a minor version number
  • a big update x.y.z => x.y.z+2
  • import a database into an existing setup

They are in service in my ubuntu universe for several weeks and already turned out to be a little useful. There is some interactivity - user is asked for desired directory, versions, names etc. Dialogues are in German - forgive me. In case there is resonance on that, English versions are in the range of the possible.

You can find them here:
Tryton PIP install and management script collection

Don’t blame me for bad coding, definitively it is. Creation was learning by doing, any hint for improvement and any other comment will be very welcome.

All credits on this go to Grand Master @edbo - without his hint on PIP and his tremendous work on giving very clear inscructions how to use it, these little pieces would have been absolutely impossible.

If you want to try - obey to the holy trinity of OpenSource:
Be warned.
Have fun.
Give feedback.

Cheers,
Wolf

Thank you for sharing.
It reminds me when I started the same in 2007. Now the script is 30 K lines…
I learnt the : << syntax that I didn’t know.
do you know about nohup when you run Tryton as a detached process ?

If I don’t miss the point, your scripts ask for parameters and use them to format a somehow complex command. You find it easier because the steps are well commented. I am personally wired the same way :wink:

When you use these scripts, you will face probably the following limitations first:

  • when you type a command, it is recorded so it can be replayed later. By prompting for parameters you loose this key function and must fill parameters again and again. My preference is to ask parameters once, record them in a conf file and use them per default later.

  • as you mentionned it, the translation is a nice feature. I partially fixed the point for my graphical interface (I can show you how), else I use english.

  • if you automate your activity, (saving from cron, starting at boot…) you will need some log file and some check and warn capability to signal anomalies.

This will make your scripts more complex, time consuming and difficult to test, share and maintain. It is what happened to me.
Looking for other feed-backs from the community.

hi,
if you want to give a try on a fresh server (I succeeded on ubuntu 20.04), I provide a limited script. I don’t use it on my servers so it is poorly tested but will illustrate the topic.

#as root:
#get the system ready
dpkg-reconfigure tzdata
apt-get update
apt-get upgrade

#download the script
cd /usr/local/bin/
wget download.sisalp.net/scripts/install_xoe
chmod 755 install_xoe

#install a first tryton service by answering few questions
install_xoe

#install a web GUI (note the login_password at the end)
install_xoe --panel

#install additionnal tryton services for training and test
install_xoe --training
install_xoe --test

#you now run a multi-tenant server with three independent tryton services.
#more information about the services on http://server_local_ip_address with admin/login_password