1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunorunner_ynh.git synced 2024-09-03 20:36:13 +02:00

Apply example_ynh

make bullseye ready
This commit is contained in:
yalh76 2021-06-30 05:08:36 +02:00
parent 6751c58c2d
commit 4b25dedbbe
13 changed files with 64 additions and 63 deletions

View file

@ -2,8 +2,8 @@
; pre-install ; pre-install
sudo git clone https://github.com/YunoHost/CI_package_check /home/CI_package_check sudo git clone https://github.com/YunoHost/CI_package_check /home/CI_package_check
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1

View file

@ -1,27 +1,29 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
alias __FINALPATH__/;
if ($scheme = http) { # Path to source
rewrite ^ https://$server_name$request_uri? permanent; alias __FINALPATH__/ ;
}
proxy_pass http://127.0.0.1:__PORT__/; if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_http_version 1.1; proxy_pass http://127.0.0.1:__PORT__/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# Include SSOWAT user panel. proxy_http_version 1.1;
include conf.d/yunohost_panel.conf.inc; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
location __PATH__/logs { # Include SSOWAT user panel.
alias /home/CI_package_check/logs/; include conf.d/yunohost_panel.conf.inc;
autoindex on;
} location __PATH__/logs {
alias /home/CI_package_check/logs/;
location __PATH__/badges/ { autoindex on;
alias /home/CI_package_check/badges/; }
autoindex on;
} location __PATH__/badges/ {
alias /home/CI_package_check/badges/;
autoindex on;
}
} }

View file

@ -7,7 +7,7 @@ Type=simple
Restart=always Restart=always
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__/
ExecStart=__FINALPATH__/venv/bin/python ./run.py ExecStart=__FINALPATH__/venv/bin/python ./run.py
[Install] [Install]

0
doc/.gitkeep Normal file
View file

3
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,3 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* You need to install [CI_package_check](https://github.com/YunoHost/CI_package_check) using the build_CI.sh script before installing YunoRunner
* When YunoRunner is installed, modify the systemd script to add the path of the script analyseCI.sh. The default systemd is configured to `/home/CI_package_check/analyseCI.sh`

0
doc/screenshots/.gitkeep Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

@ -8,6 +8,10 @@
}, },
"version": "2021-06-30~ynh1", "version": "2021-06-30~ynh1",
"url": "https://github.com/YunoHost/yunorunner", "url": "https://github.com/YunoHost/yunorunner",
"upstream": {
"license": "GPL-3.0-or-later",
"code": "https://github.com/YunoHost/yunorunner"
},
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {
"name": "" "name": ""

View file

@ -9,7 +9,7 @@ pkg_dependencies="python3-venv python3-dev python3-pip sqlite3"
yunorunner_repository="https://github.com/YunoHost/yunorunner" yunorunner_repository="https://github.com/YunoHost/yunorunner"
yunorunner_release="eda079abcfdddbcefa1ceb863f9224b1cc077eb2" yunorunner_release="9cde6e979a59424396659fa934323a677ba8c960"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -71,7 +71,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -110,9 +110,6 @@ pushd $final_path
python3 -m venv venv python3 -m venv venv
venv/bin/pip install --upgrade pip venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements-frozen.txt venv/bin/pip install -r requirements-frozen.txt
#Fix current websocket version error (2019-02-14)
venv/bin/pip uninstall -y websockets
venv/bin/pip install 'websockets>=6.0,<7.0'
popd popd
#================================================= #=================================================

View file

@ -26,6 +26,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." ynh_script_progression --message="Removing $app service integration..."

View file

@ -94,9 +94,6 @@ pushd $final_path
python3 -m venv venv python3 -m venv venv
venv/bin/pip install --upgrade pip venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements-frozen.txt venv/bin/pip install -r requirements-frozen.txt
#Fix current websocket version error (2019-02-14)
venv/bin/pip uninstall -y websockets
venv/bin/pip install 'websockets>=6.0,<7.0'
popd popd
#================================================= #=================================================

View file

@ -28,35 +28,6 @@ ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# If port doesn't exist, create it
if [ -z "$port" ]; then
port=4242
ynh_app_setting_set --app=$app --key=port --value=$port
fi
if [[ ! -d "$final_path/.git/" ]]
then
git init "$final_path"
pushd "$final_path"
git remote add origin "$yunorunner_repository"
popd
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
# Remove Pythonz
ynh_secure_remove --file="$final_path/.pythonz"
#================================================= #=================================================
# CLOSE A PORT # CLOSE A PORT
#================================================= #=================================================
@ -96,13 +67,42 @@ ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped YunoRunner CI" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped YunoRunner CI"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# If port doesn't exist, create it
if [ -z "$port" ]; then
port=4242
ynh_app_setting_set --app=$app --key=port --value=$port
fi
if [[ ! -d "$final_path/.git/" ]]
then
git init "$final_path"
pushd "$final_path"
git remote add origin "$yunorunner_repository"
popd
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
# Remove Pythonz
ynh_secure_remove --file="$final_path/.pythonz"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -149,9 +149,6 @@ pushd $final_path
python3 -m venv venv python3 -m venv venv
venv/bin/pip install --upgrade pip venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements-frozen.txt venv/bin/pip install -r requirements-frozen.txt
#Fix current websocket version error (2019-02-14)
venv/bin/pip uninstall -y websockets
venv/bin/pip install 'websockets>=6.0,<7.0'
popd popd
#================================================= #=================================================