Skip to content

Instantly share code, notes, and snippets.

@danielres
Created February 8, 2011 14:34
Show Gist options
  • Select an option

  • Save danielres/816518 to your computer and use it in GitHub Desktop.

Select an option

Save danielres/816518 to your computer and use it in GitHub Desktop.
random personal notes and reminders related to my funny adventures with RefineryCMS
# usage:
# curl https://gist.github.com/raw/816518/generator.sh | bash -s {APPNAME} {SSH_USER} {SSH_HOST}
APP=$1
SSH_USER=$2
SSH_HOST=$3
refinerycms -f $APP
cd $APP
#UNCOMMENTING SOME GEMS
sed -i "s/# gem 'refinerycms-theming'/gem 'refinerycms-theming'/" Gemfile
sed -i "s/# gem 'refinerycms-inquiries'/gem 'refinerycms-inquiries'/" Gemfile
sed -i "s/# gem 'refinerycms-blog'/gem 'refinerycms-blog'/" Gemfile
sed -i "s/# gem 'refinerycms-news'/gem 'refinerycms-news'/" Gemfile
sed -i "s/# gem 'capistrano'/gem 'capistrano'/" Gemfile
#ADDING PERSONAL GEM LIST
echo "
#views -------------
gem 'haml-rails'
#gem "jquery-rails"
gem 'compass'
#gem 'formtastic'
#gem 'will_paginate'
#gem 'block_helpers'
#sys ---------------
#gem 'capistrano'
gem 'mysql2'
gem 'thin'
#auth --------------
#gem 'devise'
#gem 'hpricot' # required by devise
#gem 'ruby_parser' # required by devise
#admin -------------
# gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
gem 'yaml_db'
#dev ---------------
#group :development, :test do
# gem 'rspec-rails'
# gem 'autotest-rails' # see: https://gist.github.com/365816
# gem 'autotest'
# gem 'cucumber-rails'
# gem 'database_cleaner'
# gem 'webrat'
# gem 'selenium-client'
# using test_notifier: https://github.com/fnando/test_notifier
#end
" >> Gemfile
bundle
APP=$1
SSH_USER=$2
SSH_HOST=$3
SUPERUSER_NAME=$4
SUPERUSER_EMAIL=$5
SUPERUSER_PASS=$6
THEME_NAME='base'
SITE_NAME='My company'
echo "== Generating remote repo + local clone"
ssh $SSH_USER@$SSH_HOST "cd git && git init $APP --bare" && git clone $SSH_USER@$SSH_HOST:git/$APP $APP &&
echo "== Generating refinery app" &&
curl https://gist.github.com/raw/816518/generator.sh | bash -s $APP $SSH_USER $SSH_HOST &&
echo "== git first auto commit + push" &&
cd $APP && git add . && git commit -m "initial commit" && git push origin master &&
echo "== inserting superuser" &&
echo "
Role.create(:title => 'Refinery')
Role.create(:title => 'Superuser')
su = User.create(
:username => '$SUPERUSER_NAME',
:email => '$SUPERUSER_EMAIL',
:password => '$SUPERUSER_PASS'
)
su.roles << Role.find_by_title('Refinery')
su.roles << Role.find_by_title('Superuser')
su.save
" >> db/seeds/users.rb && rm db/seeds/pages.rb && rake db:seed && rm db/seeds/users.rb &&
echo "== generate refinery theme" &&
rails generate refinery_theme $THEME_NAME &&
echo "== generate refinery inquiries (contact form)" &&
rails generate refinerycms_inquiries && rake db:migrate &&
echo "== compass init for theme \"$THEME_NAME\"" &&
compass init rails --using blueprint/semantic -e development -s nested --syntax sass --sass-dir themes/$THEME_NAME/sass --css-dir themes/$THEME_NAME/stylesheets --force &&
echo "== git commit compass init for theme \"$THEME_NAME\" (no push)" &&
git add . && git commit -m "compass stylesheets installed (please add links to stylesheets to layout)" &&
echo "== providing overrides for some refinery views" &&
rake refinery:override view=shared/_head.html &&
rake refinery:override view=layouts/application &&
cd app/views &&
html2haml layouts/application.html.erb layouts/application.html.haml && rm layouts/application.html.erb &&
html2haml shared/_head.html.erb shared/_head.html.haml && rm shared/_head.html.erb &&
cd ../.. &&
echo "== git commit overrides for some refinery views (no push)" &&
git add app/views && git commit -m "overrides for some refinery views: shared/_head.html and layouts/application" &&
echo "== applying default settings" &&
wget https://gist.github.com/raw/816518/refinery_settings.rb &&
rails runner refinery_settings.rb
s = RefinerySetting.find_or_create_by_name("i18n_translation_default_frontend_locale")
s.value="fr"
s.save
s = RefinerySetting.find_or_create_by_name("i18n_translation_frontend_locales")
s.value="[:en, :fr]"
s.save
s = RefinerySetting.find_or_create_by_name("i18n_translation_current_locale")
s.value="fr"
s.save
s = RefinerySetting.find_or_create_by_name("approximate_ascii")
s.value="true"
s.save
s = RefinerySetting.find_or_create_by_name("site_name")
s.value=$SITE_NAME
s.save
#s = RefinerySetting.find_or_create_by_name("frontend_refinery_stylesheets_enabled")
#s.value="false"
#s.save
s = RefinerySetting.find_or_create_by_name("use_google_ajax_libraries")
s.value="true"
s.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment