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

Merge pull request #10 from YunoHost-Apps/testing

Testing
This commit is contained in:
Alexandre Aubin 2018-02-24 16:38:01 +01:00 committed by GitHub
commit d558705cfb
9 changed files with 45 additions and 19 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_SUM=4245f6674e407ad40bc899788058887213d5daf8d7620e0ae0c07af22b7c82aa
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz
SOURCE_SUM=5a582446859d2563bf7a5f6e7d7bc1e6d8c63a6021f0f2e024cab0ffea78c5aa
SOURCE_SUM_PRG=sha256sum
ARCH_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=wekan-0.45.tar.gz
SOURCE_FILENAME=wekan-0.62.tar.gz

View file

@ -11,7 +11,7 @@ ExecStartPre=__NODEJS__
Environment="PATH=__ENV_PATH__"
Environment=NODE_ENV=production
Environment=MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__
Environment=ROOT_URL=http://127.0.0.1:__PORT____URI__ PORT=__PORT__
Environment=ROOT_URL=https://__DOMAIN____URI__ PORT=__PORT__
WorkingDirectory=__FINALPATH__
ExecStart=/opt/node_n/bin/node __FINALPATH__/main.js
Restart=on-failure

View file

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

View file

@ -209,3 +209,5 @@ EOF
chmod +x "/etc/cron.daily/node_update"
}
ynh_version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }

View file

@ -48,11 +48,11 @@ ynh_app_setting_set $app port $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_install_nodejs 4.8.4
ynh_install_nodejs 4.8.7
# Install mongodb
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list
wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add -
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
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
# Start mogodb
systemctl start mongod
systemctl enable mongod
systemctl restart mongod
#=================================================
# SETUP SYSTEMD
@ -99,8 +99,9 @@ systemctl enable mongod
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "../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 "__DOMAIN__" "$domain" "../conf/systemd.service"
ynh_add_systemd_config
#=================================================
@ -117,6 +118,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
# ADD SERVICE IN ADMIN PANEL
#=================================================
yunohost service add mongod --log "/var/log/mongodb.log"
yunohost service add $app
#=================================================
# SETUP SSOWAT
@ -132,5 +134,5 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
systemctl restart $app
systemctl reload nginx
systemctl start $app

View file

@ -54,7 +54,8 @@ ynh_remove_nodejs
# REMOVE MONGODB
#=================================================
# TODO / FIXME : remove the keys added ?
#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
#apt-key del EA312927
#apt-key del 0C49F3730359A14518585931BC711F9BA15703C6
#rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list

View file

@ -52,10 +52,10 @@ ynh_system_user_create $app "$final_path"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_install_nodejs 4.8.4
ynh_install_nodejs 4.8.7
# Install mongodb
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add -
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list
ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools"
@ -64,8 +64,8 @@ ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell m
# RESTORE DB
#=================================================
# Start mogodb
systemctl start mongod
systemctl enable mongod
systemctl start mongod
mongorestore --db $app ./dump
#=================================================
@ -93,6 +93,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
# ADD SERVICE IN ADMIN PANEL
#=================================================
yunohost service add mongod --log "/var/log/mongodb.log"
yunohost service add $app
#=================================================
# SETUP SSOWAT
@ -108,4 +109,5 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
systemctl restart $app
systemctl reload nginx

View file

@ -19,7 +19,7 @@ domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
is_public=$(ynh_app_setting_get $app is_public)
final_path=$(ynh_app_setting_get $app final_path)
port=$(ynh_app_setting_get $app final_path)
port=$(ynh_app_setting_get $app port)
#=================================================
# Check version
@ -40,9 +40,24 @@ ynh_abort_if_errors # Exit if an error occurs during the execution of the script
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
#if [ "${version}" = "20160501-7" ]; then
#fi
if ynh_version_gt "0.45-2" "${version}" ; then
ynh_replace_string "Environment=ROOT_URL=http://127.0.0.1:$port$path_url" "Environment=ROOT_URL=https://$domain$path_url/" "/etc/systemd/system/$app.service"
systemctl daemon-reload
fi
if ynh_version_gt "0.45-3" "${version}" ; then
yunohost service add $app
fi
if ynh_version_gt "0.54-2" "${version}" ; then
systemctl enable mongod
systemctl restart mongod
fi
if ynh_version_gt "0.54-3" "${version}" ; then
apt-key del EA312927
wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add -
fi
if ynh_version_gt "0.63-1" "${version}" ; then
ynh_install_nodejs 4.8.7
fi
#=================================================
# STANDARD UPGRADE STEPS
@ -67,4 +82,5 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
#=================================================
# RELOAD NGINX
#=================================================
systemctl restart $app
systemctl reload nginx