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

[fix] Mongodb fails starting on second install

This commit is contained in:
ljf 2017-11-09 11:40:43 +01:00
parent 45c6ec233a
commit 790578ceda
6 changed files with 17 additions and 10 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.swp
*.swo

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.45/wekan-0.45.tar.gz SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.54/wekan-0.54.tar.gz
SOURCE_SUM=4245f6674e407ad40bc899788058887213d5daf8d7620e0ae0c07af22b7c82aa SOURCE_SUM=fc3be49f1f317182a838f4b0deb058c35226e9d4609af9ea2050b4b866b2d4b1
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
ARCH_FORMAT=tar.gz ARCH_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=wekan-0.45.tar.gz SOURCE_FILENAME=wekan-0.54.tar.gz

View file

@ -2,7 +2,7 @@
"name": "Wekan", "name": "Wekan",
"id": "wekan", "id": "wekan",
"packaging_format": 1, "packaging_format": 1,
"version": "0.45-2", "version": "0.54-2",
"description": { "description": {
"en": "Trello-like kanban", "en": "Trello-like kanban",
"fr": "Un kanban similaire à Trello" "fr": "Un kanban similaire à Trello"

View file

@ -51,8 +51,8 @@ ynh_app_setting_set $app port $port
ynh_install_nodejs 4.8.4 ynh_install_nodejs 4.8.4
# Install mongodb # Install mongodb
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/testing main" > /etc/apt/sources.list.d/mongodb-org.list
ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools"
@ -89,8 +89,8 @@ npm install
popd popd
# Start mogodb # Start mogodb
systemctl start mongod
systemctl enable mongod systemctl enable mongod
systemctl restart mongod
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -99,7 +99,7 @@ systemctl enable mongod
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service" ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service"
ynh_replace_string "__URI__" "$path_url" "../conf/systemd.service" ynh_replace_string "__URI__" "$path_url/" "../conf/systemd.service"
ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" ynh_replace_string "__PORT__" "$port" "../conf/systemd.service"
ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service" ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
@ -135,4 +135,4 @@ fi
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
systemctl reload nginx systemctl reload nginx
systemctl start $app systemctl restart $app

View file

@ -64,8 +64,8 @@ ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell m
# RESTORE DB # RESTORE DB
#================================================= #=================================================
# Start mogodb # Start mogodb
systemctl start mongod
systemctl enable mongod systemctl enable mongod
systemctl start mongod
mongorestore --db $app ./dump mongorestore --db $app ./dump
#================================================= #=================================================

View file

@ -47,6 +47,10 @@ fi
if ynh_version_gt "0.45-3" "${version}" ; then if ynh_version_gt "0.45-3" "${version}" ; then
yunohost service add wekan yunohost service add wekan
fi fi
if ynh_version_gt "0.54-2" "${version}" ; then
systemctl enable mongod
systemctl restart mongod
fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS