22 lines
1.1 KiB
Text
22 lines
1.1 KiB
Text
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
if [ ! -e '<%= @mastodon_home %>/.mastodon_install' ]; then
|
|
cd '<%= @mastodon_home %>'
|
|
echo "Installing ruby..."
|
|
export PATH="<%= @mastodon_home %>/.rbenv/bin:$PATH"
|
|
eval "$(<%= @mastodon_home %>/.rbenv/bin/rbenv init -)"
|
|
if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then
|
|
RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>'
|
|
fi
|
|
'<%= @mastodon_home %>/.rbenv/bin/rbenv' global '<%= @ruby_version %>'
|
|
'<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/gem' install bundler --no-document
|
|
echo "Configuring bundle..."
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' config deployment 'true'
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' config without 'development test'
|
|
echo "Running bundle install..."
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' install -j$(getconf _NPROCESSORS_ONLN)
|
|
echo "Running yarn install..."
|
|
'<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile
|
|
echo $(date +s) > '<%= @mastodon_home %>/.mastodon_install'
|
|
fi
|