mirror of
https://github.com/YunoHost-Apps/plume_ynh.git
synced 2024-09-03 20:15:54 +02:00
cargo install
This commit is contained in:
parent
96ca044148
commit
16ef5be3d4
2 changed files with 6 additions and 6 deletions
|
@ -1,13 +1,14 @@
|
|||
[Unit]
|
||||
Description=Small description of the service
|
||||
Description=__APP__ service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=__FINALPATH__/script >> /var/log/__APP__/__APP__.log 2>&1
|
||||
ExecStart=__FINALPATH__/ cargo run >> /var/log/__APP__/__APP__.log 2>&1
|
||||
TimeoutSec=30
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -108,8 +108,6 @@ ynh_psql_test_if_first_run
|
|||
ynh_psql_create_user "$app" "$db_pwd"
|
||||
ynh_psql_execute_as_root \
|
||||
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
|
||||
ynh_psql_execute_as_root "\connect $db_name
|
||||
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -133,6 +131,7 @@ ynh_system_user_create $app $final_path
|
|||
( cd $final_path && curl -sf -L https://static.rust-lang.org/rustup.sh | sh )
|
||||
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
||||
( cd $final_path && cargo build )
|
||||
( cd $final_path && cargo install diesel_cli --no-default-features --features postgres --version '=1.2.0' )
|
||||
( cd $final_path && diesel migration run --database-url postgres://$db_name:$db_pwd@localhost:5432/plume )
|
||||
|
||||
#=================================================
|
||||
|
@ -171,7 +170,7 @@ ynh_add_systemd_config
|
|||
|
||||
# Optional, only do it if the database URL is not
|
||||
# postgres://plume:plume@localhost/plume
|
||||
export DB_URL=postgres://$db_name:$db_pwd@localhost:5432/plume
|
||||
( cd $final_path && export DB_URL=postgres://$db_name:$db_pwd@localhost:5432/plume )
|
||||
|
||||
# Create the media directory, where uploads will be stored
|
||||
(cd $final_path && mkdir media )
|
||||
|
|
Loading…
Add table
Reference in a new issue