mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
Add some info
This commit is contained in:
parent
ecfdd4a5e6
commit
079f64b387
6 changed files with 27 additions and 4 deletions
|
@ -34,6 +34,8 @@ create_dir() {
|
||||||
# CONFIGURATION FILE FOR GITLAB
|
# CONFIGURATION FILE FOR GITLAB
|
||||||
#=================================================
|
#=================================================
|
||||||
config_gitlab() {
|
config_gitlab() {
|
||||||
|
ynh_print_info "Configuring Gitlab..."
|
||||||
|
|
||||||
create_dir
|
create_dir
|
||||||
|
|
||||||
gitlab_conf_path="$config_path/gitlab.rb"
|
gitlab_conf_path="$config_path/gitlab.rb"
|
||||||
|
@ -54,6 +56,8 @@ config_gitlab() {
|
||||||
# REMOVE THE CONFIGURATION FILE FOR GITLAB
|
# REMOVE THE CONFIGURATION FILE FOR GITLAB
|
||||||
#=================================================
|
#=================================================
|
||||||
remove_config_gitlab() {
|
remove_config_gitlab() {
|
||||||
|
ynh_print_info "Removing the configuration file..."
|
||||||
|
|
||||||
ynh_secure_remove "$config_path/gitlab.rb"
|
ynh_secure_remove "$config_path/gitlab.rb"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,17 +105,20 @@ setup_source() {
|
||||||
fi
|
fi
|
||||||
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
|
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
|
||||||
|
|
||||||
|
ynh_print_info "Downloading Gitlab files..."
|
||||||
|
|
||||||
if test -e "$local_src"
|
if test -e "$local_src"
|
||||||
then # Use the local source file if it is present
|
then # Use the local source file if it is present
|
||||||
cp $local_src $src_filename
|
cp $local_src $src_filename
|
||||||
else # If not, download the source
|
else # If not, download the source
|
||||||
local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err $out
|
ynh_print_info $(wget -q --show-progress -O $src_filename $src_url)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check the control sum
|
# Check the control sum
|
||||||
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|
||||||
|| ynh_die "Corrupt source"
|
|| ynh_die "Corrupt source"
|
||||||
|
|
||||||
|
ynh_print_info "Installing Gitlab..."
|
||||||
#Fix for the CI
|
#Fix for the CI
|
||||||
if sudo grep -qa container=lxc /proc/1/environ;
|
if sudo grep -qa container=lxc /proc/1/environ;
|
||||||
then
|
then
|
||||||
|
@ -129,7 +136,7 @@ setup_source() {
|
||||||
# This function is inspired by the ynh_systemd_action function
|
# This function is inspired by the ynh_systemd_action function
|
||||||
waiting_to_start() {
|
waiting_to_start() {
|
||||||
|
|
||||||
echo "Start Waiting"
|
ynh_print_info "Waiting for a response from Gitlab..."
|
||||||
|
|
||||||
log_path="/var/log/gitlab/unicorn/current"
|
log_path="/var/log/gitlab/unicorn/current"
|
||||||
|
|
||||||
|
@ -164,7 +171,5 @@ waiting_to_start() {
|
||||||
echo -n "." >&2
|
echo -n "." >&2
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Stop Waiting"
|
|
||||||
|
|
||||||
clean_check_starting
|
clean_check_starting
|
||||||
}
|
}
|
|
@ -44,6 +44,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP GITLAB DATABASE
|
# BACKUP GITLAB DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Backuping of Gitlab..."
|
||||||
|
|
||||||
# Use gitlab-rake to backup
|
# Use gitlab-rake to backup
|
||||||
gitlab-rake gitlab:backup:create
|
gitlab-rake gitlab:backup:create
|
||||||
|
|
||||||
|
@ -53,5 +55,7 @@ ynh_backup "/var/opt/$app/backups/"
|
||||||
# BACKUP CONF FILES
|
# BACKUP CONF FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Backuping configuration files of Gitlab..."
|
||||||
|
|
||||||
ynh_backup "$config_path/gitlab-secrets.json"
|
ynh_backup "$config_path/gitlab-secrets.json"
|
||||||
ynh_backup "$config_path/gitlab.rb"
|
ynh_backup "$config_path/gitlab.rb"
|
||||||
|
|
|
@ -75,6 +75,8 @@ nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
if [ $change_path -eq 1 ]
|
if [ $change_path -eq 1 ]
|
||||||
then
|
then
|
||||||
|
ynh_print_info "Changing path..."
|
||||||
|
|
||||||
sudo gitlab-ctl stop unicorn
|
sudo gitlab-ctl stop unicorn
|
||||||
sudo gitlab-ctl stop sidekiq
|
sudo gitlab-ctl stop sidekiq
|
||||||
|
|
||||||
|
@ -90,6 +92,8 @@ fi
|
||||||
# Change the domain for nginx
|
# Change the domain for nginx
|
||||||
if [ $change_domain -eq 1 ]
|
if [ $change_domain -eq 1 ]
|
||||||
then
|
then
|
||||||
|
ynh_print_info "Changing domain..."
|
||||||
|
|
||||||
# Delete file checksum for the old conf file location
|
# Delete file checksum for the old conf file location
|
||||||
ynh_delete_file_checksum "$nginx_conf_path"
|
ynh_delete_file_checksum "$nginx_conf_path"
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||||
|
|
|
@ -58,6 +58,8 @@ ynh_app_setting_set $app use_web_account $use_web_account
|
||||||
# FIND AND OPEN PORTS
|
# FIND AND OPEN PORTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Getting ports..."
|
||||||
|
|
||||||
# Find free ports
|
# Find free ports
|
||||||
port=$(ynh_find_port 8080)
|
port=$(ynh_find_port 8080)
|
||||||
portUnicorn=$(ynh_find_port $(($port + 1)))
|
portUnicorn=$(ynh_find_port $(($port + 1)))
|
||||||
|
@ -99,6 +101,8 @@ setup_source $architecture
|
||||||
# GETTING ADMIN INFO AND ADD AS A GITLAB USER AND CONFIGURE SIGN IN SYSTEM
|
# GETTING ADMIN INFO AND ADD AS A GITLAB USER AND CONFIGURE SIGN IN SYSTEM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Creating an administrator user..."
|
||||||
|
|
||||||
mailadmin=$(ynh_user_get_info $admin mail)
|
mailadmin=$(ynh_user_get_info $admin mail)
|
||||||
rdmPass=$(ynh_string_random 30)
|
rdmPass=$(ynh_string_random 30)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
||||||
# REMOVE GITLAB
|
# REMOVE GITLAB
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Removing Gitlab..."
|
||||||
|
|
||||||
# Remove gitlab
|
# Remove gitlab
|
||||||
dpkg --remove gitlab-ce
|
dpkg --remove gitlab-ce
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,8 @@ ynh_install_app_dependencies openssh-server
|
||||||
# RESTORE CONF FILES
|
# RESTORE CONF FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Restoring configuration files of Gitlab..."
|
||||||
|
|
||||||
ynh_restore_file "$config_path/gitlab-secrets.json"
|
ynh_restore_file "$config_path/gitlab-secrets.json"
|
||||||
ynh_restore_file "$config_path/gitlab.rb"
|
ynh_restore_file "$config_path/gitlab.rb"
|
||||||
|
|
||||||
|
@ -87,6 +89,8 @@ ynh_restore_file "/var/opt/$app/backups/"
|
||||||
# RESTORE GITLAB DATABASE
|
# RESTORE GITLAB DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Restoring Gitlab..."
|
||||||
|
|
||||||
fullfile=$(ls /var/opt/gitlab/backups/*_gitlab* --file -c1 | head -1)
|
fullfile=$(ls /var/opt/gitlab/backups/*_gitlab* --file -c1 | head -1)
|
||||||
basename="/var/opt/gitlab/backups/"
|
basename="/var/opt/gitlab/backups/"
|
||||||
filename=$(basename -- "$fullfile")
|
filename=$(basename -- "$fullfile")
|
||||||
|
|
Loading…
Add table
Reference in a new issue