
Refactor askbot module: - deployment source from git instead of pip - separate init / install / config code - break site config into celeryd / cron / http / log / ssl / static parts - support of Ubuntu Precise 12.04LTS / Trusty 14.04LTS Notice: don't approve this patch until puppet run is enabled on ask.o.o because it breaks the production site. (need to refactor the related system-config ask.pp too) Depends-On: Iaa8488a3d7ab8b121404ac1ac39bd1620a868727 Change-Id: I560c24c3b09e4a8d09b23afa619a4cf361601cbe
56 lines
1.6 KiB
Puppet
56 lines
1.6 KiB
Puppet
# Define: askbot::theme::compass
|
|
#
|
|
# This class installs the Ruby based bundler command and compiles
|
|
# the Sass files of a custom theme. The theme must contain a
|
|
# proper Gemfile to define compass version and dependencies.
|
|
#
|
|
# Actions:
|
|
# - Install Ruby / Compass
|
|
# - Compile Sass files into Css stylesheets
|
|
#
|
|
define askbot::theme::compass(
|
|
) {
|
|
if $::lsbdistcodename == 'precise' {
|
|
# add ruby, bundler packages if not defined somewhere else
|
|
if ! defined(Package['rubygems']) {
|
|
package { 'rubygems':
|
|
ensure => present,
|
|
}
|
|
}
|
|
|
|
if ! defined(Package['bundler']) {
|
|
package { 'bundler':
|
|
ensure => latest,
|
|
provider => gem,
|
|
require => Package['rubygems'],
|
|
}
|
|
}
|
|
} else {
|
|
# add bundler as a debian package
|
|
package { 'bundler':
|
|
ensure => latest,
|
|
}
|
|
}
|
|
|
|
# install bundle requirements in Gemfiles, compile Sass
|
|
exec { "theme-bundle-install-${name}":
|
|
cwd => '/srv/askbot-site/themes',
|
|
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'],
|
|
logoutput => on_failure,
|
|
command => 'bundle install',
|
|
require => Package['bundler'],
|
|
refreshonly => true,
|
|
}
|
|
|
|
exec { "theme-bundle-compile-${name}":
|
|
cwd => '/srv/askbot-site/themes',
|
|
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'],
|
|
logoutput => on_failure,
|
|
command => 'bundle exec compass compile',
|
|
require => Exec["theme-bundle-install-${name}"],
|
|
refreshonly => true,
|
|
notify => Exec['askbot-static-generate'],
|
|
}
|
|
|
|
}
|