Aegir Development Environment
This repo is designed to make it easier to develop aegir and related tools.
Clone this repo and run the
prepare.sh script to setup all of the required
docker-compose.yml file will launch a running Aegir instance
aegir-home directory mapped to
/var/aegir in the container.
Got feedback? Suggested changes? Visit the repo at http://github.com/aegir-project/development.
- Install pre-requisites:
- drush (locally, for building the stack).
- have ssh public key authentication setup for Drupal.org and GitHub.
- docker. Docker for Mac Beta now works great.
- docker-compose. Get the latest stable docker-compose(> 1.6), to ensure version 2 compose.yml file compatibility.
Clone this repo and enter the 'aegir-development' folder:
git clone http://github.com/aegir-project/development aegir-development cd aegir-development
This script does the following:
- Creates an "aegir-home" folder and opens permissions. This maps to
/var/aegirin the container.
- Builds a hostmaster stack with the aegir.make file and uses "working copy" so all sub projects are git clones.
- Clones provision and registry rebuild into the .drush folder.
- Creates a custom local container for you, using your user's UID. This is so mounted folders can be written to and don't get saved as root on the host.
docker-compose up -d && docker-compose logs -f:
This will download and launch mysql and aegir containers, detach from the process so it will keep running, and then follows the logs output from the hostmaster container.
You will have to wait a bit for hostmaster to install. Watch the logs for the "Congratulations" message and the one-time-login link.
Once running, you can edit the files in ./aegir/hostmaster-7.x-3.x and get live when loading the site at http://aegir.local.computer
docker-compose.yml is set to utilize port 80, so you will get an error
if you have any other web server running locally on port 80.
If you do not want this, simply change the
docker-compose.yml file ports to
``` ports: - 8080:80 ```
Using local.computer: The domain name http://local.computer is registered to Aegir contributor and set to resolve to 127.0.0.1, otherwise known as localhost.
There is also a wildcard domain, so any subdomain on local.computer resolves to localhost. This development environment uses the hostname http://aegir.local.computer. When you are creating sites in aegir, if you want to access them without messing with DNS or Hosts file, you can use http://sitename.local.computer as the domain name.
- Get into the container:
To get into the server as the aegir user using the terminal, run the command:
``` docker exec -ti aegir_hostmaster_1 bash ```
You will be dropped into a bash terminal as the aegir user, in the root folder,
so change to your home directory with
cd if you need to.
``` aegir@aegir:/$ cd aegir@aegir:$ drush @hostmaster uli ```
Remember, the home directory for the
aegir user is mapped to
on the docker host (your computer). Feel free to download or edit anything
into that folder.
- Running Tests
We have behat tests you should run if you start to work on Aegir.
Drop into bash, cd into the tests folder, run
``` docker exec -ti aegir_hostmaster_1 bash aegir@aegir:/$ cd aegir@aegir:~$ cd tests aegir@aegir:~/tests$ composer install ```
Then bin/behat to run the tests:
``` aegir@aegir:~/tests$ bin/behat ```
When working on the Dockerfile, docker-compose file, and then aegir itself it can get confusing and repetitive to rebuild your containers. You can use the
opendir(/var/aegir/.drush): failed to open dir: Permission denied
If you receive error messages like this, it's likely because you have SELinux setup.
To fix, run the following command:
chcon -Rt svirt_sandbox_file_t aegir-home