Merge pull request #1371 from jooola/feat/install_pip
Install python apps using pip
This commit is contained in:
commit
77a9d98273
|
@ -28,10 +28,11 @@ setup(
|
||||||
"django-url-filter",
|
"django-url-filter",
|
||||||
"markdown",
|
"markdown",
|
||||||
"model_bakery",
|
"model_bakery",
|
||||||
"psycopg2", # TODO: Move to prod requires
|
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
"prod": [],
|
"prod": [
|
||||||
|
"psycopg2",
|
||||||
|
],
|
||||||
"dev": [
|
"dev": [
|
||||||
"psycopg2-binary",
|
"psycopg2-binary",
|
||||||
],
|
],
|
||||||
|
|
15
install
15
install
|
@ -995,12 +995,13 @@ loud "-----------------------------------------------------"
|
||||||
|
|
||||||
python_version=$($python_bin --version 2>&1 | awk '{ print $2 }')
|
python_version=$($python_bin --version 2>&1 | awk '{ print $2 }')
|
||||||
verbose "Detected Python version: $python_version"
|
verbose "Detected Python version: $python_version"
|
||||||
|
pip_cmd="$python_bin -m pip"
|
||||||
|
|
||||||
verbose "\n * Installing necessary python services..."
|
verbose "\n * Installing necessary python services..."
|
||||||
loudCmd "$python_bin -mpip install setuptools --upgrade"
|
loudCmd "$pip_cmd install setuptools --upgrade"
|
||||||
# Required here because PyGObject requires it, but it is installed after PyGObject
|
# Required here because PyGObject requires it, but it is installed after PyGObject
|
||||||
# when pip parses the setup.py file in airtime_analyzer
|
# when pip parses the setup.py file in airtime_analyzer
|
||||||
loudCmd "$python_bin -mpip install pycairo==1.19.1"
|
loudCmd "$pip_cmd install pycairo==1.19.1"
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Creating /run/airtime..."
|
verbose "\n * Creating /run/airtime..."
|
||||||
|
@ -1023,11 +1024,11 @@ if [ ! -d /var/log/airtime ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
verbose "\n * Installing API client..."
|
verbose "\n * Installing API client..."
|
||||||
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/api_clients/setup.py install --install-scripts=/usr/bin"
|
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/api_clients"
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing pypo and liquidsoap..."
|
verbose "\n * Installing pypo and liquidsoap..."
|
||||||
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/pypo/setup.py install --install-scripts=/usr/bin"
|
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/pypo"
|
||||||
loudCmd "mkdir -p /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
loudCmd "mkdir -p /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
||||||
loudCmd "chown -R ${web_user}:${web_user} /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
loudCmd "chown -R ${web_user}:${web_user} /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
||||||
systemInitInstall libretime-liquidsoap "$web_user"
|
systemInitInstall libretime-liquidsoap "$web_user"
|
||||||
|
@ -1035,7 +1036,7 @@ systemInitInstall libretime-playout "$web_user"
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing airtime-celery..."
|
verbose "\n * Installing airtime-celery..."
|
||||||
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/airtime-celery/setup.py install"
|
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/airtime-celery"
|
||||||
# Create the Celery user
|
# Create the Celery user
|
||||||
if $is_centos_dist; then
|
if $is_centos_dist; then
|
||||||
loudCmd "id celery 2>/dev/null || adduser --no-create-home -c 'LibreTime Celery' -r celery || true"
|
loudCmd "id celery 2>/dev/null || adduser --no-create-home -c 'LibreTime Celery' -r celery || true"
|
||||||
|
@ -1051,12 +1052,12 @@ systemInitInstall libretime-celery
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing libretime-analyzer..."
|
verbose "\n * Installing libretime-analyzer..."
|
||||||
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/airtime_analyzer/setup.py install --install-scripts=/usr/bin"
|
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/airtime_analyzer"
|
||||||
systemInitInstall libretime-analyzer "$web_user"
|
systemInitInstall libretime-analyzer "$web_user"
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing API..."
|
verbose "\n * Installing API..."
|
||||||
loudCmd "python3 ${AIRTIMEROOT}/api/setup.py install --install-scripts=/usr/bin"
|
loudCmd "$pip_cmd install ${AIRTIMEROOT}/api[prod]"
|
||||||
systemInitInstall libretime-api "$web_user"
|
systemInitInstall libretime-api "$web_user"
|
||||||
mkdir -p /etc/airtime
|
mkdir -p /etc/airtime
|
||||||
sed -e "s@WEB_USER@${web_user}@g" \
|
sed -e "s@WEB_USER@${web_user}@g" \
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Description=LibreTime Media Analyzer Service
|
Description=LibreTime Media Analyzer Service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/libretime-analyzer
|
ExecStart=/usr/local/bin/libretime-analyzer
|
||||||
User=libretime-analyzer
|
User=libretime-analyzer
|
||||||
Group=libretime-analyzer
|
Group=libretime-analyzer
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Description=Libretime Liquidsoap Service
|
Description=Libretime Liquidsoap Service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/airtime-liquidsoap
|
ExecStart=/usr/local/bin/airtime-liquidsoap
|
||||||
User=libretime-playout
|
User=libretime-playout
|
||||||
Group=libretime-playout
|
Group=libretime-playout
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -3,7 +3,7 @@ Description=Libretime Playout Service
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/airtime-playout
|
ExecStart=/usr/local/bin/airtime-playout
|
||||||
User=libretime-pypo
|
User=libretime-pypo
|
||||||
Group=libretime-pypo
|
Group=libretime-pypo
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
Loading…
Reference in New Issue