-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Drupal VM 3.1 integration. #105
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<project name="vm" default="vm:init"> | ||
|
||
<target name="vm:init" description="Initializes Drupal VM for this project."> | ||
<copy file="${repo.root}/scripts/drupal-vm/drupal-vm.aliases.drushrc.php" todir="${repo.root}/drush/site-aliases"> | ||
<filterchain> | ||
<expandproperties /> | ||
</filterchain> | ||
</copy> | ||
<mkdir dir="${repo.root}/box" mode="755"/> | ||
<exec dir="${repo.root}" command="composer require --dev geerlingguy/drupal-vm:~3.1" logoutput="true" checkreturn="true"/> | ||
<copy file="${repo.root}/scripts/drupal-vm/config.yml" tofile="${repo.root}/box/config.yml"> | ||
<filterchain> | ||
<expandproperties /> | ||
</filterchain> | ||
</copy> | ||
<copy file="${repo.root}/scripts/drupal-vm/Vagrantfile" todir="${repo.root}"/> | ||
<!-- Sadly this wipes out comments in the file. --> | ||
<exec dir="${repo.root}" command="${composer.bin}/drupal yaml:update:value ${repo.root}/project.yml drush.default_alias '${project.machine_name}.local'" logoutput="true" checkreturn="true"/> | ||
<exec dir="${repo.root}" command="${composer.bin}/drupal yaml:update:value ${repo.root}/project.yml drush.aliases.local '${project.machine_name}.local'" logoutput="true" checkreturn="true"/> | ||
<exec dir="${repo.root}" command="${composer.bin}/drupal yaml:update:value ${repo.root}/build/custom/phing/build.yml drush.root ''" logoutput="true" checkreturn="true"/> | ||
</target> | ||
|
||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# The absolute path to the root directory of the project. Both Drupal VM and | ||
# the config file need to be contained within this path. | ||
ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}" | ||
|
||
# The relative path from the project root to the config directory where you | ||
# placed your config.yml file. | ||
ENV['DRUPALVM_CONFIG_DIR'] = "box" | ||
|
||
# The relative path from the project root to the directory where Drupal VM is located. | ||
ENV['DRUPALVM_DIR'] = "vendor/geerlingguy/drupal-vm" | ||
|
||
# Load the real Vagrantfile | ||
load "#{__dir__}/#{ENV['DRUPALVM_DIR']}/Vagrantfile" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Update the hostname to the local development environment hostname | ||
vagrant_hostname: ${project.local.hostname} | ||
vagrant_machine_name: ${project.machine_name} | ||
|
||
# Set drupal_site_name to the project's human-readable name. | ||
drupal_site_name: "${project.human_name}" | ||
|
||
# Provide the path to the project root to Vagrant. | ||
vagrant_synced_folders: | ||
# Set the local_path for the first synced folder to `../`. | ||
- local_path: . | ||
# Set the destination to the Acquia Cloud subscription machine name. | ||
destination: /var/www/${project.machine_name} | ||
type: nfs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this been tested? I believe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this has been tested. I did initially attempt to keep it as |
||
|
||
build_composer_project: false | ||
# Toggling this to `true` would invoke `composer install` with the | ||
# projects own `composer.json` successfully. | ||
build_composer: false | ||
drupal_composer_path: false | ||
drupal_composer_install_dir: "/var/www/${project.machine_name}" | ||
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" | ||
|
||
drupal_mysql_user: drupal | ||
drupal_mysql_password: drupal | ||
drupal_mysql_database: drupal | ||
|
||
# Set this to 'false' if you don't need to install drupal (using the drupal_* | ||
# settings below), but instead copy down a database (e.g. using drush sql-sync). | ||
install_site: false | ||
|
||
# Drupal VM automatically creates a drush alias file in your ~/.drush folder if | ||
# this variable is 'true'. | ||
configure_drush_aliases: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
// [vagrant_machine_name].local | ||
$aliases['${project.machine_name}.local'] = array( | ||
// /var/www/[vagrant_machine_name]/docroot | ||
'root' => '/var/www/${project.machine_name}/docroot', | ||
// vagrant_hostname | ||
'uri' => '${project.local.hostname}', | ||
// vagrant_hostname | ||
'remote-host' => '${project.local.hostname}', | ||
'remote-user' => 'vagrant', | ||
'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key' | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Drupal; | ||
|
||
use Symfony\Component\Yaml\Yaml; | ||
|
||
/** | ||
* Class DrupalVM. | ||
* | ||
* Verifies that Drupal VM integration works as expected. | ||
*/ | ||
class DrupalVmTest extends \PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* Class constructor. | ||
*/ | ||
public function __construct() { | ||
$this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); | ||
$this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); | ||
$this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; | ||
} | ||
|
||
/** | ||
* Tests Phing vm:init target. | ||
*/ | ||
public function testVmInit() { | ||
$this->assertFileExists($this->new_project_dir . '/Vagrantfile'); | ||
$this->assertFileExists($this->new_project_dir . '/box/config.yml'); | ||
$this->assertFileExists($this->new_project_dir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php'); | ||
|
||
$this->assertNotContains( | ||
'${project.machine_name}', | ||
file_get_contents($this->new_project_dir . '/box/config.yml') | ||
); | ||
$this->assertNotContains( | ||
'${project.machine_name}', | ||
file_get_contents($this->new_project_dir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php') | ||
); | ||
$this->assertContains( | ||
'drush:', | ||
file_get_contents($this->new_project_dir . '/build/custom/phing/build.yml') | ||
); | ||
$this->assertContains( | ||
'root:', | ||
file_get_contents($this->new_project_dir . '/build/custom/phing/build.yml') | ||
); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.
:)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it can always be
1
(or any number) since Markdown parses it as a typicalol
item in the resulting HTML... I like numbering them in the markdown itself because I usually read Markdown in its native format... but many people like using1 1 1 1 1 1
since it requires renumbering if you're off (well, technically you could have any number there, but I'm a little OCD, so I always renumber when editing) :D