use commands
This commit is contained in:
parent
bba40ab64f
commit
d931973648
1 changed files with 87 additions and 92 deletions
|
@ -114,70 +114,65 @@ class mastodon (
|
||||||
system => true,
|
system => true,
|
||||||
require => Group['mastodon'],
|
require => Group['mastodon'],
|
||||||
}
|
}
|
||||||
# vcsrepo { 'rbenv':
|
vcsrepo { 'rbenv':
|
||||||
# path => "${mastodon_home}/.rbenv",
|
path => "${mastodon_home}/.rbenv",
|
||||||
# source => 'https://github.com/rbenv/rbenv.git',
|
source => 'https://github.com/rbenv/rbenv.git',
|
||||||
# provider => 'git',
|
provider => 'git',
|
||||||
# owner => 'mastodon',
|
owner => 'mastodon',
|
||||||
# group => 'mastodon',
|
group => 'mastodon',
|
||||||
# require => User['mastodon'],
|
require => User['mastodon'],
|
||||||
# }
|
|
||||||
# exec { 'configure_rbenv':
|
|
||||||
# command => "${mastodon_home}/.rbenv/src/configure",
|
|
||||||
# user => 'mastodon',
|
|
||||||
# cwd => "${mastodon_home}/.rbenv/",
|
|
||||||
# creates => "${mastodon_home}/.rbenv/src/Makefile",
|
|
||||||
# require => Vcsrepo['rbenv'],
|
|
||||||
# }
|
|
||||||
# exec { 'make_rbenv':
|
|
||||||
# command => '/usr/bin/make -C src',
|
|
||||||
# user => 'mastodon',
|
|
||||||
# cwd => "${mastodon_home}/.rbenv/",
|
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
|
||||||
# require => Exec['configure_rbenv'],
|
|
||||||
# }
|
|
||||||
# file_line { 'mastodon_path':
|
|
||||||
# path => "${mastodon_home}/.bashrc/",
|
|
||||||
# line => 'export PATH="$HOME/.rbenv/bin:$PATH"',
|
|
||||||
# match => '^export PATH="$HOME/.rbenv',
|
|
||||||
# require => Vcsrepo['rbenv'],
|
|
||||||
# }
|
|
||||||
# file_line { 'mastodon_rbenv_init':
|
|
||||||
# path => "${mastodon_home}/.bashrc/",
|
|
||||||
# line => 'eval "$(rbenv init -)"',
|
|
||||||
# match => '^eval "$(rbenv init -)"',
|
|
||||||
# require => Vcsrepo['rbenv'],
|
|
||||||
# }
|
|
||||||
# vcsrepo { 'ruby_build':
|
|
||||||
# path => "${mastodon_home}/.rbenv/plugins/ruby-build",
|
|
||||||
# source => 'https://github.com/rbenv/ruby-build.git',
|
|
||||||
# provider => 'git',
|
|
||||||
# owner => 'mastodon',
|
|
||||||
# group => 'mastodon',
|
|
||||||
# require => Vcsrepo['rbenv'],
|
|
||||||
# }
|
|
||||||
# exec { 'update_ruby':
|
|
||||||
# command => "${mastodon_home}/.rbenv/bin/rbenv global 3.2.2",
|
|
||||||
# environment => [
|
|
||||||
# 'RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2',
|
|
||||||
# ],
|
|
||||||
# user => 'mastodon',
|
|
||||||
# cwd => "${mastodon_home}/.rbenv/",
|
|
||||||
# # creates => '',
|
|
||||||
# require => Vcsrepo['ruby_build'],
|
|
||||||
# }
|
|
||||||
# exec { '':}
|
|
||||||
class { 'rvm': }
|
|
||||||
rvm_system_ruby {
|
|
||||||
'ruby-3.2.2':
|
|
||||||
build_opts => ['--with-jemalloc'],
|
|
||||||
}
|
}
|
||||||
rvm_gemset {
|
exec { 'configure_rbenv':
|
||||||
'bundler':
|
command => "${mastodon_home}/.rbenv/src/configure",
|
||||||
name => 'bundler',
|
user => 'mastodon',
|
||||||
ruby_version => 'ruby-3.2.2',
|
cwd => "${mastodon_home}/.rbenv/",
|
||||||
require => Rvm_system_ruby['ruby-3.2.2'];
|
creates => "${mastodon_home}/.rbenv/src/Makefile",
|
||||||
|
require => Vcsrepo['rbenv'],
|
||||||
}
|
}
|
||||||
|
exec { 'make_rbenv':
|
||||||
|
command => '/usr/bin/make -C src',
|
||||||
|
user => 'mastodon',
|
||||||
|
cwd => "${mastodon_home}/.rbenv/",
|
||||||
|
creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
||||||
|
require => Exec['configure_rbenv'],
|
||||||
|
}
|
||||||
|
file_line { 'mastodon_path':
|
||||||
|
path => "${mastodon_home}/.bashrc/",
|
||||||
|
line => 'export PATH="$HOME/.rbenv/bin:$PATH"',
|
||||||
|
match => '^export PATH="$HOME/.rbenv',
|
||||||
|
require => Vcsrepo['rbenv'],
|
||||||
|
}
|
||||||
|
file_line { 'mastodon_rbenv_init':
|
||||||
|
path => "${mastodon_home}/.bashrc/",
|
||||||
|
line => 'eval "$(rbenv init -)"',
|
||||||
|
match => '^eval "$(rbenv init -)"',
|
||||||
|
require => Vcsrepo['rbenv'],
|
||||||
|
}
|
||||||
|
vcsrepo { 'ruby_build':
|
||||||
|
path => "${mastodon_home}/.rbenv/plugins/ruby-build",
|
||||||
|
source => 'https://github.com/rbenv/ruby-build.git',
|
||||||
|
provider => 'git',
|
||||||
|
owner => 'mastodon',
|
||||||
|
group => 'mastodon',
|
||||||
|
require => Vcsrepo['rbenv'],
|
||||||
|
}
|
||||||
|
exec { 'update_ruby':
|
||||||
|
command => "${mastodon_home}/.rbenv/bin/rbenv global 3.2.2",
|
||||||
|
environment => [
|
||||||
|
'RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2',
|
||||||
|
],
|
||||||
|
user => 'mastodon',
|
||||||
|
cwd => "${mastodon_home}/.rbenv/",
|
||||||
|
# creates => '',
|
||||||
|
require => Vcsrepo['ruby_build'],
|
||||||
|
}
|
||||||
|
# exec { 'install_bundler':
|
||||||
|
# command => 'gem install bundler --no-document',
|
||||||
|
# user => 'mastodon',
|
||||||
|
# cwd => "${mastodon_home}/.rbenv/",
|
||||||
|
# # creates => '',
|
||||||
|
# require => Vcsrepo['ruby_build'],
|
||||||
|
# }
|
||||||
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),
|
||||||
|
@ -191,34 +186,34 @@ class mastodon (
|
||||||
group => 'mastodon',
|
group => 'mastodon',
|
||||||
require => User['mastodon'],
|
require => User['mastodon'],
|
||||||
}
|
}
|
||||||
exec { 'config_deployment':
|
# exec { 'config_deployment':
|
||||||
command => 'bundle config deployment \'true\'',
|
# command => 'bundle config deployment \'true\'',
|
||||||
user => 'mastodon',
|
# user => 'mastodon',
|
||||||
cwd => "${mastodon_home}/live",
|
# cwd => "${mastodon_home}/live",
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
# # creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
||||||
require => Rvm_gemset['bundler'],
|
# require => Rvm_gemset['bundler'],
|
||||||
}
|
# }
|
||||||
exec { 'config_without_devel_test':
|
# exec { 'config_without_devel_test':
|
||||||
command => 'bundle config without \'development test\'',
|
# command => 'bundle config without \'development test\'',
|
||||||
user => 'mastodon',
|
# user => 'mastodon',
|
||||||
cwd => "${mastodon_home}/live",
|
# cwd => "${mastodon_home}/live",
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
# # creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
||||||
require => Exec['config_deployment'],
|
# require => Exec['config_deployment'],
|
||||||
}
|
# }
|
||||||
exec { 'bundle_install':
|
# exec { 'bundle_install':
|
||||||
command => 'bundle install -j$(getconf _NPROCESSORS_ONLN)',
|
# command => 'bundle install -j$(getconf _NPROCESSORS_ONLN)',
|
||||||
path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
# path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
||||||
user => 'mastodon',
|
# user => 'mastodon',
|
||||||
cwd => "${mastodon_home}/live",
|
# cwd => "${mastodon_home}/live",
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
# # creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
||||||
require => Exec['config_without_devel_test'],
|
# require => Exec['config_without_devel_test'],
|
||||||
}
|
# }
|
||||||
exec { 'yarn_install':
|
# exec { 'yarn_install':
|
||||||
command => 'yarn install --pure-lockfile',
|
# command => 'yarn install --pure-lockfile',
|
||||||
path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
# path => '/usr/sbin:/usr/bin:/sbin:/bin',
|
||||||
user => 'mastodon',
|
# user => 'mastodon',
|
||||||
cwd => "${mastodon_home}/live",
|
# cwd => "${mastodon_home}/live",
|
||||||
# creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
# # creates => "${mastodon_home}/.rbenv/libexec/rbenv-realpath.dylib",
|
||||||
require => Exec['bundle_install'],
|
# require => Exec['bundle_install'],
|
||||||
}
|
# }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue