Skip to content

Commit

Permalink
Merge pull request #254 from lemberg/issue/mkcert-file-provisioner-do…
Browse files Browse the repository at this point in the history
…esnt-run-on-vagrant-up

Improve detection whether VM is supposed to be provisioned or not
  • Loading branch information
T2L committed Nov 15, 2021
2 parents 1e5d772 + 86dbdb3 commit ee0053b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Draft Environment (Unreleased)

- [GH-232](https://github.com/lemberg/draft-environment/pull/254) - Improve detection whether VM is supposed to be provisioned or not (fixes mkcert certificate not being installed on `vagrant up`)
- [GH-232](https://github.com/lemberg/draft-environment/pull/232) - Improve new dependencies autoloading
- [GH-220](https://github.com/lemberg/draft-environment/pull/220) - Store last applied update in the vm-settings.yml file instead of composer.lock
- [GH-245](https://github.com/lemberg/draft-environment/pull/245) - Fix MySQL fail to install due to incorrect configuration of the SQL mode ('~' is not a valid configuration)
Expand Down
9 changes: 6 additions & 3 deletions provisioning/src/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def set_value_by_path(hash, path, value)
# Returns nothing.
protected
def load_settings(project_base_path, draft_base_path)
@project_base_path = project_base_path
@draft_base_path = draft_base_path

default_settings = YAML::load_file("#{draft_base_path}/default.vm-settings.yml")
if File.exist?("#{project_base_path}/vm-settings.yml")
settings = YAML::load_file("#{project_base_path}/vm-settings.yml")
Expand Down Expand Up @@ -247,9 +250,9 @@ def is_provisioning
return true
end

if (ARGV.include?("up"))
status = `vagrant status`
return status.include? "not created"
# Pretty hacky way of checking whether machine has been provisioned or not.
if (ARGV.include?("up") || ARGV.include?("reload"))
return !File.exist?("#{@project_base_path}/.vagrant/machines/#{self.get('virtualbox.name')}/virtualbox/action_provision")
end

return false
Expand Down

0 comments on commit ee0053b

Please sign in to comment.