Files
states/files/Install-Mastodon-Phase4.sh

41 lines
1.3 KiB
Bash

#!/bin/bash
# Let's install ruby 2.5.0
echo Phase 4: Installation de Ruby
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build || exit 301
rbenv install 2.5.0 || exit 302
rbenv global 2.5.0 || exit 303
ruby -v
cd ~
git clone https://github.com/tootsuite/mastodon.git live || exit 304
cd live || exit 305
git checkout $(git tag | tail -n 1) || exit 306
echo "gem: --no-document" > ~/.gemrc || exit 307
gem install bundler --no-ri || exit 308
echo Launch the installation
bundle install --deployment --without development test || exit 309
yarn install || exit 310
cp .env.production.sample .env.production || exit 311
echo "# Service dependencies" >>.env.production
echo REDIS_HOST=localhost >>.env.production
echo REDIS_PORT=6379 >>.env.production
echo DB_HOST=/var/run/postgresql >>.env.production
echo DB_USER=mastodon >>.env.production
echo DB_NAME=mastodon_production >>.env.production
echo DB_PASS= >>.env.production
echo DB_PORT=5432 >>.env.production
echo "# E-mail configuration" >>.env.production
echo SMTP_SERVER=mail.yourdomain.com >>.env.production
echo SMTP_PORT=587 >>.env.production
echo SMTP_LOGIN=noreply@yourdomain.com >>.env.production
echo SMTP_PASSWORD=YourPassword >>.env.production
echo SMTP_FROM_ADDRESS=noreply@yourdomain.com >>.env.production
exit 0