mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Merge branch 'all_merged' into v0.9.0
This commit is contained in:
commit
69097cab58
6 changed files with 67 additions and 3 deletions
7
.travis.yml
Normal file
7
.travis.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
language: python
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- git clone https://github.com/YunoHost/package_linter /tmp/package_linter
|
||||||
|
|
||||||
|
script:
|
||||||
|
- /tmp/package_linter/package_linter.py ./
|
|
@ -1,6 +1,6 @@
|
||||||
APP_NAME=__APP__
|
APP_NAME=__APP__
|
||||||
APP_ENV=production
|
APP_ENV=production
|
||||||
APP_KEY=
|
APP_KEY=__APP_KEY__
|
||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_URL=https://__DOMAIN__
|
APP_URL=https://__DOMAIN__
|
||||||
|
|
||||||
|
|
23
pull_request_template.md
Normal file
23
pull_request_template.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
## Problem
|
||||||
|
- *Description of why you made this PR*
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
- *And how do you fix that problem*
|
||||||
|
|
||||||
|
## PR Status
|
||||||
|
- [ ] Code finished.
|
||||||
|
- [ ] Tested with Package_check.
|
||||||
|
- [ ] Fix or enhancement tested.
|
||||||
|
- [ ] Upgrade from last version tested.
|
||||||
|
- [ ] Can be reviewed and tested.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
---
|
||||||
|
- [ ] **Code review**
|
||||||
|
- [ ] **Approval (LGTM)**
|
||||||
|
*Code review and approval have to be from a member of @YunoHost/apps group*
|
||||||
|
- **CI succeeded** :
|
||||||
|
[](https://ci-apps-dev.yunohost.org/jenkins/job/pixelfed_ynh%20-BRANCH-/)
|
||||||
|
*Please replace '-BRANCH-' in this link by the name of the branch used.*
|
||||||
|
*If the PR is from a forked repository. Please provide public results from package_check.*
|
||||||
|
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.
|
|
@ -96,6 +96,9 @@ ynh_install_php () {
|
||||||
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
||||||
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
||||||
|
|
||||||
|
# Set php7.0 back as the default version for php-cli.
|
||||||
|
update-alternatives --set php /usr/bin/php7.0
|
||||||
|
|
||||||
# Remove this extra repository after packages are installed
|
# Remove this extra repository after packages are installed
|
||||||
ynh_remove_extra_repo --name=extra_php_version
|
ynh_remove_extra_repo --name=extra_php_version
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
app_key=$(ynh_string_random 32 | base64)
|
||||||
|
app_key="base64:$app_key"
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -44,6 +46,7 @@ ynh_webpath_register "$app" "$domain" "$path_url"
|
||||||
ynh_app_setting_set "$app" domain "$domain"
|
ynh_app_setting_set "$app" domain "$domain"
|
||||||
ynh_app_setting_set "$app" path "$path_url"
|
ynh_app_setting_set "$app" path "$path_url"
|
||||||
ynh_app_setting_set "$app" is_public "$is_public"
|
ynh_app_setting_set "$app" is_public "$is_public"
|
||||||
|
ynh_app_setting_set "$app" app_key "$app_key"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -129,6 +132,7 @@ config="$final_path/.env"
|
||||||
cp ../conf/.env "$config"
|
cp ../conf/.env "$config"
|
||||||
|
|
||||||
ynh_replace_string "__APP__" "$app" "$config"
|
ynh_replace_string "__APP__" "$app" "$config"
|
||||||
|
ynh_replace_string "__APP_KEY__" "$app_key" "$config"
|
||||||
ynh_replace_string "__DOMAIN__" "$domain" "$config"
|
ynh_replace_string "__DOMAIN__" "$domain" "$config"
|
||||||
ynh_replace_string "__PATH__" "$path_url" "$config"
|
ynh_replace_string "__PATH__" "$path_url" "$config"
|
||||||
ynh_replace_string "__DB_NAME__" "$db_name" "$config"
|
ynh_replace_string "__DB_NAME__" "$db_name" "$config"
|
||||||
|
|
|
@ -23,6 +23,9 @@ is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
final_path=$(ynh_app_setting_get "$app" final_path)
|
final_path=$(ynh_app_setting_get "$app" final_path)
|
||||||
language=$(ynh_app_setting_get "$app" language)
|
language=$(ynh_app_setting_get "$app" language)
|
||||||
db_name=$(ynh_app_setting_get "$app" db_name)
|
db_name=$(ynh_app_setting_get "$app" db_name)
|
||||||
|
db_user=$db_name
|
||||||
|
db_pwd=$(ynh_app_setting_get "$app" db_pwd)
|
||||||
|
app_key=$(ynh_app_setting_get "$app" app_key)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
@ -50,6 +53,12 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set "$app" final_path "$final_path"
|
ynh_app_setting_set "$app" final_path "$final_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If app_key doesn't exist, retrieve it
|
||||||
|
if [ -z "$app_key" ]; then
|
||||||
|
app_key=$(grep -oP "APP_KEY=\Kbase64.*" "$final_path/.env")
|
||||||
|
ynh_app_setting_set "$app" app_key "$app_key"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -134,6 +143,21 @@ chown -R "$app": "$final_path"
|
||||||
|
|
||||||
ynh_install_composer --workdir="$final_path"
|
ynh_install_composer --workdir="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# MODIFY A CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
config="$final_path/.env"
|
||||||
|
cp ../conf/.env "$config"
|
||||||
|
|
||||||
|
ynh_replace_string "__APP__" "$app" "$config"
|
||||||
|
ynh_replace_string "__APP_KEY__" "$app_key" "$config"
|
||||||
|
ynh_replace_string "__DOMAIN__" "$domain" "$config"
|
||||||
|
ynh_replace_string "__PATH__" "$path_url" "$config"
|
||||||
|
ynh_replace_string "__DB_NAME__" "$db_name" "$config"
|
||||||
|
ynh_replace_string "__DB_USER__" "$db_user" "$config"
|
||||||
|
ynh_replace_string "__DB_PWD__" "$db_pwd" "$config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DEPLOYMENT
|
# DEPLOYMENT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -149,11 +173,14 @@ pushd "$final_path"
|
||||||
php7.2 artisan horizon:purge
|
php7.2 artisan horizon:purge
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STORE THE CHECKSUM OF THE CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup_if_checksum_is_different "$config"
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE"
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum "$final_path/.env"
|
ynh_store_file_checksum "$config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue