mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
commit
08921c7130
27 changed files with 166 additions and 654 deletions
20
README.md
20
README.md
|
@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features
|
||||
|
||||
**Shipped version:** 16.2.4~ynh1
|
||||
**Shipped version:** 16.3.0~ynh1
|
||||
|
||||
**Demo:** https://gitlab.com/explore
|
||||
|
||||
|
@ -26,24 +26,6 @@ Git-repository manager providing wiki, issue-tracking and CI/CD pipeline feature
|
|||
|
||||
![Screenshot of GitLab](./doc/screenshots/GitLab_running_11.0_(2018-07).png)
|
||||
|
||||
## 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).
|
||||
|
||||
### 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.
|
||||
|
||||
## Documentation and resources
|
||||
|
||||
* Official app website: <https://gitlab.com>
|
||||
|
|
20
README_fr.md
20
README_fr.md
|
@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
|
|||
|
||||
Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD
|
||||
|
||||
**Version incluse :** 16.2.4~ynh1
|
||||
**Version incluse :** 16.3.0~ynh1
|
||||
|
||||
**Démo :** https://gitlab.com/explore
|
||||
|
||||
|
@ -26,24 +26,6 @@ Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bu
|
|||
|
||||
![Capture d’écran de GitLab](./doc/screenshots/GitLab_running_11.0_(2018-07).png)
|
||||
|
||||
## 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.
|
||||
|
||||
### 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.
|
||||
|
||||
## Documentations et ressources
|
||||
|
||||
* Site officiel de l’app : <https://gitlab.com>
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
# See here for more informations
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/gitlab" (PATH)
|
||||
admin="john" (USER)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
use_web_account=0
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=722fa8db9d8d840064ffc64338e1170da7cafc37
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
port_already_use=0 (8080)
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=722fa8db9d8d840064ffc64338e1170da7cafc37
|
||||
name=15.0.0
|
|
@ -1,4 +1,4 @@
|
|||
SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/buster/gitlab-ce___GITLAB_VERSION__-ce.0_armhf.deb/download.deb
|
||||
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=__GITLAB_FILENAME__
|
||||
|
|
|
@ -1010,7 +1010,7 @@ puma['max_threads'] = __PUMA_MAX_THREADS__
|
|||
|
||||
### Advanced settings
|
||||
# puma['listen'] = '127.0.0.1'
|
||||
puma['port'] = __PUMA_PORT__
|
||||
puma['port'] = __PORT_PUMA__
|
||||
# puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
|
||||
# puma['somaxconn'] = 1024
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ puma['port'] = __PUMA_PORT__
|
|||
# sidekiq['metrics_enabled'] = true
|
||||
# sidekiq['exporter_log_enabled'] = false
|
||||
# sidekiq['listen_address'] = "localhost"
|
||||
sidekiq['listen_port'] = __SIDEKIQ_PORT__
|
||||
sidekiq['listen_port'] = __PORT_SIDEKIQ__
|
||||
|
||||
################################################################################
|
||||
## gitlab-shell
|
||||
|
|
|
@ -1121,7 +1121,7 @@ puma['max_threads'] = __PUMA_MAX_THREADS__
|
|||
|
||||
### Advanced settings
|
||||
# puma['listen'] = '127.0.0.1'
|
||||
puma['port'] = __PUMA_PORT__
|
||||
puma['port'] = __PORT_PUMA__
|
||||
# puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
|
||||
# puma['somaxconn'] = 1024
|
||||
|
||||
|
@ -1197,7 +1197,7 @@ puma['port'] = __PUMA_PORT__
|
|||
# sidekiq['exporter_tls_cert_path'] = ""
|
||||
# sidekiq['exporter_tls_key_path'] = ""
|
||||
# sidekiq['listen_address'] = "localhost"
|
||||
sidekiq['listen_port'] = __SIDEKIQ_PORT__
|
||||
sidekiq['listen_port'] = __PORT_SIDEKIQ__
|
||||
|
||||
##! Specifies where health-check endpoints should be made available for Sidekiq processes.
|
||||
##! Defaults to the same settings as for Prometheus metrics (see above).
|
||||
|
@ -2004,8 +2004,8 @@ nginx['listen_https'] = false
|
|||
# gitlab_kas['enable'] = true
|
||||
|
||||
##! Agent configuration for GitLab KAS
|
||||
# gitlab_kas['agent_configuration_poll_period'] = 20
|
||||
# gitlab_kas['agent_gitops_poll_period'] = 20
|
||||
# gitlab_kas['agent_configuration_poll_period'] = 300
|
||||
# gitlab_kas['agent_gitops_poll_period'] = 300
|
||||
# gitlab_kas['agent_gitops_project_info_cache_ttl'] = 300
|
||||
# gitlab_kas['agent_gitops_project_info_cache_error_ttl'] = 60
|
||||
# gitlab_kas['agent_info_cache_ttl'] = 300
|
||||
|
@ -2399,93 +2399,6 @@ nginx['listen_https'] = false
|
|||
# To completely disable prometheus, and all of it's exporters, set to false
|
||||
# prometheus_monitoring['enable'] = true
|
||||
|
||||
################################################################################
|
||||
## Grafana Dashboards
|
||||
##! Docs: https://docs.gitlab.com/ee/administration/monitoring/prometheus/#prometheus-as-a-grafana-data-source
|
||||
################################################################################
|
||||
|
||||
# grafana['enable'] = false
|
||||
# grafana['enable_deprecated_service'] = false
|
||||
# grafana['log_directory'] = '/var/log/gitlab/grafana'
|
||||
# grafana['log_group'] = nil
|
||||
# grafana['home'] = '/var/opt/gitlab/grafana'
|
||||
# grafana['admin_password'] = 'admin'
|
||||
# grafana['allow_user_sign_up'] = false
|
||||
# grafana['basic_auth_enabled'] = false
|
||||
# grafana['disable_login_form'] = true
|
||||
# grafana['gitlab_application_id'] = 'GITLAB_APPLICATION_ID'
|
||||
# grafana['gitlab_secret'] = 'GITLAB_SECRET'
|
||||
# grafana['env_directory'] = '/opt/gitlab/etc/grafana/env'
|
||||
# grafana['allowed_groups'] = []
|
||||
# grafana['gitlab_auth_sign_up'] = true
|
||||
# grafana['env'] = {
|
||||
# 'SSL_CERT_DIR' => "#{node['package']['install-dir']}/embedded/ssl/certs/"
|
||||
# }
|
||||
# grafana['metrics_enabled'] = false
|
||||
# grafana['metrics_basic_auth_username'] = 'grafana_metrics' # default: nil
|
||||
# grafana['metrics_basic_auth_password'] = 'please_set_a_unique_password' # default: nil
|
||||
# grafana['alerting_enabled'] = false
|
||||
|
||||
### SMTP Configuration
|
||||
#
|
||||
# See: http://docs.grafana.org/administration/configuration/#smtp
|
||||
#
|
||||
# grafana['smtp'] = {
|
||||
# 'enabled' => true,
|
||||
# 'host' => 'localhost:25',
|
||||
# 'user' => nil,
|
||||
# 'password' => nil,
|
||||
# 'cert_file' => nil,
|
||||
# 'key_file' => nil,
|
||||
# 'skip_verify' => false,
|
||||
# 'from_address' => 'admin@grafana.localhost',
|
||||
# 'from_name' => 'Grafana',
|
||||
# 'ehlo_identity' => 'dashboard.example.com',
|
||||
# 'startTLS_policy' => nil
|
||||
# }
|
||||
|
||||
# Grafana usage reporting defaults to gitlab_rails['usage_ping_enabled']
|
||||
# grafana['reporting_enabled'] = true
|
||||
|
||||
### Dashboards
|
||||
#
|
||||
# See: http://docs.grafana.org/administration/provisioning/#dashboards
|
||||
#
|
||||
# NOTE: Setting this will override the default.
|
||||
#
|
||||
# grafana['dashboards'] = [
|
||||
# {
|
||||
# 'name' => 'GitLab Omnibus',
|
||||
# 'orgId' => 1,
|
||||
# 'folder' => 'GitLab Omnibus',
|
||||
# 'type' => 'file',
|
||||
# 'disableDeletion' => true,
|
||||
# 'updateIntervalSeconds' => 600,
|
||||
# 'options' => {
|
||||
# 'path' => '/opt/gitlab/embedded/service/grafana-dashboards',
|
||||
# }
|
||||
# }
|
||||
# ]
|
||||
|
||||
### Datasources
|
||||
#
|
||||
# See: http://docs.grafana.org/administration/provisioning/#example-datasource-config-file
|
||||
#
|
||||
# NOTE: Setting this will override the default.
|
||||
#
|
||||
# grafana['datasources'] = [
|
||||
# {
|
||||
# 'name' => 'GitLab Omnibus',
|
||||
# 'type' => 'prometheus',
|
||||
# 'access' => 'proxy',
|
||||
# 'url' => 'http://localhost:9090'
|
||||
# }
|
||||
# ]
|
||||
|
||||
##! Advanced settings. Should be changed only if absolutely needed.
|
||||
# grafana['http_addr'] = 'localhost'
|
||||
# grafana['http_port'] = 3000
|
||||
|
||||
################################################################################
|
||||
## Gitaly
|
||||
##! Docs: https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html
|
||||
|
@ -2742,6 +2655,7 @@ nginx['listen_https'] = false
|
|||
# letsencrypt['auto_renew_minute'] = nil # Should be a number or cron expression, if specified.
|
||||
# letsencrypt['auto_renew_day_of_month'] = "*/4"
|
||||
# letsencrypt['auto_renew_log_directory'] = '/var/log/gitlab/lets-encrypt'
|
||||
# letsencrypt['alt_names'] = []
|
||||
|
||||
##! Turn off automatic init system detection. To skip init detection in
|
||||
##! non-docker containers. Recommended not to change.
|
||||
|
|
|
@ -4,12 +4,3 @@ 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.
|
6
doc/ADMIN_fr.md
Normal file
6
doc/ADMIN_fr.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
### 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.
|
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
|||
Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
|||
Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD
|
|
@ -1,15 +0,0 @@
|
|||
### 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.
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"name": "GitLab",
|
||||
"id": "gitlab",
|
||||
"packaging_format": 1,
|
||||
"version": "16.2.4~ynh1",
|
||||
"description": {
|
||||
"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/",
|
||||
"code": "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab",
|
||||
"cpe": "cpe:2.3:a:gitlab:gitlab"
|
||||
},
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
"name": "kay0u",
|
||||
"email": "pierre@kayou.io"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.2.3"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
"nginx"
|
||||
],
|
||||
"arguments": {
|
||||
"install": [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"default": "/gitlab"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"help": {
|
||||
"en": "If your GitLab instance is public, anyone can see your public repositories.",
|
||||
"fr": "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics."
|
||||
},
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "use_web_account",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Authorize account creation from GitLab web interface",
|
||||
"fr": "Autoriser la création de compte depuis l'interface web de GitLab ?"
|
||||
},
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
82
manifest.toml
Normal file
82
manifest.toml
Normal file
|
@ -0,0 +1,82 @@
|
|||
packaging_format = 2
|
||||
|
||||
id = "gitlab"
|
||||
name = "GitLab"
|
||||
description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features"
|
||||
description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD"
|
||||
|
||||
version = "16.3.0~ynh1"
|
||||
|
||||
maintainers = ["kay0u"]
|
||||
|
||||
[upstream]
|
||||
license = "MIT"
|
||||
website = "https://gitlab.com"
|
||||
demo = "https://gitlab.com/explore"
|
||||
admindoc = "https://docs.gitlab.com/"
|
||||
code = "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab"
|
||||
cpe = "cpe:2.3:a:gitlab:gitlab"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2.3"
|
||||
architectures = ["amd64", "armhf", "arm64"]
|
||||
multi_instance = false
|
||||
ldap = true
|
||||
sso = false
|
||||
disk = "500M"
|
||||
ram.build = "3000M"
|
||||
ram.runtime = "2000M"
|
||||
|
||||
[install]
|
||||
[install.domain]
|
||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
||||
type = "domain"
|
||||
|
||||
[install.path]
|
||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
||||
type = "path"
|
||||
default = "/gitlab"
|
||||
|
||||
[install.admin]
|
||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
||||
type = "user"
|
||||
|
||||
[install.init_main_permission]
|
||||
help.en = "If your GitLab instance is set to visitors, anyone can see your public repositories."
|
||||
help.fr = "Si votre instance GitLab est définie sur visiteurs, tout le monde pourra voir vos dépôts publics."
|
||||
type = "group"
|
||||
default = "visitors"
|
||||
|
||||
[install.use_web_account]
|
||||
ask.en = "Authorize account creation from GitLab web interface"
|
||||
ask.fr = "Autoriser la création de compte depuis l'interface web de GitLab ?"
|
||||
type = "boolean"
|
||||
default = false
|
||||
|
||||
[resources]
|
||||
# [resources.sources]
|
||||
# [resources.sources.main]
|
||||
# extract = false
|
||||
# rename = "gitlab-ce-15.10.0.deb"
|
||||
# amd64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_amd64.deb/download.deb"
|
||||
# amd64.sha256 = "c8f5aca04549d3f9ba636ca67e76e9bf2b5a6a249a4a16d79365d17856a53d4d"
|
||||
# armhf.url = "https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/bullseye/gitlab-ce_15.10.0-ce.0_armhf.deb/download.deb"
|
||||
# armhf.sha256 = "a7a195bf8a74e6ca688de2debe23c0cd5482d989377dcaf7042df484731e10cc"
|
||||
# arm64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_arm64.deb/download.deb"
|
||||
# arm64.sha256 = "63d29c92eb956631a478735a6c692bbb315c898b2041b2f545c12302b230c97f"
|
||||
|
||||
[resources.system_user]
|
||||
|
||||
[resources.install_dir]
|
||||
dir = "/opt/__APP__"
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
||||
[resources.ports]
|
||||
main.default = 8080
|
||||
puma.default = 8081
|
||||
sidekiq.default = 8082
|
||||
|
||||
[resources.apt]
|
||||
packages = "openssh-server"
|
|
@ -1,11 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# SET ALL CONSTANTS
|
||||
#=================================================
|
||||
|
||||
pkg_dependencies="openssh-server"
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -10,27 +10,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
### Remove this function if there's nothing to clean before calling the remove script.
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
|
@ -57,6 +36,7 @@ ynh_backup --src_path="/var/opt/$app/backups/last_gitlab_backup.tar"
|
|||
# BACKUP CONF FILES
|
||||
#=================================================
|
||||
|
||||
config_path=/etc/$app
|
||||
ynh_backup --src_path="$config_path/gitlab-secrets.json"
|
||||
ynh_backup --src_path="$config_path/gitlab.rb"
|
||||
ynh_backup --src_path="$config_path/gitlab-persistent.rb"
|
||||
|
|
|
@ -8,48 +8,6 @@
|
|||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
old_domain=$YNH_APP_OLD_DOMAIN
|
||||
old_path=$YNH_APP_OLD_PATH
|
||||
|
||||
new_domain=$YNH_APP_NEW_DOMAIN
|
||||
new_path=$YNH_APP_NEW_PATH
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
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)
|
||||
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)
|
||||
client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size)
|
||||
|
||||
#=================================================
|
||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||
#=================================================
|
||||
|
||||
change_domain=0
|
||||
if [ "$old_domain" != "$new_domain" ]; then
|
||||
change_domain=1
|
||||
fi
|
||||
|
||||
change_path=0
|
||||
if [ "$old_path" != "$new_path" ]; then
|
||||
change_path=1
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -58,35 +16,12 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
#doc in: https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
|
||||
|
||||
if [ $change_path -eq 1 ]; then
|
||||
ynh_script_progression --message="Changing path..." --weight=4
|
||||
gitlab-ctl stop puma
|
||||
gitlab-ctl stop sidekiq
|
||||
|
||||
#doc in: https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
|
||||
|
||||
gitlab-ctl stop puma
|
||||
gitlab-ctl stop sidekiq
|
||||
|
||||
# Make a backup of the original nginx config file if modified
|
||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
||||
# Set global variables for nginx helper
|
||||
domain="$old_domain"
|
||||
path_url="$new_path"
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config client_max_body_size
|
||||
fi
|
||||
|
||||
# Change the domain for nginx
|
||||
if [ $change_domain -eq 1 ]; then
|
||||
ynh_script_progression --message="Changing domain..." --weight=4
|
||||
|
||||
# Delete file checksum for the old conf file location
|
||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||
# Store file checksum for the new config file location
|
||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
fi
|
||||
ynh_change_url_nginx_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC MODIFICATIONS
|
||||
|
@ -109,13 +44,13 @@ done
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configure GitLab..." --weight=28
|
||||
|
||||
config_path=/etc/$app
|
||||
mkdir -p $config_path
|
||||
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||
|
||||
domain="$new_domain"
|
||||
path_url="$new_path"
|
||||
path="$new_path"
|
||||
|
||||
generated_external_url="https://$domain${path_url%/}"
|
||||
generated_external_url="https://$domain${path%/}"
|
||||
|
||||
ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
|
||||
|
||||
|
@ -130,16 +65,7 @@ ynh_exec_warn_less 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:$puma_port" --timeout=300
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --action=reload --service_name=nginx
|
||||
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:$port_puma" --timeout=300
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -9,38 +9,12 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
|
||||
|
||||
ynh_clean_check_starting
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
use_web_account=$YNH_APP_ARG_USE_WEB_ACCOUNT
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||
|
||||
config_path=/etc/$app
|
||||
final_path=/opt/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
# Detect the system architecture
|
||||
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
|
||||
|
@ -59,47 +33,17 @@ fi
|
|||
# Could be an option?
|
||||
client_max_body_size="250m"
|
||||
|
||||
# Register (book) web path
|
||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..." --weight=2
|
||||
|
||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=use_web_account --value=$use_web_account
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
||||
ynh_app_setting_set --app=$app --key=architecture --value=$architecture
|
||||
ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size
|
||||
|
||||
ynh_app_setting_set --app=$app --key=overwrite_nginx --value="1"
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# FIND A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Find internal port..." --weight=1
|
||||
|
||||
# Find free ports
|
||||
port=$(ynh_find_port --port=8080)
|
||||
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=$puma_port
|
||||
ynh_app_setting_set --app=$app --key=sidekiq_port --value=$sidekiq_port
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=5
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# DEFINE THE NUMBER OF WORKERS USED
|
||||
#=================================================
|
||||
|
@ -123,7 +67,7 @@ else
|
|||
puma_max_threads=4
|
||||
fi
|
||||
|
||||
ynh_app_setting_set --app=$app --key=puma_workers --value=$puma_worker_processes
|
||||
ynh_app_setting_set --app=$app --key=puma_worker_processes --value=$puma_worker_processes
|
||||
ynh_app_setting_set --app=$app --key=puma_max_threads --value=$puma_max_threads
|
||||
ynh_app_setting_set --app=$app --key=puma_min_threads --value=$puma_min_threads
|
||||
|
||||
|
@ -143,7 +87,7 @@ fi
|
|||
if [ $swap_needed -gt 0 ]; then
|
||||
ynh_script_progression --message="Adding $swap_needed Mo to swap..."
|
||||
if ! ynh_add_swap --size=$swap_needed; then
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly"
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -174,7 +118,7 @@ chmod 640 "$config_path/gitlab-persistent.rb"
|
|||
|
||||
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||
|
||||
generated_external_url="https://$domain${path_url%/}"
|
||||
generated_external_url="https://$domain${path%/}"
|
||||
|
||||
ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
|
||||
|
||||
|
@ -190,8 +134,12 @@ tempdir="$(mktemp -d)"
|
|||
|
||||
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
|
||||
|
||||
chmod 755 $install_dir
|
||||
|
||||
ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename
|
||||
|
||||
ynh_secure_remove --file="$tempdir"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -235,20 +183,9 @@ usermod -a -G "ssh.app" "git"
|
|||
|
||||
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]; then
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --action=reload --service_name=nginx
|
||||
|
||||
|
@ -257,7 +194,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:$puma_port" --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:$port_puma" --timeout=300
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -9,22 +9,6 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
port=$(ynh_app_setting_get --app="$app" --key=web_port)
|
||||
portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||
|
||||
# Used by ynh_remove_nginx_config
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
|
@ -51,21 +35,12 @@ ynh_script_progression --message="Removing GitLab" --weight=4
|
|||
|
||||
dpkg --remove gitlab-ce
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies" --weight=3
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing app main directory" --weight=1
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
config_path=/etc/$app
|
||||
ynh_secure_remove --file="$config_path"
|
||||
|
||||
#=================================================
|
||||
|
@ -76,21 +51,6 @@ ynh_script_progression --message="Removing NGINX web server configuration" --wei
|
|||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
#=================================================
|
||||
|
||||
# These ports are no longer open but were in previous versions
|
||||
if yunohost firewall list | grep -q "\- $port$"; then
|
||||
ynh_script_progression --message="Closing port $port" --weight=1
|
||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||
fi
|
||||
|
||||
if yunohost firewall list | grep -q "\- $portPuma$"; then
|
||||
ynh_script_progression --message="Closing port $portPuma" --weight=1
|
||||
ynh_exec_warn_less yunohost firewall disallow TCP $portPuma
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
|
@ -103,7 +63,6 @@ ynh_secure_remove --file="/var/opt/$app"
|
|||
ynh_secure_remove --file="/var/log/$app"
|
||||
|
||||
# Remove swap
|
||||
|
||||
ynh_del_swap
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -10,39 +10,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
|
||||
|
||||
ynh_clean_check_starting
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
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)
|
||||
puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port)
|
||||
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
|
@ -51,14 +18,6 @@ test ! -d $final_path || ynh_die --message="There is already a directory: $final
|
|||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=5
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# ADD SWAP IF NEEDED
|
||||
#=================================================
|
||||
|
@ -75,7 +34,7 @@ fi
|
|||
if [ $swap_needed -gt 0 ]; then
|
||||
ynh_script_progression --message="Adding $swap_needed Mo to swap..."
|
||||
if ! ynh_add_swap --size=$swap_needed; then
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly"
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -84,6 +43,9 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring configuration files of GitLab..." --weight=1
|
||||
|
||||
config_path=/etc/$app
|
||||
chmod 755 $install_dir
|
||||
|
||||
ynh_restore_file --origin_path="$config_path/gitlab-secrets.json"
|
||||
ynh_restore_file --origin_path="$config_path/gitlab.rb"
|
||||
ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb"
|
||||
|
@ -142,7 +104,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:$puma_port" --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:$port_puma" --timeout=300
|
||||
|
||||
#=================================================
|
||||
# CHECK THE RESTORED DATA
|
||||
|
|
116
scripts/upgrade
116
scripts/upgrade
|
@ -9,27 +9,6 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
puma_max_threads=$(ynh_app_setting_get --app="$app" --key=puma_max_threads)
|
||||
client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size)
|
||||
overwrite_nginx=$(ynh_app_setting_get --app="$app" --key=overwrite_nginx)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
@ -40,17 +19,14 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/opt/$app
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
if [ -n $(ynh_app_setting_get --app=$app --key=web_port) ]
|
||||
then
|
||||
ynh_app_setting_set --app=$app --key=port --value=$(ynh_app_setting_get --app=$app --key=web_port)
|
||||
ynh_app_setting_delete --app=$app --key=web_port
|
||||
fi
|
||||
|
||||
# If config_path doesn't exist, create it
|
||||
if [ -z "$config_path" ]; then
|
||||
config_path=/etc/$app
|
||||
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
||||
fi
|
||||
config_path=/etc/$app
|
||||
chmod 755 $install_dir
|
||||
|
||||
if [ -z "$puma_max_threads" ] || [ -z "$puma_min_threads" ]; then
|
||||
# If the server has less than 2GB of RAM
|
||||
|
@ -75,7 +51,7 @@ if [ -z "$architecture" ]; then
|
|||
elif [ -n "$(uname -m | grep x86_64)" ]; then
|
||||
architecture="x86-64"
|
||||
elif [ -n "$(uname -m | grep 86)" ]; then
|
||||
ynh_die "Gitlab is not compatible with x86 architecture"
|
||||
ynh_die "GitLab is not compatible with x86 architecture"
|
||||
elif [ -n "$(uname -m | grep arm)" ]; then
|
||||
architecture="arm"
|
||||
else
|
||||
|
@ -91,82 +67,13 @@ if [ -z "$client_max_body_size" ]; then
|
|||
ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size
|
||||
fi
|
||||
|
||||
# If overwrite_nginx doesn't exist, create it
|
||||
if [ -z "$overwrite_nginx" ]; then
|
||||
overwrite_nginx=1
|
||||
ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx
|
||||
fi
|
||||
|
||||
# If domain doesn't exist, retrieve it
|
||||
if [ -z "$domain" ]; then
|
||||
domain=$(grep "external_url" "/etc/gitlab/gitlab.rb" | cut -d'/' -f3) # retrieve $domain from conf file
|
||||
if [ ${domain: -1} == "'" ]; then # if the last char of $domain is ' remove it
|
||||
domain=${domain:0:-1}
|
||||
fi
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
fi
|
||||
|
||||
# If path_url doesn't exist, retrieve it
|
||||
if [ -z "$path_url" ]; then
|
||||
path_url=$(grep "location" "/etc/nginx/conf.d/${domain}.d/gitlab.conf" | cut -d' ' -f2)
|
||||
path_url=$(ynh_normalize_url_path $path_url)
|
||||
ynh_app_setting_set --app=$app --key=path --value=path_url
|
||||
fi
|
||||
|
||||
# If port doesn't exist, retrieve it
|
||||
if [ -z "$port" ]; then
|
||||
port=$(grep -F "nginx['listen_port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3)
|
||||
ynh_app_setting_set --app=$app --key=web_port --value=$port
|
||||
fi
|
||||
|
||||
# If port doesn't exist, retrieve it
|
||||
if [ -z "$puma_port" ]; then
|
||||
if [ -z "$(ynh_app_setting_get --app="$app" --key=unicorn_port)" ]; then
|
||||
puma_port=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3)
|
||||
else
|
||||
puma_port=$(ynh_app_setting_get --app="$app" --key=unicorn_port)
|
||||
fi
|
||||
ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port
|
||||
ynh_app_setting_delete --app=$app --key=unicorn_port
|
||||
fi
|
||||
|
||||
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
|
||||
if [ -e "/etc/apt/sources.list.d/gitlab-ce.list" ]; then
|
||||
ynh_secure_remove --file="/etc/apt/sources.list.d/gitlab-ce.list"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
|
||||
|
||||
ynh_clean_check_starting
|
||||
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=5
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# DEFINE THE NUMBER OF WORKERS USED
|
||||
#=================================================
|
||||
|
@ -181,7 +88,7 @@ else
|
|||
puma_worker_processes=$(( $(nproc) > 2 ? $(($(nproc) - 1)) : 2 ))
|
||||
fi
|
||||
|
||||
ynh_app_setting_set --app=$app --key=puma_workers --value=$puma_worker_processes
|
||||
ynh_app_setting_set --app=$app --key=puma_worker_processes --value=$puma_worker_processes
|
||||
|
||||
#=================================================
|
||||
# ADD SWAP IF NEEDED
|
||||
|
@ -199,7 +106,7 @@ fi
|
|||
if [ $swap_needed -gt 0 ]; then
|
||||
ynh_script_progression --message="Adding $swap_needed Mo to swap..."
|
||||
if ! ynh_add_swap --size=$swap_needed; then
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly"
|
||||
ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -222,7 +129,7 @@ done
|
|||
mkdir -p $config_path
|
||||
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||
|
||||
generated_external_url="https://$domain${path_url%/}"
|
||||
generated_external_url="https://$domain${path%/}"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -409,13 +316,12 @@ 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:$puma_port" --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:$port_puma" --timeout=300
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --action=reload --service_name=nginx
|
||||
|
||||
|
|
|
@ -18,11 +18,6 @@ if [ "$architecture" = "x86-64" ]; then
|
|||
elif [ "$architecture" = "arm64" ]; then
|
||||
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
|
||||
elif [ "$architecture" = "arm" ]; then
|
||||
# If the version for arm doesn't exist, then use an older one
|
||||
if [ -z "$gitlab_arm_buster_source_sha256" ]; then
|
||||
gitlab_version="14.0.11"
|
||||
gitlab_arm_buster_source_sha256="5f1de707c840e4a518e99c89b0e90a5c21c32cac91e853f1e12ef054696100dd"
|
||||
fi
|
||||
gitlab_source_sha256=$gitlab_arm_buster_source_sha256
|
||||
fi
|
||||
|
||||
|
|
|
@ -32,11 +32,6 @@ elif [ "$architecture" = "arm64" ]; then
|
|||
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
|
||||
fi
|
||||
elif [ "$architecture" = "arm" ]; then
|
||||
# If the version for arm doesn't exist, then use an older one
|
||||
if [ -z "$gitlab_arm_buster_source_sha256" ]; then
|
||||
gitlab_version="14.10.5"
|
||||
gitlab_arm_buster_source_sha256="24a1c3089bc2836591a153a38a04ae8e0f8807d7e877e5d7fa64987f84699d56"
|
||||
fi
|
||||
gitlab_source_sha256=$gitlab_arm_buster_source_sha256
|
||||
fi
|
||||
|
||||
|
|
|
@ -32,11 +32,6 @@ elif [ "$architecture" = "arm64" ]; then
|
|||
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
|
||||
fi
|
||||
elif [ "$architecture" = "arm" ]; then
|
||||
# If the version for arm doesn't exist, then use an older one
|
||||
if [ -z "$gitlab_arm_buster_source_sha256" ]; then
|
||||
gitlab_version="15.0.4"
|
||||
gitlab_arm_buster_source_sha256="49a1d860eb533baa3e2037b0dd73ada0e5c6709ac4c9d53db2d045bc385f0292"
|
||||
fi
|
||||
gitlab_source_sha256=$gitlab_arm_buster_source_sha256
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
gitlab_version="15.11.5"
|
||||
gitlab_version="15.11.13"
|
||||
|
||||
# sha256sum found here: https://packages.gitlab.com/gitlab
|
||||
gitlab_debian_version="$(lsb_release -sc)"
|
||||
|
||||
gitlab_x86_64_bullseye_source_sha256="1cc7b52bf8380368321b6aed6eaea6aa08d6f1eca2f11317db0cc64a82c815de"
|
||||
gitlab_x86_64_buster_source_sha256="49af6b95b9c9eec501e2d8d9d46b89d7958464d7a467892cdaf7e8e435f6b2ce"
|
||||
gitlab_x86_64_bullseye_source_sha256="5c3cbe468cca4f1c90a53d59ffaeac147cb72c46eb5c48c4a3c235217c66d28d"
|
||||
gitlab_x86_64_buster_source_sha256="f8fd655c4e034c79ce2b2920f36b9a9aa6e796fde9861467e74e9de0fe87cabd"
|
||||
|
||||
gitlab_arm64_bullseye_source_sha256="7712859bc457b262cb33c0ca04c17f7f32013592bc1c96fa86a9621d538f68bc"
|
||||
gitlab_arm64_buster_source_sha256="0b633b20f05794d703ebf21d641be2a00fdcb1b7ac4d3a9ff5326b66fae14f68"
|
||||
gitlab_arm64_bullseye_source_sha256="82dbb4b1084b6599b4cc01b085a70ae0a53b837be10573696ddd9dc51f337a65"
|
||||
gitlab_arm64_buster_source_sha256="725176c1dded56fc97ebf9c5eb4f1a1866302e5609c45934228a0226d919bb3e"
|
||||
|
||||
gitlab_arm_buster_source_sha256="838c832db002b3db16d52f92f2d1390737e43ad81dff78b185829d01ce4e2096"
|
||||
gitlab_arm_bullseye_source_sha256="fdbe645ef18cfeeef2fc15c9979c6ced35f6717873538b2ade934e3e24b1dd51"
|
||||
gitlab_arm_buster_source_sha256="562a6db5270847d5aafb7e6c216746b9b9da22e5074bd431b6bd6444f89a768f"
|
||||
gitlab_arm_bullseye_source_sha256="cdd8cad053f8faa6cc33efda5e77e8698eec0c019c20b316ac19c5cb008022b0"
|
||||
|
||||
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
|
||||
|
||||
|
|
|
@ -1,24 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
gitlab_version="16.2.4"
|
||||
gitlab_version="16.3.0"
|
||||
|
||||
# Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
|
||||
# sha256sum found here: https://packages.gitlab.com/gitlab
|
||||
gitlab_debian_version="$(lsb_release -sc)"
|
||||
|
||||
gitlab_x86_64_bookworm_source_sha256="61ed818dc013289379298d7e73c6aa19869cac7072599370ea9315fe81d3c87a"
|
||||
gitlab_x86_64_bullseye_source_sha256="9fa5ab656a95b5d9666af3747e8ea90bc51e935da2f31d9d03b516f833a74730"
|
||||
gitlab_x86_64_buster_source_sha256="bc8851cdf4c912f83af7de4f0413f965f26e0f98a98ec2ea04f5dc9b71be977b"
|
||||
gitlab_x86_64_bookworm_source_sha256="a8ad48f975a51edd47156a097554ad145cb6ca7458e7e2625a395db10c3a2e67"
|
||||
gitlab_x86_64_bullseye_source_sha256="c768c9f82ffc5a9a11074970627c5f832eb416e5290ba878c7a4989900f1702a"
|
||||
gitlab_x86_64_buster_source_sha256="89a5fb54f1e4ea27541e86e629916b5223db43c3582a52201d70f26fad649b52"
|
||||
|
||||
gitlab_arm64_bookworm_source_sha256="f13220dfa473185996fa265244ebdf6d7b6bc8b0e61aa4a15d0edc3300e04e20"
|
||||
gitlab_arm64_bullseye_source_sha256="dbb79862f79f7611d074ef194d6c96254a94e0b7f739732ea7c1e16c264c36b4"
|
||||
gitlab_arm64_buster_source_sha256="cdba0c8be878594356954f53fc26a084dcb409b3a775c88ec9811605f23f23fe"
|
||||
gitlab_arm64_bookworm_source_sha256="04a1b984b1b29ffe4ce1cbc7b4bb7b206de70552f4322d3bc9a2013ae2c641ec"
|
||||
gitlab_arm64_bullseye_source_sha256="05d418d7d736af480dea73955175bf1e2becdfdb1a7467e4e3ffa86b55b29f31"
|
||||
gitlab_arm64_buster_source_sha256="96d0aebf79d0f8efd630ef4a05d9e48f7a4436e600fd24ad312da8d8527f285b"
|
||||
|
||||
gitlab_arm_bookworm_source_sha256=""
|
||||
gitlab_arm_bullseye_source_sha256="053a89316fef0f5e91d91cd9b5872b24fbda9716e26ebbfdb0a2cf6d23d930ba"
|
||||
gitlab_arm_buster_source_sha256="b09ef8072f80458f7ac6aec7e7c2b5d1193e75df5eeef18c0e4728a11ba6fb17"
|
||||
gitlab_arm_bullseye_source_sha256="50ca0bdc687bfab76cd117dcc9dffa6ce6496c00e962c4e8f21354f74ed952f3"
|
||||
gitlab_arm_buster_source_sha256="2a4e6e6708e0310251e3af71d670861ab8b787a12c7916b25c79b54b373b4f87"
|
||||
|
||||
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
|
||||
|
||||
# Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
|
||||
# ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
|
||||
# gitlab_source_sha256=${!ref}
|
||||
|
||||
if [ "$architecture" = "x86-64" ]; then
|
||||
if [ "$gitlab_debian_version" = "bookworm" ]
|
||||
then
|
||||
|
|
8
tests.toml
Normal file
8
tests.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
test_format = 1.0
|
||||
|
||||
[default]
|
||||
# -------------------------------
|
||||
# Commits to test upgrade from
|
||||
# -------------------------------
|
||||
|
||||
test_upgrade_from.722fa8db9d8d840064ffc64338e1170da7cafc37.name = "Upgrade from 15.0.0"
|
|
@ -53,7 +53,7 @@ done
|
|||
|
||||
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
|
||||
sed -i -e "s/version = \"[^0-9.]*[0-9.]*[0-9.]~ynh[0-9.]\"/version = \"$version~ynh1\"/" $gitlab_directory/manifest.toml
|
||||
|
||||
# Don't, it's autogenerated now
|
||||
## Update readme
|
||||
|
@ -131,10 +131,10 @@ EOS"
|
|||
sed -i "s/# puma\['worker_processes'\] = .*/puma['worker_processes'] = __PUMA_WORKER_PROCESSES__/" $conf_file
|
||||
sed -i "s/# puma\['min_threads'\] = .*/puma['min_threads'] = __PUMA_MIN_THREADS__/" $conf_file
|
||||
sed -i "s/# puma\['max_threads'\] = .*/puma['max_threads'] = __PUMA_MAX_THREADS__/" $conf_file
|
||||
sed -i "s/# puma\['port'\] = .*/puma['port'] = __PUMA_PORT__/" $conf_file
|
||||
sed -i "s/# puma\['port'\] = .*/puma['port'] = __PORT_PUMA__/" $conf_file
|
||||
|
||||
# Change sidekiq settings
|
||||
sed -i "s/# sidekiq\['listen_port'\] = .*/sidekiq['listen_port'] = __SIDEKIQ_PORT__/" $conf_file
|
||||
sed -i "s/# sidekiq\['listen_port'\] = .*/sidekiq['listen_port'] = __PORT_SIDEKIQ__/" $conf_file
|
||||
|
||||
# Change nginx settings
|
||||
sed -i "s/# nginx\['client_max_body_size'\] = .*/nginx['client_max_body_size'] = '__CLIENT_MAX_BODY_SIZE__'/" $conf_file
|
||||
|
|
Loading…
Reference in a new issue