install from script
This commit is contained in:
parent
4bde8dfbea
commit
bc0598b7c6
2 changed files with 22 additions and 44 deletions
|
@ -169,22 +169,6 @@ class mastodon (
|
||||||
group => $mastodon_group,
|
group => $mastodon_group,
|
||||||
require => Vcsrepo['rbenv'],
|
require => Vcsrepo['rbenv'],
|
||||||
}
|
}
|
||||||
file { '/usr/local/bin/install_ruby.sh':
|
|
||||||
ensure => $ensure,
|
|
||||||
content => template('mastodon/install_ruby.sh.erb'),
|
|
||||||
mode => '0750',
|
|
||||||
owner => $mastodon_user,
|
|
||||||
group => 'root',
|
|
||||||
require => Vcsrepo['ruby_build'],
|
|
||||||
}
|
|
||||||
exec { 'install_ruby':
|
|
||||||
command => '/usr/local/bin/install_ruby.sh',
|
|
||||||
# user => $mastodon_user,
|
|
||||||
# cwd => "${mastodon_home}/.rbenv/",
|
|
||||||
creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/bundler",
|
|
||||||
timeout => 0,
|
|
||||||
require => File['/usr/local/bin/install_ruby.sh'],
|
|
||||||
}
|
|
||||||
postgresql::server::db { 'mastodon':
|
postgresql::server::db { 'mastodon':
|
||||||
user => 'mastodon',
|
user => 'mastodon',
|
||||||
password => postgresql::postgresql_password('mastodon', $db_password),
|
password => postgresql::postgresql_password('mastodon', $db_password),
|
||||||
|
@ -198,34 +182,24 @@ class mastodon (
|
||||||
group => $mastodon_group,
|
group => $mastodon_group,
|
||||||
require => User[$mastodon_user],
|
require => User[$mastodon_user],
|
||||||
}
|
}
|
||||||
exec { 'config_deployment':
|
file { '/usr/local/bin/install_mastodon.sh':
|
||||||
command => "${mastodon_home}/live/bin/bundle config deployment 'true'",
|
ensure => $ensure,
|
||||||
user => $mastodon_user,
|
content => template('mastodon/install_mastodon.sh.erb'),
|
||||||
cwd => "${mastodon_home}/live",
|
mode => '0750',
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
owner => $mastodon_user,
|
||||||
require => Exec['install_ruby'],
|
group => 'root',
|
||||||
|
require => [
|
||||||
|
Vcsrepo['mastodon_code'],
|
||||||
|
Postgresql::Server::Db['mastodon'],
|
||||||
|
Vcsrepo['ruby_build'],
|
||||||
|
],
|
||||||
}
|
}
|
||||||
exec { 'config_without_devel_test':
|
exec { 'install_mastodon':
|
||||||
command => "${mastodon_home}/live/bin/bundle config without 'development test'",
|
command => '/usr/local/bin/install_mastodon.sh',
|
||||||
user => $mastodon_user,
|
# user => $mastodon_user,
|
||||||
cwd => "${mastodon_home}/live",
|
# cwd => "${mastodon_home}/.rbenv/",
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/bundler",
|
||||||
require => Exec['config_deployment'],
|
timeout => 0,
|
||||||
}
|
require => File['/usr/local/bin/install_mastodon.sh'],
|
||||||
exec { 'bundle_install':
|
|
||||||
command => "${mastodon_home}/live/bin/bundle install -j$(getconf _NPROCESSORS_ONLN)",
|
|
||||||
path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
|
||||||
user => $mastodon_user,
|
|
||||||
cwd => "${mastodon_home}/live",
|
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
|
||||||
require => Exec['config_without_devel_test'],
|
|
||||||
}
|
|
||||||
exec { 'yarn_install':
|
|
||||||
command => "${mastodon_home}/live/bin/yarn install --pure-lockfile",
|
|
||||||
path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
|
||||||
user => $mastodon_user,
|
|
||||||
cwd => "${mastodon_home}/live",
|
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
|
||||||
require => Exec['bundle_install'],
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,4 +6,8 @@ if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby'
|
||||||
sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>'
|
sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>'
|
||||||
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/bin/rbenv' global '<%= @ruby_version %>'
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/bin/rbenv' global '<%= @ruby_version %>'
|
||||||
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/gem' install bundler --no-document
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/gem' install bundler --no-document
|
||||||
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/bundle' config deployment 'true'
|
||||||
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/bundle' config without 'development test'
|
||||||
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/bundle' install -j$(getconf _NPROCESSORS_ONLN)
|
||||||
|
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/live/bin/yarn' install --pure-lockfile
|
||||||
fi
|
fi
|
Loading…
Reference in a new issue