2023-11-28 08:20:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-11-28 12:47:03 +01:00
|
|
|
if [ ! -e '<%= @mastodon_home %>/.mastodon_install' ]; then
|
2023-11-28 08:25:07 +01:00
|
|
|
cd '<%= @mastodon_home %>'
|
2023-11-28 10:34:55 +01:00
|
|
|
echo "Installing ruby..."
|
2023-11-28 13:51:25 +01:00
|
|
|
export PATH="<%= @mastodon_home %>/.rbenv/bin:$PATH"
|
|
|
|
eval "$(<%= @mastodon_home %>/.rbenv/bin/rbenv init -)"
|
2023-11-28 14:16:03 +01:00
|
|
|
if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then
|
2023-11-28 16:35:34 +01:00
|
|
|
RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>'
|
2023-11-28 14:01:32 +01:00
|
|
|
fi
|
2023-11-28 16:35:34 +01:00
|
|
|
'<%= @mastodon_home %>/.rbenv/bin/rbenv' global '<%= @ruby_version %>'
|
|
|
|
'<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/gem' install bundler --no-document
|
2023-11-28 10:34:55 +01:00
|
|
|
echo "Configuring bundle..."
|
2023-11-28 16:48:43 +01:00
|
|
|
cd '<%= @mastodon_home %>/live'
|
2023-11-28 16:35:34 +01:00
|
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' config deployment 'true'
|
|
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' config without 'development test'
|
2023-11-28 10:34:55 +01:00
|
|
|
echo "Running bundle install..."
|
2023-11-28 16:35:34 +01:00
|
|
|
'<%= @mastodon_home %>/.rbenv/shims/bundle' install -j$(getconf _NPROCESSORS_ONLN)
|
2023-11-28 10:34:55 +01:00
|
|
|
echo "Running yarn install..."
|
2023-11-28 16:35:34 +01:00
|
|
|
'<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile
|
2023-11-28 12:47:03 +01:00
|
|
|
echo $(date +s) > '<%= @mastodon_home %>/.mastodon_install'
|
2023-11-28 08:20:18 +01:00
|
|
|
fi
|