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

Merge branch 'testing' of github.com:YunoHost-Apps/gitlab_ynh into testing

This commit is contained in:
Kay0u 2021-06-08 17:41:34 +02:00
commit 3b173c0e06
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
14 changed files with 140 additions and 179 deletions

View file

@ -1,3 +1,8 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# GitLab for YunoHost
[![Integration level](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg)
@ -5,59 +10,51 @@
*[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install GitLab quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
> *This package allows you to install GitLab quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
GitLab is a web-based Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc.
Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features.
**Shipped version:** 13.12.3
**Shipped version:** 13.12.1~ynh1
**Demo:** https://gitlab.com/explore
## Screenshots
![](https://upload.wikimedia.org/wikipedia/commons/9/9a/GitLab_running_11.0_%282018-07%29.png)
![](./doc/screenshots/GitLab_running_11.0_(2018-07).png)
## Configuration
## Disclaimers / important information
### Configuration
How to configure GitLab:
- With the GitLab admin panel.
- By editing the configuration file `/etc/gitlab/gitlab-persistent.rb` (use `sudo gitlab-ctl reconfigure` after any modification of this file).
## Documentation
* Official documentation: https://docs.gitlab.com/ce/README.html
* YunoHost documentation: https://yunohost.org/#/app_gitlab
## YunoHost specific features
#### Multi-users support
### Multi-users support
* Are LDAP and HTTP auth supported? **Yes**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gitlab/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gitlab/)
## Limitations
### Limitations
* GitLab is not compatible with 32-bit architectures.
## Links
## Documentation and resources
* Report a bug: https://github.com/YunoHost-Apps/gitlab_ynh/issues
* App website: https://gitlab.com
* Upstream app repository: https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab-ce
* YunoHost website: https://yunohost.org/
* Official app website: https://gitlab.com
* Official user documentation: https://yunohost.org/fr/app_gitlab
* Official admin documentation: https://docs.gitlab.com/
* Upstream app code repository: https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab
* YunoHost documentation for this app: https://yunohost.org/app_gitlab
* Report a bug: https://github.com/YunoHost-Apps/gitlab_ynh/issues
---
## Developer info
## Developers info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing).
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
@ -65,3 +62,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/gitlab_ynh/tree/testi
or
sudo yunohost app upgrade gitlab -u https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

View file

@ -1,59 +1,52 @@
# GitLab pour YunoHost
[![Integration level](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg)
[![Installer GitLab pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitlab)
[![Niveau d'intégration](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg)
[![Installer GitLab avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitlab)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer GitLab rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
GitLab est un gestionnaire Web de dépôt Git fournissant des fonctionnalités de wiki, de rapports de bugs et de pipeline CI/CD. GitLab est une application open source développée par GitLab Inc.
Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD.
**Version incluse :** 13.12.3
**Version incluse :** 13.12.1~ynh1
**Démo :** https://gitlab.com/explore
## Captures d'écran
![](https://upload.wikimedia.org/wikipedia/commons/9/9a/GitLab_running_11.0_%282018-07%29.png)
![](./doc/screenshots/GitLab_running_11.0_(2018-07).png)
## Configuration
## Avertissements / informations importantes
### Configuration
Comment configurer GitLab :
- Avec le panneau d'administration de GitLab.
- En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration.
## Documentation
* Documentation officielle : https://docs.gitlab.com/ce/README.html
* Documentation YunoHost : https://yunohost.org/#/app_gitlab_fr
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateurs
### Support multi-utilisateurs
* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui**
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gitlab/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gitlab/)
## Limitations
### Limitations
* L'application GitLab n'est pas compatible avec les architectures 32-bit.
## Liens
## Documentations et ressources
* Signaler un bug : https://github.com/YunoHost-Apps/gitlab_ynh/issues
* Site de l'application : https://gitlab.com
* Dépôt de l'application principale : https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab-ce
* Site web YunoHost : https://yunohost.org/
---
* Site officiel de l'app : https://gitlab.com
* Documentation officielle utilisateur : https://yunohost.org/fr/app_gitlab
* Documentation officielle de l'admin : https://docs.gitlab.com/
* Dépôt de code officiel de l'app : https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab
* Documentation YunoHost pour cette app : https://yunohost.org/app_gitlab
* Signaler un bug : https://github.com/YunoHost-Apps/gitlab_ynh/issues
## Informations pour les développeurs
@ -62,6 +55,8 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug
or
ou
sudo yunohost app upgrade gitlab -u https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_armhf.deb/download.deb
SOURCE_SUM=__SHA256_SUM__
SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_armhf.deb/download.deb
SOURCE_SUM=__GITLAB_SOURCE_SHA256__
SOURCE_SUM_PRG=sha256sum
SOURCE_FILENAME=__SOURCE_FILENAME__
SOURCE_FILENAME=__GITLAB_FILENAME__
SOURCE_EXTRACT=false
SOURCE_FORMAT=deb

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_arm64.deb/download.deb
SOURCE_SUM=__SHA256_SUM__
SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_arm64.deb/download.deb
SOURCE_SUM=__GITLAB_SOURCE_SHA256__
SOURCE_SUM_PRG=sha256sum
SOURCE_FILENAME=__SOURCE_FILENAME__
SOURCE_FILENAME=__GITLAB_FILENAME__
SOURCE_EXTRACT=false
SOURCE_FORMAT=deb

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_amd64.deb/download.deb
SOURCE_SUM=__SHA256_SUM__
SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_amd64.deb/download.deb
SOURCE_SUM=__GITLAB_SOURCE_SHA256__
SOURCE_SUM_PRG=sha256sum
SOURCE_FILENAME=__SOURCE_FILENAME__
SOURCE_FILENAME=__GITLAB_FILENAME__
SOURCE_EXTRACT=false
SOURCE_FORMAT=deb

15
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,15 @@
### Configuration
How to configure GitLab:
- With the GitLab admin panel.
- By editing the configuration file `/etc/gitlab/gitlab-persistent.rb` (use `sudo gitlab-ctl reconfigure` after any modification of this file).
### Multi-users support
* Are LDAP and HTTP auth supported? **Yes**
* Can the app be used by multiple users? **Yes**
### Limitations
* GitLab is not compatible with 32-bit architectures.

15
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,15 @@
### Configuration
Comment configurer GitLab :
- Avec le panneau d'administration de GitLab.
- En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration.
### Support multi-utilisateurs
* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui**
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
### Limitations
* L'application GitLab n'est pas compatible avec les architectures 32-bit.

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

View file

@ -4,10 +4,18 @@
"packaging_format": 1,
"version": "13.12.3~ynh1",
"description": {
"en": "Git-repository manager.",
"fr": "Gestionnaire de dépôts Git."
"en": "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features.",
"fr": "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD."
},
"url": "https://gitlab.com",
"upstream": {
"license": "MIT",
"website": "https://gitlab.com",
"demo": "https://gitlab.com/explore",
"admindoc": "https://docs.gitlab.com/",
"userdoc": "https://yunohost.org/fr/app_gitlab",
"code": "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab"
},
"license": "MIT",
"maintainer": {
"name": "kay0u",
@ -25,38 +33,22 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for GitLab",
"fr": "Choisissez un nom de domaine pour GitLab"
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for GitLab",
"fr": "Choisissez un chemin pour GitLab"
},
"example": "/gitlab",
"default": "/gitlab"
},
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": true
},
{

View file

@ -29,8 +29,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
port=$(ynh_app_setting_get --app="$app" --key=web_port)
portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port)
portSidekiq=$(ynh_app_setting_get --app="$app" --key=sidekiq_port)
puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port)
sidekiq_port=$(ynh_app_setting_get --app="$app" --key=sidekiq_port)
puma_worker_processes=$(ynh_app_setting_get --app="$app" --key=puma_workers)
puma_min_threads=$(ynh_app_setting_get --app="$app" --key=puma_min_threads)
puma_max_threads=$(ynh_app_setting_get --app="$app" --key=puma_max_threads)
@ -108,28 +108,15 @@ done
#=================================================
ynh_script_progression --message="Configure GitLab..." --weight=28
ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
mkdir -p $config_path
cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb"
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
domain="$new_domain"
path_url="$new_path"
ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb"
generated_external_url="https://$domain${path_url%/}"
ynh_store_file_checksum --file="$config_path/gitlab.rb"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
#=================================================
# RECONFIGURE GITLAB
@ -142,7 +129,7 @@ gitlab-ctl reconfigure
#=================================================
ynh_script_progression --message="Waiting for GitLab..." --weight=15
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$portPuma" --timeout=300
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300
#=================================================
# GENERIC FINALISATION

View file

@ -86,12 +86,12 @@ ynh_script_progression --message="Find internal port..." --weight=1
# Find free ports
port=$(ynh_find_port --port=8080)
portPuma=$(ynh_find_port --port=$(($port + 1)))
portSidekiq=$(ynh_find_port --port=$(($portPuma + 1)))
puma_port=$(ynh_find_port --port=$(($port + 1)))
sidekiq_port=$(ynh_find_port --port=$(($puma_port + 1)))
ynh_app_setting_set --app=$app --key=web_port --value=$port
ynh_app_setting_set --app=$app --key=puma_port --value=$portPuma
ynh_app_setting_set --app=$app --key=sidekiq_port --value=$portSidekiq
ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port
ynh_app_setting_set --app=$app --key=sidekiq_port --value=$sidekiq_port
#=================================================
# INSTALL DEPENDENCIES
@ -169,27 +169,14 @@ ynh_script_progression --message="Preconfigure GitLab..." --weight=1
mkdir -p $config_path
touch "$config_path/gitlab-persistent.rb"
chown admin: "$config_path/gitlab-persistent.rb"
chown root:root "$config_path/gitlab-persistent.rb"
chmod 640 "$config_path/gitlab-persistent.rb"
cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb"
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb"
generated_external_url="https://$domain${path_url%/}"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_store_file_checksum --file="$config_path/gitlab.rb"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -197,11 +184,7 @@ ynh_store_file_checksum --file="$config_path/gitlab.rb"
ynh_script_progression --message="Setting up source files..." --weight=50
source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src
ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
tempdir="$(mktemp -d)"
@ -274,7 +257,7 @@ ynh_systemd_action --action=reload --service_name=nginx
#=================================================
ynh_script_progression --message="Restarting GitLab..." --weight=15
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$portPuma" --timeout=300
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300
#=================================================
# END OF SCRIPT

View file

@ -33,7 +33,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port)
puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port)
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
#=================================================
@ -97,11 +97,7 @@ ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb"
ynh_script_progression --message="Reinstalling GitLab..." --weight=50
source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src
ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
tempdir="$(mktemp -d)"
@ -149,7 +145,7 @@ yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/applica
#=================================================
ynh_script_progression --message="Waiting for GitLab..." --weight=14
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$portPuma" --timeout=300
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300
#=================================================
# CHECK THE RESTORED DATA

View file

@ -18,12 +18,11 @@ app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
domain=$(ynh_app_setting_get --app="$app" --key=domain)
path_url=$(ynh_app_setting_get --app="$app" --key=path)
is_public=$(ynh_app_setting_get --app="$app" --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
port=$(ynh_app_setting_get --app="$app" --key=web_port)
portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port)
portSidekiq=$(ynh_app_setting_get --app="$app" --key=sidekiq_port)
puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port)
sidekiq_port=$(ynh_app_setting_get --app="$app" --key=sidekiq_port)
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
puma_worker_processes=$(ynh_app_setting_get --app="$app" --key=puma_workers)
puma_min_threads=$(ynh_app_setting_get --app="$app" --key=puma_min_threads)
@ -41,11 +40,6 @@ upgrade_type=$(ynh_check_app_version_changed)
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
# Delete is_public if it exists
if [ ! -z $is_public ]; then
ynh_app_setting_delete --app=$app --key=is_public
fi
# If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/opt/$app
@ -126,19 +120,19 @@ if [ -z "$port" ]; then
fi
# If port doesn't exist, retrieve it
if [ -z "$portPuma" ]; then
if [ -z "$puma_port" ]; then
if [ -z "$(ynh_app_setting_get --app="$app" --key=unicorn_port)" ]; then
portPuma=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3)
puma_port=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3)
else
portPuma=$(ynh_app_setting_get --app="$app" --key=unicorn_port)
puma_port=$(ynh_app_setting_get --app="$app" --key=unicorn_port)
fi
ynh_app_setting_set --app=$app --key=puma_port --value=$portPuma
ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port
ynh_app_setting_delete --app=$app --key=unicorn_port
fi
if [ -z "$portSidekiq" ]; then
portSidekiq=$(ynh_find_port $(($portPuma + 1)))
ynh_app_setting_set --app=$app --key=sidekiq_port --value=$portSidekiq
if [ -z "$sidekiq_port" ]; then
sidekiq_port=$(ynh_find_port $(($puma_port + 1)))
ynh_app_setting_set --app=$app --key=sidekiq_port --value=$sidekiq_port
fi
# if this source file exist, remove it
@ -265,11 +259,7 @@ then
fi
fi
cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src
ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
tempdir="$(mktemp -d)"
@ -306,28 +296,16 @@ done
#=================================================
ynh_script_progression --message="Reconfigure GitLab..." --weight=13
ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
mkdir -p $config_path
cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb"
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb"
ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb"
generated_external_url="https://$domain${path_url%/}"
ynh_store_file_checksum --file="$config_path/gitlab.rb"
ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
touch "$config_path/gitlab-persistent.rb"
chown admin: "$config_path/gitlab-persistent.rb"
chown root:root "$config_path/gitlab-persistent.rb"
chmod 640 "$config_path/gitlab-persistent.rb"
gitlab-ctl reconfigure
@ -362,7 +340,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Restarting GitLab..." --weight=15
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$portPuma" --timeout=300
ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300
fi
#=================================================

View file

@ -48,9 +48,10 @@ if [[ "$(basename $file)" == upgrade.last.sh ]]; then
# Update manifest
sed -i -e "s/\"version\": \"[^0-9.]*[0-9.]*[0-9.]~ynh[0-9.]\"/\"version\": \"$version~ynh1\"/" $gitlab_directory/manifest.json
# Update readme
sed -i -e "s/\*\*Shipped version:\*\* [^0-9.]*[0-9.]*[0-9.]/**Shipped version:** $version/" $gitlab_directory/README.md
sed -i -e "s/\*\*Version incluse :\*\* [^0-9.]*[0-9.]*[0-9.]/**Version incluse :** $version/" $gitlab_directory/README_fr.md
# Don't, it's autogenerated now
## Update readme
#sed -i -e "s/\*\*Shipped version:\*\* [^0-9.]*[0-9.]*[0-9.]/**Shipped version:** $version/" $gitlab_directory/README.md
#sed -i -e "s/\*\*Version incluse :\*\* [^0-9.]*[0-9.]*[0-9.]/**Version incluse :** $version/" $gitlab_directory/README_fr.md
# Update gitlab.rb
conf_file=$gitlab_directory/conf/gitlab.rb