diff --git a/manifests/init.pp b/manifests/init.pp index b7800ea..69b5bdc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -196,7 +196,7 @@ class mastodon ( } exec { 'install_mastodon': command => '/usr/local/bin/install_mastodon.sh', - creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/bundler", + creates => "${mastodon_home}/./.mastodon_install", path => "${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", timeout => 0, require => File['/usr/local/bin/install_mastodon.sh'], diff --git a/templates/install_mastodon.sh.erb b/templates/install_mastodon.sh.erb index 49c705b..eeedb1d 100644 --- a/templates/install_mastodon.sh.erb +++ b/templates/install_mastodon.sh.erb @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then +if [ ! -e '<%= @mastodon_home %>/.mastodon_install' ]; then cd '<%= @mastodon_home %>' echo "Installing ruby..." source '<%= @mastodon_home %>/.bashrc' @@ -15,4 +15,5 @@ if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/bundle' install -j$(getconf _NPROCESSORS_ONLN) echo "Running yarn install..." sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile + echo $(date +s) > '<%= @mastodon_home %>/.mastodon_install' fi