From d582ec8d7bb114961f58c36bf0bb0b8257a7cbca Mon Sep 17 00:00:00 2001 From: magikcypress Date: Tue, 11 Apr 2017 15:22:54 +0200 Subject: [PATCH] [fix] Install Yarn --- scripts/install | 46 ++++++++++++++++++++++++++++++++++++---------- scripts/remove | 9 +++++++++ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 012d558..d8c61b7 100644 --- a/scripts/install +++ b/scripts/install @@ -40,7 +40,7 @@ ynh_app_setting_set $app is_public $is_public sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password --disabled-login # Install debian package -ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl +ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-transport-https # Install redis package ynh_package_install redis-server redis-tools @@ -51,9 +51,13 @@ ynh_package_install postgresql postgresql-contrib # Install Ruby ynh_package_install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev -# Install debian package backports -sudo cp ../conf/backports.list /etc/apt/sources.list.d/ +# Install source.list debian package backports & yarn +sudo cp ../conf/backports.list /etc/apt/sources.list.d/ +sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +sudo cp ../conf/yarn.list /etc/apt/sources.list.d/ ynh_package_update + +# Install debian package backports sudo apt-get -t jessie-backports -y install ffmpeg # Creates the destination directory and stores its location. @@ -63,11 +67,23 @@ ynh_app_setting_set $app final_path $final_path pushd /opt curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs -npm install -g yarn + +# Install Yarn +ynh_package_install yarn +# sudo npm install -g yarn + +# Set UTF8 encoding by default +# Bug: Warning: PG::InsufficientPrivilege: ERROR: permission denied to copy database "template1" +# Exec db:setup +# sudo su -c "psql" postgres <<< \ +# "update pg_database set datistemplate='false' where datname='template1';"\ +# "drop database template1;"\ +# "create database template1 encoding='UTF8' template template0;"\ +# "update pg_database set datistemplate='true' where datname='template1';" # Create DB without password -sudo systemctl restart postgresql ynh_psql_create_db_without_password "$app" +sudo systemctl restart postgresql # Download all Ruby source sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv @@ -82,12 +98,13 @@ SETUP_SOURCE sudo chown -R $app: "${final_path}" # Install de rbenv +# Tips: rbenv init - bash (see: https://github.com/rbenv/rbenv/issues/925) sudo su - $app <> ~/.profile echo 'export PATH="/opt/mastodon/.rbenv/bin:/opt/mastodon/live/bin:$PATH"' >> ~/.bashrc -echo 'eval "\$(rbenv init -)"' >> ~/.bashrc +echo 'eval "\$(rbenv init - bash)"' >> ~/.bashrc COMMANDS # Install ruby-build @@ -104,7 +121,7 @@ sudo su - $app <