Loos
10 years ago
228 changed files with 26 additions and 4655 deletions
@ -0,0 +1 @@ |
|||
1.5:e13fdd92-def4-4ed7-a167-23d9309061db |
@ -0,0 +1 @@ |
|||
1409951176 |
@ -0,0 +1 @@ |
|||
e13fdd92-def4-4ed7-a167-23d9309061db |
@ -0,0 +1 @@ |
|||
766e9debb0ee447db036220685ccdcd7 |
@ -0,0 +1 @@ |
|||
{"nfs":{"/vagrant":{"type":"nfs","guestpath":"/vagrant","hostpath":"/Users/Thoughtworker/personal-projects/bike-database","disabled":false,"map_uid":502,"map_gid":20,"nfs_udp":true,"nfs_version":3,"uuid":"1546877126"}},"virtualbox":{"/tmp/vagrant-puppet-4/manifests":{"owner":"root","guestpath":"/tmp/vagrant-puppet-4/manifests","hostpath":"/Users/Thoughtworker/personal-projects/bike-database/puppet/manifests","disabled":false},"/tmp/vagrant-puppet-4/modules-0":{"owner":"root","guestpath":"/tmp/vagrant-puppet-4/modules-0","hostpath":"/Users/Thoughtworker/personal-projects/bike-database/puppet/modules","disabled":false}}} |
@ -1,59 +0,0 @@ |
|||
|
|||
* Road blocks and fixes: |
|||
|
|||
##- When trying to do 'vagrant plugin install vagrant-vbguest' got the follownig nokogiri error. Vagrant v1.6.3 on OSX 10.8.5. |
|||
|
|||
Installing the 'vagrant-vbguest' plugin. This can take a few minutes... |
|||
Building nokogiri using packaged libraries. |
|||
Building libxml2-2.8.0 for nokogiri with the following patches applied: |
|||
- 0001-Fix-parser-local-buffers-size-problems.patch |
|||
... |
|||
... |
|||
... |
|||
Bundler, the underlying system Vagrant uses to install plugins, |
|||
reported an error. The error is shown below. These errors are usually |
|||
caused by misconfigured plugin installations or transient network |
|||
issues. The error from Bundler is: |
|||
|
|||
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue. |
|||
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling. |
|||
... |
|||
... |
|||
|
|||
- Workaround |
|||
$ export NOKOGIRI_USE_SYSTEM_LIBRARIES=true |
|||
$ vagrant plugin install vagrant vagrant-vbguest |
|||
$ vagrant plugin list (validate install) |
|||
|
|||
|
|||
##- Executing "rake db:create" you get the following errors |
|||
PG::Error: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) |
|||
HINT: Use the same encoding as in the template database, or use template0 as template. |
|||
: CREATE DATABASE "db/bikedb_development" ENCODING = 'utf8' |
|||
|
|||
- Solution: follow the instructions here |
|||
http://journal.tianhao.info/2010/12/postgresql-change-default-encoding-of-new-databases-to-utf-8-optional/ |
|||
|
|||
|
|||
## UPDATE - 2014.09.03 |
|||
Implemented a simple psql script that does the exactly as the url above. Do the following inside guest-OS |
|||
|
|||
$ vagrant ssh |
|||
|
|||
$ psql -d postgres -f /vagrant/etc/postgres/enable_utf8_template.sql |
|||
$ sudo -u postgres psql postgres |
|||
|
|||
postgres=# \l |
|||
|
|||
(The ENCODING should be UTF8 for 'template1' database) |
|||
|
|||
|
|||
Original resources for the Vagrantfile. |
|||
http://gorails.com/guides/using-vagrant-for-rails-development |
|||
|
|||
========================================= |
|||
|
|||
## TODOs ## |
|||
- Add the etc/enable_utf8_template.sql into Vagrant provision routine. One less task to for developer to execute. |
|||
- Create developement instructions (README.rdoc?), outlining the commands get the Vagrant/Bike-DB up and running. |
|||
|
@ -1,36 +0,0 @@ |
|||
# -*- mode: ruby -*- |
|||
# vi: set ft=ruby : |
|||
|
|||
|
|||
Vagrant.configure('2') do |config| |
|||
config.vm.box = 'precise32' |
|||
config.vm.box_url = 'http://files.vagrantup.com/precise32.box' |
|||
config.vm.hostname = 'rails-dev-box' |
|||
|
|||
config.vm.provider 'vmware_fusion' do |v, override| |
|||
override.vm.box = 'precise64' |
|||
override.vm.box_url = 'http://files.vagrantup.com/precise64_vmware.box' |
|||
end |
|||
|
|||
config.vm.provider 'parallels' do |v, override| |
|||
override.vm.box = 'parallels/ubuntu-12.04' |
|||
override.vm.box_url = 'https://vagrantcloud.com/parallels/ubuntu-12.04' |
|||
|
|||
# Can be running at background, see https://github.com/Parallels/vagrant-parallels/issues/39 |
|||
v.customize ['set', :id, '--on-window-close', 'keep-running'] |
|||
end |
|||
|
|||
# Enable, if you are NOT OSX. |
|||
# config.vm.synced_folder '.', '/vagrant', type: 'rsync' |
|||
|
|||
# Enable ,if you are on OSX for increase performance. NOTE: May require Admin password |
|||
config.vm.synced_folder '.', '/vagrant', type: 'nfs' |
|||
|
|||
config.vm.network :private_network, ip: '33.33.33.33' |
|||
config.vm.network :forwarded_port, guest: 3000, host: 3000 |
|||
|
|||
config.vm.provision :puppet do |puppet| |
|||
puppet.manifests_path = 'puppet/manifests' |
|||
puppet.module_path = 'puppet/modules' |
|||
end |
|||
end |
@ -0,0 +1,12 @@ |
|||
# Be sure to restart your server when you modify this file. |
|||
|
|||
# Your secret key is used for verifying the integrity of signed cookies. |
|||
# If you change this key, all old signed cookies will become invalid! |
|||
|
|||
# Make sure the secret is at least 30 characters and all random, |
|||
# no regular words or you'll be exposed to dictionary attacks. |
|||
# You can use `rake secret` to generate a secure secret key. |
|||
|
|||
# Make sure your secret_key_base is kept private |
|||
# if you're sharing your code publicly. |
|||
Bikedb::Application.config.secret_key_base = '55bed17e71286b1810e75f047637fd1acd64351fcdd5591ab83af67bdc628cb65958d98992a653268015aec9274a2e573b66fb5895d2bf86acd8a5c0e9d35813' |
@ -1,16 +0,0 @@ |
|||
/* |
|||
* Updates the default 'template1' database into UTF-8 instead of SQL_ASCII. |
|||
*/ |
|||
|
|||
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'; |
|||
|
|||
DROP DATABASE template1; |
|||
|
|||
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE'; |
|||
|
|||
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; |
|||
|
|||
\c template1 |
|||
VACUUM FREEZE; |
|||
|
|||
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'; |
@ -1,158 +0,0 @@ |
|||
$ar_databases = ['activerecord_unittest', 'activerecord_unittest2'] |
|||
$as_vagrant = 'sudo -u vagrant -H bash -l -c' |
|||
$home = '/home/vagrant' |
|||
|
|||
# Pick a Ruby version modern enough, that works in the currently supported Rails |
|||
# versions, and for which RVM provides binaries. |
|||
$ruby_version = '2.1.1' |
|||
|
|||
Exec { |
|||
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'] |
|||
} |
|||
|
|||
# --- Preinstall Stage --------------------------------------------------------- |
|||
|
|||
stage { 'preinstall': |
|||
before => Stage['main'] |
|||
} |
|||
|
|||
class apt_get_update { |
|||
exec { 'apt-get -y update': |
|||
unless => "test -e ${home}/.rvm" |
|||
} |
|||
} |
|||
class { 'apt_get_update': |
|||
stage => preinstall |
|||
} |
|||
|
|||
# --- SQLite ------------------------------------------------------------------- |
|||
|
|||
package { ['sqlite3', 'libsqlite3-dev']: |
|||
ensure => installed; |
|||
} |
|||
|
|||
# --- MySQL -------------------------------------------------------------------- |
|||
|
|||
class install_mysql { |
|||
class { 'mysql': } |
|||
|
|||
class { 'mysql::server': |
|||
config_hash => { 'root_password' => '' } |
|||
} |
|||
|
|||
database { $ar_databases: |
|||
ensure => present, |
|||
charset => 'utf8', |
|||
require => Class['mysql::server'] |
|||
} |
|||
|
|||
database_user { 'rails@localhost': |
|||
ensure => present, |
|||
require => Class['mysql::server'] |
|||
} |
|||
|
|||
database_grant { ['rails@localhost/activerecord_unittest', 'rails@localhost/activerecord_unittest2', 'rails@localhost/inexistent_activerecord_unittest']: |
|||
privileges => ['all'], |
|||
require => Database_user['rails@localhost'] |
|||
} |
|||
|
|||
package { 'libmysqlclient15-dev': |
|||
ensure => installed |
|||
} |
|||
} |
|||
class { 'install_mysql': } |
|||
|
|||
# --- PostgreSQL --------------------------------------------------------------- |
|||
|
|||
class install_postgres { |
|||
class { 'postgresql': } |
|||
|
|||
class { 'postgresql::server': } |
|||
|
|||
pg_database { $ar_databases: |
|||
ensure => present, |
|||
encoding => 'UTF8', |
|||
require => Class['postgresql::server'] |
|||
} |
|||
|
|||
pg_user { 'rails': |
|||
ensure => present, |
|||
require => Class['postgresql::server'] |
|||
} |
|||
|
|||
pg_user { 'vagrant': |
|||
ensure => present, |
|||
superuser => true, |
|||
require => Class['postgresql::server'] |
|||
} |
|||
|
|||
package { 'libpq-dev': |
|||
ensure => installed |
|||
} |
|||
|
|||
package { 'postgresql-contrib': |
|||
ensure => installed, |
|||
require => Class['postgresql::server'], |
|||
} |
|||
} |
|||
class { 'install_postgres': } |
|||
|
|||
# --- Memcached ---------------------------------------------------------------- |
|||
|
|||
class { 'memcached': } |
|||
|
|||
# --- Packages ----------------------------------------------------------------- |
|||
|
|||
package { 'curl': |
|||
ensure => installed |
|||
} |
|||
|
|||
package { 'build-essential': |
|||
ensure => installed |
|||
} |
|||
|
|||
package { 'git-core': |
|||
ensure => installed |
|||
} |
|||
|
|||
# Nokogiri dependencies. |
|||
package { ['libxml2', 'libxml2-dev', 'libxslt1-dev']: |
|||
ensure => installed |
|||
} |
|||
|
|||
# ExecJS runtime. |
|||
package { 'nodejs': |
|||
ensure => installed |
|||
} |
|||
|
|||
# --- Ruby --------------------------------------------------------------------- |
|||
|
|||
exec { 'install_rvm': |
|||
command => "${as_vagrant} 'curl -L https://get.rvm.io | bash -s stable'", |
|||
creates => "${home}/.rvm/bin/rvm", |
|||
require => Package['curl'] |
|||
} |
|||
|
|||
exec { 'install_ruby': |
|||
# We run the rvm executable directly because the shell function assumes an |
|||
# interactive environment, in particular to display messages or ask questions. |
|||
# The rvm executable is more suitable for automated installs. |
|||
# |
|||
# use a ruby patch level known to have a binary |
|||
command => "${as_vagrant} '${home}/.rvm/bin/rvm install ruby-${ruby_version} --binary --autolibs=enabled && rvm alias create default ${ruby_version}'", |
|||
creates => "${home}/.rvm/bin/ruby", |
|||
require => Exec['install_rvm'] |
|||
} |
|||
|
|||
# RVM installs a version of bundler, but for edge Rails we want the most recent one. |
|||
exec { "${as_vagrant} 'gem install bundler --no-rdoc --no-ri'": |
|||
creates => "${home}/.rvm/bin/bundle", |
|||
require => Exec['install_ruby'] |
|||
} |
|||
|
|||
# --- Locale ------------------------------------------------------------------- |
|||
|
|||
# Needed for docs generation. |
|||
exec { 'update-locale': |
|||
command => 'update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8' |
|||
} |
@ -1,2 +0,0 @@ |
|||
pkg/ |
|||
*.swp |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue