mirror of
https://github.com/YunoHost-Apps/codimd_ynh.git
synced 2024-09-03 18:16:32 +02:00
Merge pull request #2 from ABLD/master
try something to use helper : download and untar sources
This commit is contained in:
commit
07ada6cad4
2 changed files with 26 additions and 12 deletions
6
conf/app.src
Normal file
6
conf/app.src
Normal file
|
@ -0,0 +1,6 @@
|
|||
SOURCE_URL=https://github.com/hackmdio/codimd/archive/1.2.1.tar.gz
|
||||
SOURCE_SUM=850fe2e4aed30eb3f83d77f1d9d8421ad0ab52f24ec7faaa07d4269cc440d4e4
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=
|
|
@ -107,12 +107,30 @@ ynh_psql_create_user $db_user $db_pass
|
|||
ynh_psql_execute_as_root \
|
||||
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $db_user;"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
ynh_app_setting_set $app final_path $final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
#cp -a ../conf/onlyoffice-documentserver.conf /etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf
|
||||
ynh_replace_string "__DB_USER__" "$db_user" "../conf/config.json.exemple"
|
||||
ynh_replace_string "__DB_NAME__" "$db_name" "../conf/config.json.exemple"
|
||||
ynh_replace_string "__DB_PASS__" "$db_pass" "../conf/config.json.exemple"
|
||||
cp ../conf/config.json.exemple $final_path/config.json
|
||||
|
||||
#==============================================
|
||||
# INSTALL CODIMD
|
||||
#==============================================
|
||||
|
||||
wget --no-verbose 'https://github.com/hackmdio/codimd/archive/1.2.1.tar.gz'
|
||||
tar -xvf codimd-1.2.1.tar.gz
|
||||
pushd $final_path
|
||||
bin/setup
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -128,16 +146,6 @@ ynh_add_nginx_config
|
|||
# Create a system user
|
||||
ynh_system_user_create $app
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
#cp -a ../conf/onlyoffice-documentserver.conf /etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf
|
||||
ynh_replace_string "__DB_USER__" "$db_user" "../conf/config.json.exemple"
|
||||
ynh_replace_string "__DB_NAME__" "$db_name" "../conf/config.json.exemple"
|
||||
ynh_replace_string "__DB_PASS__" "$db_pass" "../conf/config.json.exemple"
|
||||
cp ../conf/config.json.exemple $final_path/config.json
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue