mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
fix CI, again
This commit is contained in:
parent
80f9b00da0
commit
840050079e
2 changed files with 26 additions and 18 deletions
|
@ -119,19 +119,22 @@ ynh_script_progression --message="Install weblate using PIP..." --weight=80
|
|||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name
|
||||
|
||||
virtualenv --python=python3 "${final_path}/venv"
|
||||
chown -R "$app": "$final_path"
|
||||
|
||||
#run source in a 'sub shell'
|
||||
(
|
||||
set +o nounset
|
||||
source "${final_path}/venv/bin/activate"
|
||||
set -o nounset
|
||||
$final_path/venv/bin/pip install --upgrade pip setuptools wheel
|
||||
cd "${final_path}"
|
||||
|
||||
sudo --user=$app $final_path/venv/bin/pip install --upgrade pip setuptools wheel
|
||||
# Still needed with latest version of weblate?
|
||||
$final_path/venv/bin/pip install Weblate=="$weblate_version"
|
||||
$final_path/venv/bin/pip install psycopg2-binary ruamel.yaml aeidon phply
|
||||
sudo --user=$app $final_path/venv/bin/pip install Weblate=="$weblate_version"
|
||||
sudo --user=$app $final_path/venv/bin/pip install psycopg2-binary ruamel.yaml aeidon phply
|
||||
#pip install pytz python-bidi PyYaML Babel pyuca pylibravatar py3dns psycopg2-binary phply django-redis hiredis aeidon ruamel.yaml
|
||||
# specific to YunoHost package:
|
||||
$final_path/venv/bin/pip install django_sendmail_backend
|
||||
sudo --user=$app $final_path/venv/bin/pip install django_sendmail_backend
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
@ -181,18 +184,20 @@ ynh_script_progression --message="Filling up the database..." --weight=10
|
|||
source "${final_path}/venv/bin/activate"
|
||||
set -o nounset
|
||||
export DJANGO_SETTINGS_MODULE="weblate.settings"
|
||||
cd "${final_path}"
|
||||
|
||||
# the user needs to be weblate for postgresql
|
||||
$final_path/venv/bin/weblate migrate --noinput
|
||||
sudo --user=$app $final_path/venv/bin/weblate migrate --noinput
|
||||
# generate static files
|
||||
$final_path/venv/bin/weblate collectstatic --noinput
|
||||
$final_path/venv/bin/weblate createadmin --no-color \
|
||||
sudo --user=$app $final_path/venv/bin/weblate collectstatic --noinput
|
||||
sudo --user=$app $final_path/venv/bin/weblate createadmin --no-color \
|
||||
--password "$password" \
|
||||
--username "$admin" \
|
||||
--email "$admin_mail"
|
||||
|
||||
# Check the configuration
|
||||
# This may fail in some cases with errors, etc., but the app works and the user can fix issues later.
|
||||
$final_path/venv/bin/weblate check --deploy || true
|
||||
sudo --user=$app $final_path/venv/bin/weblate check --deploy || true
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -171,19 +171,22 @@ upgrade() {
|
|||
ynh_systemd_action --service_name="$app-celery" --action="stop"
|
||||
|
||||
virtualenv --python=python3 "${final_path}/venv"
|
||||
chown -R "$app": "$final_path"
|
||||
|
||||
#run source in a 'sub shell'
|
||||
(
|
||||
set +o nounset
|
||||
source "${final_path}/venv/bin/activate"
|
||||
set -o nounset
|
||||
$final_path/venv/bin/pip install --upgrade pip setuptools wheel
|
||||
cd "${final_path}"
|
||||
|
||||
sudo --user=$app $final_path/venv/bin/pip install --upgrade pip setuptools wheel
|
||||
# Still needed with latest version of weblate?
|
||||
$final_path/venv/bin/pip install --upgrade Weblate=="$new_version"
|
||||
$final_path/venv/bin/pip install psycopg2-binary ruamel.yaml aeidon phply
|
||||
sudo --user=$app $final_path/venv/bin/pip install --upgrade Weblate=="$new_version"
|
||||
sudo --user=$app $final_path/venv/bin/pip install psycopg2-binary ruamel.yaml aeidon phply
|
||||
#pip install pytz python-bidi PyYaML Babel pyuca pylibravatar py3dns psycopg2-binary phply django-redis hiredis aeidon ruamel.yaml
|
||||
# specific to YunoHost package:
|
||||
$final_path/venv/bin/pip install django_sendmail_backend
|
||||
sudo --user=$app $final_path/venv/bin/pip install django_sendmail_backend
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
@ -234,16 +237,16 @@ upgrade() {
|
|||
export DJANGO_SETTINGS_MODULE="weblate.settings"
|
||||
cd "${final_path}"
|
||||
|
||||
$final_path/venv/bin/weblate migrate --noinput
|
||||
$final_path/venv/bin/weblate collectstatic --noinput
|
||||
$final_path/venv/bin/weblate setuplang
|
||||
$final_path/venv/bin/weblate setupgroups
|
||||
$final_path/venv/bin/weblate compilemessages
|
||||
sudo --user=$app $final_path/venv/bin/weblate migrate --noinput
|
||||
sudo --user=$app $final_path/venv/bin/weblate collectstatic --noinput
|
||||
sudo --user=$app $final_path/venv/bin/weblate setuplang
|
||||
sudo --user=$app $final_path/venv/bin/weblate setupgroups
|
||||
sudo --user=$app $final_path/venv/bin/weblate compilemessages
|
||||
|
||||
# Check the configuration
|
||||
# This may fail in some cases with errors, etc., but the app works and the user can fix issues later.
|
||||
if [ "$new_version" == "$weblate_version" ]; then
|
||||
$final_path/venv/bin/weblate check --deploy || true
|
||||
sudo --user=$app $final_path/venv/bin/weblate check --deploy || true
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue