use installed file

This commit is contained in:
Antonio J. Delgado 2023-11-28 13:47:03 +02:00
parent 4ea6af716e
commit a64dd21793
2 changed files with 3 additions and 2 deletions

View file

@ -196,7 +196,7 @@ class mastodon (
} }
exec { 'install_mastodon': exec { 'install_mastodon':
command => '/usr/local/bin/install_mastodon.sh', 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", path => "${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
timeout => 0, timeout => 0,
require => File['/usr/local/bin/install_mastodon.sh'], require => File['/usr/local/bin/install_mastodon.sh'],

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then if [ ! -e '<%= @mastodon_home %>/.mastodon_install' ]; then
cd '<%= @mastodon_home %>' cd '<%= @mastodon_home %>'
echo "Installing ruby..." echo "Installing ruby..."
source '<%= @mastodon_home %>/.bashrc' 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) sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/bundle' install -j$(getconf _NPROCESSORS_ONLN)
echo "Running yarn install..." echo "Running yarn install..."
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile
echo $(date +s) > '<%= @mastodon_home %>/.mastodon_install'
fi fi