Skip to content
This repository was archived by the owner on Aug 20, 2019. It is now read-only.

Commit aa777d5

Browse files
committed
Load default config directly from project directory.
1 parent 9b03fd5 commit aa777d5

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Vagrantfile

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,15 @@ config_dir = ENV['BEET_CONFIG_DIR'] || "#{beet_root}/.beetbox"
1212
project_config = "#{config_dir}/config.yml"
1313
local_config = "#{config_dir}/local.config.yml"
1414
composer_json = "#{beet_root}/composer.json"
15+
vendor_dir = %x(composer config vendor-dir).strip
16+
default_config = "#{vendor_dir}/beet/box/provisioning/ansible/config/default.config.yml"
17+
default_config = "provisioning/ansible/config/default.config.yml" if !File.exist?(default_config)
1518

1619
# Default vagrant config.
17-
vconfig = {
18-
'vagrant_box' => 'beet/box',
19-
'vagrant_box_version' => '~> 0.6.0',
20-
'vagrant_ip' => '0.0.0.0',
21-
'vagrant_memory' => 1024,
22-
'vagrant_cpus' => 1,
23-
'beet_project' => 'drupal',
24-
'beet_profile' => 'beetbox',
25-
'beet_provision_playbook' => 'provision',
26-
'beet_provision_tags' => 'all',
27-
'beet_home' => '/beetbox',
28-
'beet_base' => '/var/beetbox',
29-
'beet_domain' => beet_root.split('/').last.gsub(/[\._]/, '-') + ".local",
30-
'beet_aliases' => [],
31-
'beet_provision' => true,
32-
'drush_create_alias' => true
33-
}
20+
vconfig = YAML::load_file(default_config)
21+
vconfig['beet_home'] = '/beetbox'
22+
vconfig['beet_base'] = '/var/beetbox'
23+
vconfig['beet_domain'] = beet_root.split('/').last.gsub(/[\._]/, '-') + ".local"
3424

3525
# Create config directory.
3626
FileUtils.mkdir_p config_dir

provisioning/ansible/config/default.config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
# Copy any of these settings to the custom config file to override.
77
#
88

9+
# Vagrant config.
10+
vagrant_box: beet/box
11+
vagrant_box_version: "~> 0.5.0"
12+
vagrant_ip: "0.0.0.0"
13+
vagrant_memory: "1024"
14+
vagrant_cpus: 1
15+
916
# Beetbox config.
17+
beet_profile: beetbox
1018
beet_repo: "{{ lookup('env','BEET_REPO') | default('https://github.com/beetboxvm/beetbox.git',true) }}"
1119
beet_version: "{{ lookup('env','BEET_VERSION') | default('master',true) }}"
1220
beet_home: "{{ lookup('env','BEET_HOME') | default('/beetbox',true) }}"
@@ -30,6 +38,8 @@ beet_mysql_database: "beetbox"
3038
beet_custom_pre_tasks: "{{ beet_base }}/.beetbox/tasks/pre"
3139
beet_custom_post_tasks: "{{ beet_base }}/.beetbox/tasks/post"
3240
beet_root_create: yes
41+
beet_provision_playbook: provision
42+
beet_provision_tags: all
3343
beet_provision: yes
3444

3545
# Symlinks.

0 commit comments

Comments
 (0)