Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Nov 8, 2016
2 parents 5259724 + 5989ac4 commit aba8ab3
Show file tree
Hide file tree
Showing 345 changed files with 755 additions and 24,534 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
.DS_Store
.ansible
.bundle
.editorconfig
.github/
.idea/
.vagrant
Movefile
_site
npm-debug.log
package.box
playbook.retry
provision-post.sh
provision-pre.sh
site.yml
vendor
www
wordpress
wp-cli.yml
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ To get started, check out <http://vccw.cc/>

## Contribute

### Setting up

1. Clone this git repository on your local machine.
2. Run `bundle install` to fetch all dependencies.

### Running and writing tests
```
$ git clone [email protected]:vccw-team/vccw.git
$ cd vccw
$ vagrant up
```

There is automated tests using [Serverspec](http://serverspec.org/).
There is automated tests by [Serverspec](http://serverspec.org/).

The tests files are in the `spec/` directory.


Before running the serverspec tests, you'll need some dependencies.

```
Expand Down
144 changes: 20 additions & 124 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Vagrant.require_version '>= 1.8'

Vagrant.configure(2) do |config|

vccw_version = '2.18.0';
vccw_version = '3.0.0';

_conf = YAML.load(
File.open(
Expand Down Expand Up @@ -36,14 +36,8 @@ Vagrant.configure(2) do |config|
_conf.merge!(_site) if _site.is_a?(Hash)
end

if File.exists?(_conf['chef_cookbook_path'])
chef_cookbooks_path = _conf['chef_cookbook_path']
elsif File.exists?(File.join(File.dirname(__FILE__), _conf['chef_cookbook_path']))
chef_cookbooks_path = File.join(File.dirname(__FILE__), _conf['chef_cookbook_path'])
else
puts "Can't find "+_conf['chef_cookbook_path']+'. Please check chef_cookbooks_path in the config.'
exit 1
end
# forcing config variables
_conf["vagrant_dir"] = "/vagrant"

config.vm.define _conf['hostname'] do |v|
end
Expand All @@ -56,15 +50,19 @@ Vagrant.configure(2) do |config|
config.vm.hostname = _conf['hostname']
config.vm.network :private_network, ip: _conf['ip']

config.vm.synced_folder ".", "/vagrant", :mount_options => ['dmode=755', 'fmode=644']
config.vm.synced_folder _conf['sync_folder'], _conf['document_root'], :create => "true", :mount_options => ['dmode=755', 'fmode=644']
config.vm.synced_folder _conf['synced_folder'],
_conf['document_root'], :create => "true", :mount_options => ['dmode=755', 'fmode=644']

if Vagrant.has_plugin?('vagrant-hostsupdater')
config.hostsupdater.remove_on_suspend = true
end

if Vagrant.has_plugin?('vagrant-vbguest')
config.vbguest.auto_update = true
config.vbguest.auto_update = false
end

if File.exists?(File.join(File.dirname(__FILE__), 'provision-pre.sh')) then
config.vm.provision :shell, :path => File.join( File.dirname(__FILE__), 'provision-pre.sh' )
end

config.vm.provider :virtualbox do |vb|
Expand All @@ -79,122 +77,20 @@ Vagrant.configure(2) do |config|
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
end

if 'miya0001/vccw' != config.vm.box && 'provision' != ARGV[0]
config.vm.provision 'shell',
inline: 'curl -L https://www.opscode.com/chef/install.sh | sudo bash -s -- -v 11'
end

if File.exists?(File.join(File.dirname(__FILE__), 'provision-pre.sh')) then
config.vm.provision :shell, :path => File.join( File.dirname(__FILE__), 'provision-pre.sh' )
config.vm.provision "ansible_local" do |ansible|
ansible.extra_vars = {
vccw: _conf
}
ansible.playbook = "provision/playbook.yml"
end

config.vm.provision :chef_solo do |chef|

chef.cookbooks_path = [
File.join(chef_cookbooks_path, 'cookbooks'),
File.join(chef_cookbooks_path, 'site-cookbooks')
]

chef.json = {
:apache => {
:docroot_dir => _conf['document_root'],
:user => _conf['user'],
:group => _conf['group'],
:listen_ports => ['80', '443']
},
:php => {
:packages => %w(php php-cli php-devel php-mbstring php-gd php-xml php-mysql php-pecl-xdebug php-mcrypt),
:directives => {
'default_charset' => 'UTF-8',
'mbstring.language' => 'neutral',
'mbstring.internal_encoding' => 'UTF-8',
'date.timezone' => 'UTC',
'short_open_tag' => 'Off',
'session.save_path' => '/tmp',
'upload_max_filesize' => '32M'
}
},
:mysql => {
:bind_address => '0.0.0.0',
:server_debian_password => 'wordpress',
:server_root_password => 'wordpress',
:server_repl_password => 'wordpress'
},
'wpcli' => {
:user => _conf['user'],
:group => _conf['group'],
:wp_version => ENV['wp_version'] || _conf['version'],
:wp_host => _conf['hostname'],
:wp_home => _conf['wp_home'],
:wp_siteurl => _conf['wp_siteurl'],
:wp_docroot => _conf['document_root'],
:locale => ENV['wp_lang'] || _conf['lang'],
:admin_user => _conf['admin_user'],
:admin_password => _conf['admin_pass'],
:admin_email => _conf['admin_email'],
:default_plugins => _conf['plugins'],
:default_theme => _conf['theme'],
:title => _conf['title'],
:is_multisite => _conf['multisite'],
:force_ssl_admin => _conf['force_ssl_admin'],
:debug_mode => _conf['wp_debug'],
:savequeries => _conf['savequeries'],
:theme_unit_test => _conf['theme_unit_test'],
:theme_unit_test_data_url => _conf['theme_unit_test_uri'],
:gitignore => File.join(_conf['document_root'], ".gitignore"),
:always_reset => _conf['reset_db_on_provision'],
:dbhost => _conf['db_host'],
:dbprefix => _conf['db_prefix'],
:options => _conf['options'],
:multisite_options => _conf['multisite_options'],
:rewrite_structure => _conf['rewrite_structure']
},
:vccw => {
:version => vccw_version,
:user => _conf['user'],
:group => _conf['group'],
:wordmove => {
:movefile => File.join('/vagrant', 'Movefile'),
:url => 'http://' << File.join(_conf['hostname'], _conf['wp_home']),
:wpdir => File.join(_conf['document_root'], _conf['wp_siteurl']),
:dbhost => _conf['db_host']
},
:phpenv => {
:php_version => _conf['php_version']
}
},
:rbenv => {
'rubies' => ['2.1.2'],
'global' => '2.1.2',
'gems' => {
'2.1.2' => [
{
name: 'bundler',
options: '--no-document'
},
{
name: 'sass',
options: '--no-document'
},
{
name: 'wordmove',
options: '--no-document'
},
{
name: 'mailcatcher',
options: '--no-document'
}
]
}
if File.exists?(File.join(File.dirname(__FILE__), 'playbook-post.yml')) then
config.vm.provision "ansible_local" do |ansible|
ansible.extra_vars = {
vccw: _conf
}
}

chef.add_recipe 'wpcli'
chef.add_recipe 'wpcli::install'
if true != _conf['disable_vccw_cookbook']
chef.add_recipe 'vccw'
ansible.playbook = "playbook-post.yml"
end

end

if File.exists?(File.join(File.dirname(__FILE__), 'provision-post.sh')) then
Expand Down
3 changes: 3 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[defaults]
hash_behaviour=merge
remote_tmp=/vagrant/.ansible/tmp
Empty file removed provision/cookbooks/.gitkeep
Empty file.
3 changes: 0 additions & 3 deletions provision/cookbooks/apache2/.gitignore

This file was deleted.

Loading

0 comments on commit aba8ab3

Please sign in to comment.