π¬π§ Using Trellis on Windows
Setting up a new Vagrant box
This requires a change in the trellis/Vagrantfile as described here Trellis GitHub issue 8 with the following example Vagrantfile.
Vagrant
Make sure Virtualbox is installed on the host machine (Windows).
Execute vagrant up
to build a new VM.
Wait until itβs done.
Now generate a .ppk file from the private_key in trellis/.vagrant/machines/default/virtualbox/private_key
Use this private_key_ppk.ppk
to connect with Putty to the running Vagrant VM.
VM box environment setup
Go to /srv/wwww/domain.com/current/web/app/themes/theme-name
and install Yarn, Node 6 and webpack.
Note Change the version of Node to 6 to be compatible with all package dependencies.
Yarn
Node
NPM setup
From the VM for deploys (Ubuntu node-sass) From the host machine for development (Win-x64 node-sass)
Composer dependencies
From the Sage root in the VM:
composer install
Adding dependencies to the project
Perform composer require
commands in the bedrock root (i.e. /current/web$
) on the VM instead of the host machine
Project setup
Import database
Place a database export in the project current folder (/srv/www/domain.com/current). Run the following commands:
Setup SSH keys
Retrieve the key
Run the following command from the VM and copy the output
cat ~/.ssh/id_rsa.pub
Add to Gitlab
Add the copied key to the ssh keys for your user.
Add to the servers
Connect as web
user to the deployment servers (staging, production) and add the copied key in the authorized_keys
file
Errors?
Yarn build not working?
npm rebuild node-sass --no-bin-linksnpm install optipng-bin pngquant-bin mozjpeg gifsicle jpegtran-bin --no-bin-links
Yarn build still not working?
rm -rf node_modulesyarn --no-bin-links --ignore-optional