Giter VIP home page Giter VIP logo

development's Introduction

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 source code.

The included docker-compose.yml file will launch a running Aegir instance with the aegir-home directory mapped to /var/aegir in the container.

Got feedback? Suggested changes? Visit the repo at http://github.com/aegir-project/development.

Setup

  1. Install pre-requisites:
  • git
  • drush (locally, for building the stack).
  • docker. Docker for Mac Beta now works great.
  • docker-compose. Get the latest stable docker-compose, to ensure version 2 compose.yml file compatibility.
  1. Clone this repo and enter the 'development' folder:

    git clone http://github.com/aegir-project/development aegir
    cd aegir
    
  2. Run the prepare.sh script.

    bash prepare-host.sh
    

This script does the following:

  • Creates an "aegir-home" folder and opens permissions. This maps to /var/aegir in 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.
  1. Build your own local container.

NOTE: You only have to do this on Mac or on Linux only if your user is not UID & GID 1000.

In order to have seamless file sharing via volumes, you must build your own hostmaster container so that the container's UID and GID match your local user.

Find out your local user's UID and GID by running:

echo $UID
echo $GID

Then, take those values and run the command:

cd dockerfiles
docker build --build-arg AEGIR_UID=$UID --build-arg AEGIR_GID=$UID -t aegir/hostmaster:local
  1. Run 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

NOTE: The 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 something else:

```
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.

  1. 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 aegir-home on the docker host (your computer). Feel free to download or edit anything into that folder.

  1. 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 composer install

```
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
```

development's People

Contributors

jonpugh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.