Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #376 from wunderio/feature/lando-provision
Browse files Browse the repository at this point in the history
Add 'lando provision' tool.
  • Loading branch information
tormi committed Apr 19, 2021
2 parents 94e5cbd + b4a7639 commit e0664e0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ drupal/.make_cache
drupal/drupal.sqlite
.idea
ansible
ansible.vault
local.*
test/composer.lock
test/vendor
Expand Down
30 changes: 30 additions & 0 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: provision
services:
python:
type: python:3.7
build_as_root:
- "apt-get update -y"
# Resolve the locale language issue.
- "apt-get install locales locales-all sudo -y"
- "locale-gen en_US.UTF-8"
run_as_root:
- rm -rf /app/ansible
- git clone git@github.com:wunderio/WunderMachina.git --branch master --single-branch ansible
- install -d -m 777 /var/www/.local/share
- cd /app/ansible && pip install pipenv
- cd /app/ansible && pipenv install
overrides:
environment:
# Set the path to the Ansible vault file. Save the password to the `~/.ssh/ansible.vault` file.
WT_ANSIBLE_VAULT_FILE: "/user/.ssh/ansible.vault"
tooling:
provision:
description: Run Ansible provisioning commands
cmd:
- python: ./provision.sh
pip:
description: Run pip commands
service: python
pipenv:
description: Run pipenv commands
service: python
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Let Vagrant create your new machine:
This will create a new Virtual machine on your computer, configure it with all the nice bells & whistles that you can
think of (like MariaDB, nginx, Varnish, memcached and whatnot) and start it up for you. This will also install vagrant plugin depedencies, if you encounter issues while installing the plugins then you could use: `vagrant --skip-dependency-manager up`

SSH into your box and build and install Drupal:
SSH into your box and build and install Drupal:

```
vagrant ssh
Expand All @@ -41,7 +41,7 @@ cd /vagrant/drupal
```

If this is a project with an existing production/staging server, you should probably sync the production database now,
from your local machine:
from your local machine:

`sync.sh`

Expand Down Expand Up @@ -124,3 +124,11 @@ of the box for PHPStorm. PHP script e.g. drush debugging should also work.
XDebug can be enabled by uncommeting `xdebug: true` in the .lando.yml file. After `lando rebuild` port 9000 is used for XDebug.

Note: Make sure port 9000 is not used in your OS for anything else. You can see all ports in use for example with `lsof -i -n -P`. For example php-fpm might be using port 9000 if you have it running.

## Provisioning with Lando

Perform the following tasks in the project root folder to set up the Lando-based provisioning tool:

1. create the file `~/.ssh/ansible.vault` and save it with the Ansible vault password (search for `Ansible vault password` or similar in the LastPass),
2. run `lando start`,
3. use `lando provision` for help and `lando provision <task>` for provisioning tasks.

0 comments on commit e0664e0

Please sign in to comment.