1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

Merge pull request #10 from bourreP/upgrade

update upgrade script
This commit is contained in:
Rafi59 2018-04-14 22:14:44 +02:00 committed by GitHub
commit 9fd0fbdd0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,40 +14,27 @@ domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get "$app" path_url) path_url=$(ynh_app_setting_get "$app" path_url)
admin=$(ynh_app_setting_get "$app" admin) admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public) is_public=$(ynh_app_setting_get "$app" is_public)
language=$(ynh_app_setting_get "$app" language)
# Remove trailing "/" for next commands portNginx=$(ynh_find_port 8080)
path_url=${path_url%/} portUnicorn=$(ynh_find_port 9080)
# Copy source files # Gitlab configuration
src_path=/var/www/$app gitlab_conf_path=../conf/gitlab.rb
sudo mkdir -p $src_path ynh_replace_string "GENERATED_EXTERNAL_URL" "https://$domain${path_url%/}" $gitlab_conf_path
sudo cp -a ../sources/. $src_path ynh_replace_string "PORTNGINX" "$portNginx" $gitlab_conf_path
ynh_replace_string "PORTUNICORN" "$portUnicorn" $gitlab_conf_path
# Set permissions to app files sudo cp -f ../conf/gitlab.rb /etc/gitlab/gitlab.rb
# you may need to make some file and/or directory writeable by www-data (nginx user)
sudo chown -R root: $src_path
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
nginx_conf=../conf/nginx.conf nginx_conf=../conf/nginx.conf
sed -i "s@YNH_WWW_PATH@$path_url@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf ynh_replace_string "YNH_WWW_PATH" "${path_url%/}/" $nginx_conf
# If a dedicated php-fpm process is used: ynh_replace_string "PORT" "$portNginx" $nginx_conf
#
# sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
### PHP (remove if not used) ### sudo apt-get update
# If a dedicated php-fpm process is used: sudo apt-get install -yy gitlab-ce
# # Modify PHP-FPM pool configuration and copy it to the pool directory
# sed -i "s@YNH_WWW_APP@$app@g" ../conf/php-fpm.conf
# sed -i "s@YNH_WWW_ALIAS@$src_path/@g" ../conf/php-fpm.conf
# finalphpconf=/etc/php5/fpm/pool.d/$app.conf
# sudo cp ../conf/php-fpm.conf $finalphpconf
# sudo chown root: $finalphpconf
# sudo chmod 644 $finalphpconf
# sudo service php5-fpm restart
### PHP end ###
# If app is public, add url to SSOWat conf as skipped_uris # If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]]; then if [[ $is_public -eq 1 ]]; then