Working around vagrant bugs by using a custom box now
This commit is contained in:
Родитель
204749c19f
Коммит
118bd09422
|
@ -16,8 +16,10 @@ CONF = _config
|
||||||
MOUNT_POINT = '/home/vagrant/project'
|
MOUNT_POINT = '/home/vagrant/project'
|
||||||
|
|
||||||
Vagrant::Config.run do |config|
|
Vagrant::Config.run do |config|
|
||||||
config.vm.box = "zamboni"
|
config.vm.box = "zamboni-full"
|
||||||
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
|
config.vm.box_url = "http://people.mozilla.com/~kmcmillan/zamboni.box"
|
||||||
|
# This is the stock VM:
|
||||||
|
# config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
|
||||||
|
|
||||||
# TODO(Kumar) figure out a way to forward port 80, as requested from the
|
# TODO(Kumar) figure out a way to forward port 80, as requested from the
|
||||||
# guest, to 8000 on the host. This apparently doesn't do that :/
|
# guest, to 8000 on the host. This apparently doesn't do that :/
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
# version control.
|
# version control.
|
||||||
class custom {
|
class custom {
|
||||||
# exec { "install-nosenicedots":
|
# exec { "install-nosenicedots":
|
||||||
# command => "sudo pip install nosenicedots",
|
# command => "sudo pip install nosenicedots"
|
||||||
# require => Package['python-pip']
|
|
||||||
# }
|
# }
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Migrate the database
|
||||||
|
class migrate {
|
||||||
|
package { ["git-core", "python2.6"]:
|
||||||
|
ensure => installed;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Skip this migration because it won't succeed without indexes but you
|
||||||
|
# can't build indexes without running migrations :(
|
||||||
|
file { "$PROJ_DIR/migrations/264-locale-indexes.py":
|
||||||
|
content => "def run(): pass",
|
||||||
|
replace => true
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "sql_migrate":
|
||||||
|
cwd => "$PROJ_DIR",
|
||||||
|
command => "python ./vendor/src/schematic/schematic migrations/",
|
||||||
|
logoutput => true,
|
||||||
|
require => [
|
||||||
|
# Service["mysql"],
|
||||||
|
Package["python2.6"],
|
||||||
|
File["$PROJ_DIR/migrations/264-locale-indexes.py"],
|
||||||
|
# Exec["fetch_landfill_sql"],
|
||||||
|
# Exec["load_data"]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "restore_migration_264":
|
||||||
|
cwd => "$PROJ_DIR",
|
||||||
|
command => "git checkout migrations/264-locale-indexes.py",
|
||||||
|
require => [Exec["sql_migrate"], Package["git-core"]]
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,34 +44,8 @@ class zamboni {
|
||||||
|
|
||||||
# TODO(Kumar) add landfile files as well.
|
# TODO(Kumar) add landfile files as well.
|
||||||
|
|
||||||
# Skip this migration because it won't succeed without indexes but you
|
|
||||||
# can't build indexes without running migrations :(
|
|
||||||
file { "$PROJ_DIR/migrations/264-locale-indexes.py":
|
|
||||||
content => "def run(): pass",
|
|
||||||
replace => true
|
|
||||||
}
|
|
||||||
|
|
||||||
exec { "sql_migrate":
|
|
||||||
cwd => "$PROJ_DIR",
|
|
||||||
command => "python ./vendor/src/schematic/schematic migrations/",
|
|
||||||
logoutput => true,
|
|
||||||
require => [
|
|
||||||
Service["mysql"],
|
|
||||||
Package["python2.6"],
|
|
||||||
File["$PROJ_DIR/migrations/264-locale-indexes.py"],
|
|
||||||
Exec["fetch_landfill_sql"],
|
|
||||||
Exec["load_data"]
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
exec { "restore_migration_264":
|
|
||||||
cwd => "$PROJ_DIR",
|
|
||||||
command => "git checkout migrations/264-locale-indexes.py",
|
|
||||||
require => [Exec["sql_migrate"], Package["git-core"]]
|
|
||||||
}
|
|
||||||
|
|
||||||
exec { "remove_site_notice":
|
exec { "remove_site_notice":
|
||||||
command => "mysql -uroot -e\"delete from config where \\`key\\`='site_notice'\" $DB_NAME",
|
command => "mysql -uroot -e\"delete from config where \\`key\\`='site_notice'\" $DB_NAME",
|
||||||
require => Exec["sql_migrate"]
|
require => Exec["load_data"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,14 +16,22 @@ Exec {
|
||||||
}
|
}
|
||||||
|
|
||||||
class dev {
|
class dev {
|
||||||
|
|
||||||
|
# We need to use a custom VM box until the Net::SSH bug is fixed:
|
||||||
|
# https://github.com/mitchellh/vagrant/issues/516
|
||||||
|
# The custom box was provisioned with the commented out commands.
|
||||||
|
# Once the bug is fixed we can go back to the stock box and activate
|
||||||
|
# the full suite of provisioning.
|
||||||
|
|
||||||
class {
|
class {
|
||||||
init: before => Class[mysql];
|
# init: before => Class[mysql];
|
||||||
mysql: before => Class[python];
|
# mysql: before => Class[python];
|
||||||
python: before => Class[redis];
|
# python: before => Class[zamboni];
|
||||||
# apache: before => Class[zamboni];
|
# # apache: before => Class[zamboni];
|
||||||
redis: before => Class[zamboni];
|
# redis: before => Class[zamboni];
|
||||||
elasticsearch: ;
|
# elasticsearch: before => Class[zamboni];
|
||||||
zamboni: ;
|
# zamboni: before => Class[migrate];
|
||||||
|
migrate: before => Class[custom];
|
||||||
custom: ;
|
custom: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче