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

Merge pull request #53 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2019-05-12 22:08:50 +02:00 committed by GitHub
commit 6e10195ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 46 deletions

View file

@ -2,7 +2,7 @@
"name": "Gitlab", "name": "Gitlab",
"id": "gitlab", "id": "gitlab",
"packaging_format": 1, "packaging_format": 1,
"version": "11.10.4~ynh2", "version": "11.10.4~ynh3",
"description": { "description": {
"en": "GitLab is a Git-repository manager.", "en": "GitLab is a Git-repository manager.",
"fr": "GitLab est un gestionnaire de dépôts Git." "fr": "GitLab est un gestionnaire de dépôts Git."

View file

@ -76,8 +76,11 @@ ynh_add_swap () {
# If there's enough space for a swap, and no existing swap here # If there's enough space for a swap, and no existing swap here
if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ] if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
then then
# Preallocate space for the swap file # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case
fallocate -l ${swap_size}K /swap_$app if ! fallocate -l ${swap_size}K /swap_$app
then
dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size}
fi
chmod 0600 /swap_$app chmod 0600 /swap_$app
# Create the swap # Create the swap
mkswap /swap_$app mkswap /swap_$app

View file

@ -120,7 +120,7 @@ ynh_store_file_checksum --file="$config_path/gitlab.rb"
gitlab-ctl reconfigure gitlab-ctl reconfigure
if [ $change_path -eq 1 ]; then if [ $change_path -eq 1 ]; then
gitlab-ctl restart ynh_systemd_action --action=restart --service_name="gitlab-runsvdir"
gitlab-ctl restart unicorn gitlab-ctl restart unicorn
fi fi

View file

@ -166,7 +166,6 @@ ynh_store_file_checksum --file="$config_path/gitlab.rb"
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=200 ynh_script_progression --message="Setting up source files..." --weight=200
update_src_version() {
source ./upgrade.d/upgrade.last.sh source ./upgrade.d/upgrade.last.sh
cp ../conf/$architecture.src.default ../conf/$architecture.src cp ../conf/$architecture.src.default ../conf/$architecture.src
ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src" ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src"
@ -177,16 +176,14 @@ update_src_version() {
elif [ $architecture = "arm" ]; then elif [ $architecture = "arm" ]; then
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src" ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src"
fi fi
}
update_src_version
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ;
then # This command will fail in lxc env
ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
ynh_exec_warn_less dpkg --configure gitlab-ce ynh_exec_warn_less dpkg --configure gitlab-ce
fi fi

View file

@ -39,7 +39,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Stopping gitlab" --weight=8 ynh_script_progression --message="Stopping gitlab" --weight=8
gitlab-ctl stop ynh_systemd_action --action=stop --service_name="gitlab-runsvdir"
#================================================= #=================================================
# REMOVE GITLAB # REMOVE GITLAB

View file

@ -97,7 +97,6 @@ ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb"
#================================================= #=================================================
ynh_script_progression --message="Reinstalling gitlab..." --weight=200 ynh_script_progression --message="Reinstalling gitlab..." --weight=200
update_src_version() {
source ../settings/scripts/upgrade.d/upgrade.last.sh source ../settings/scripts/upgrade.d/upgrade.last.sh
mkdir -p ../conf/ mkdir -p ../conf/
cp ../settings/conf/$architecture.src.default ../conf/$architecture.src cp ../settings/conf/$architecture.src.default ../conf/$architecture.src
@ -109,16 +108,14 @@ update_src_version() {
elif [ $architecture = "arm" ]; then elif [ $architecture = "arm" ]; then
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src" ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src"
fi fi
}
update_src_version
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ;
then # This command will fail in lxc env
ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
ynh_exec_warn_less dpkg --configure gitlab-ce ynh_exec_warn_less dpkg --configure gitlab-ce
fi fi

View file

@ -231,7 +231,10 @@ chown admin: "$config_path/gitlab-persistent.rb"
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
update_src_version() { if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Setting up source files..." --weight=200
source ./upgrade.d/upgrade.last.sh source ./upgrade.d/upgrade.last.sh
cp ../conf/$architecture.src.default ../conf/$architecture.src cp ../conf/$architecture.src.default ../conf/$architecture.src
ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src" ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src"
@ -242,20 +245,14 @@ update_src_version() {
elif [ $architecture = "arm" ]; then elif [ $architecture = "arm" ]; then
ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src" ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src"
fi fi
}
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Setting up source files..." --weight=200
update_src_version
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ;
then # This command will fail in lxc env
ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
ynh_exec_warn_less dpkg --configure gitlab-ce ynh_exec_warn_less dpkg --configure gitlab-ce
fi fi