Skip to content

Instantly share code, notes, and snippets.

@markf3lton
Last active August 4, 2019 20:11
Show Gist options
  • Save markf3lton/8a258b94ca1a5bea8911f6b244da3604 to your computer and use it in GitHub Desktop.
Save markf3lton/8a258b94ca1a5bea8911f6b244da3604 to your computer and use it in GitHub Desktop.

Getting Started with BLT on Windows

This is a work-in-progress notes stream of links that may be helpful for new Windows users, or macOS to Windows converters.

Create a free sandbox on Acquia Cloud

When asked to install Drupal, please choose the option for <None>, which is the best starting point for new sandboxes.

It will take 15 minutes or more before the sandbox is available.

Command to launch a new ^10.0.0 project

Via https://github.com/acquia/blt-project

composer create-project acquia/blt-project:10.x-dev --no-interaction my-project

Avoid using a hyphen in your project names, e.g. bltdemo is better than blt-demo

Troubleshooting

php --ini

https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

After you create your project

  • Create a new GitHub project and do not initialize it with a README

  • Push your codebase to GitHub

git remote add origin https://github.com/<your-github>/<your-project>.git
git push -u origin master
  • You will definitely want to edit your BLT.yml with your Acquia Free Tier repo
git:
  default_branch: master
  remotes:
    - '[email protected]:bltdemo123.git'

Troubleshooting in the Real World

Courtesy of LC

I had to pivot the approach several times but I think I got an stable process to get this working. The most challenging part was finding the right troubleshooting information, since I couldn’t find a clear path to the specific issues I was having (for example, realizing that Vagrant 2.2.5 was not the right version to work with and I had to downgrade to Vagrant 2.2.4).

Here is what I did at the end:

composer clear-cache
export COMPOSER_PROCESS_TIMEOUT=2000
composer create-project --no-interaction acquia/blt-project <projectname>
  • In WSL Ubuntu Bash, move to the project directory and run the following command:
blt vm
  • This will fail at the end, but it will create the Vagrantfile and bring the dependencies

  • Switch to a Windows Command Line Tool

  • Navigate to the mapped folder created by WSL. In my case, it was something like this

cd \Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\<ubuntu user>\<projectname>
  • Run vagrant up – this will create the VM
vagrant up
  • ssh to the created VM
vagrant ssh
  • Navigate to the project folder in the VM. Run composer install
cd /var/www/<projectname>

composer install
blt Drupal:install
  • Drupal should be available at http://local..com

  • Common Errors I encountered:

  • Memory limits:

https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

Use “COMPOSER_MEMORY_LIMIT=-1”

  • Updating dependencies

acquia/blt#3354

  • BLT not working after install:

If you have trouble creating the project, attempt to resolve the issue by using one of the following methods:

composer clear-cache

export COMPOSER_PROCESS_TIMEOUT=2000

If you have trouble using the blt alias, verify the alias is installed as expected, and then restart your terminal session by running the following commands, based on your version of Acquia BLT:

./vendor/bin/blt blt:init:shell-alias

source ~/.bash_profile

If you receive syntax errors from vendor packages, ensure that the version of PHP on your host matches the version of PHP in your VM, or else be sure to always run Composer commands from the VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment