Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
0d65b49
Update projects role to skip MySQL priviledge setup when db_user in p…
tassoskoutlas Jun 4, 2018
e7a5552
Increase VM memory
tassoskoutlas Jun 7, 2018
121a993
Enable NFS support with bindfs for directory mapping
tassoskoutlas Jun 7, 2018
998df0b
Enable Vagrantfile to read parameters from config.yml
tassoskoutlas Jun 7, 2018
e87e04b
Enable automatic git config
tassoskoutlas Jun 7, 2018
e13113f
Update README with inforation about git
tassoskoutlas Jun 7, 2018
f0024e6
Enabled auto configuration of known_hosts
tassoskoutlas Jun 7, 2018
5f8e94f
Clean up default.config.yml file
tassoskoutlas Jun 8, 2018
5a9e077
Update README
tassoskoutlas Jun 9, 2018
8416125
Remove use of reserved remote_user variable
tassoskoutlas Jun 9, 2018
5eeb7f2
Update PHP role for correct xdebug setup
tassoskoutlas Jun 9, 2018
4fecc69
Enable PHP FPM with xdebug
tassoskoutlas Jun 9, 2018
953048b
Update README with instructions to setup Eclipse with xdebug
tassoskoutlas Jun 9, 2018
4d4c8cc
Remove debug message from Projects role.
tassoskoutlas Jun 11, 2018
f7df02a
Removed apache role depedency from php role
tassoskoutlas Jun 11, 2018
91ac267
Add apache role depedency in projects role
tassoskoutlas Jun 11, 2018
97a0062
Enable auto discovery of PHP config directory
tassoskoutlas Jun 11, 2018
264b6b3
Cleaned up tasks for xdebug setup
tassoskoutlas Jun 11, 2018
14d5408
Removed depedencies from projects role
tassoskoutlas Jun 11, 2018
d2f80f4
Update to ubuntu 18.04 (ubuntu/bionic64)
tassoskoutlas Jun 11, 2018
86ab979
Merge pull request #2 from tassoskoutlas/update-ubuntu-to-bionic
tassoskoutlas Jun 11, 2018
11ce591
Update README for Ubuntu Bionic 18.04
tassoskoutlas Jun 11, 2018
b265758
Amend default.config.yml to use the vagrant user instead of ubuntu fo…
tassoskoutlas Jun 12, 2018
8317f8c
Add logic for project setup based on type or git repo
tassoskoutlas Jun 12, 2018
7bb1eaf
Update conditionals to ensure that projects with .git are passed stra…
tassoskoutlas Jun 12, 2018
a4972d8
Move composer to /usr/local/bin
tassoskoutlas Jun 13, 2018
84c1402
Comment out code for setting up projects because composer is buggy
tassoskoutlas Jun 13, 2018
c185198
Add motd
tassoskoutlas Jun 13, 2018
286689f
Update default.config.yml
tassoskoutlas Oct 19, 2018
ef9c219
Update devbox for Laravel support
tassoskoutlas Oct 19, 2018
f79f60d
Comment out ansible host_vars to use Vagrant autogenerated.
tassoskoutlas Nov 14, 2018
91ee40e
Add vagrant-vbguest plugin to keep OS guest additions consistent for …
tassoskoutlas Nov 19, 2018
044916a
Increase PHP memory limit to 1024
tassoskoutlas Nov 19, 2018
d192be7
Remove enablereuse ProxyPass parameter from vhost config
tassoskoutlas Nov 20, 2018
98acadd
Add htop utility
tassoskoutlas Nov 20, 2018
e21814c
Clean up project section of default.config.yml file
tassoskoutlas Jan 24, 2020
3ff5385
Add Adminer support for MySQL web administration
tassoskoutlas Jan 24, 2020
264c8e4
Remove with_items from apt module
tassoskoutlas Jan 24, 2020
0e2df33
Create databases only if a database entry exists in config.yml file
tassoskoutlas Jan 24, 2020
a32d0fe
Update uprade apt command to not issue warning
tassoskoutlas Jan 24, 2020
5fdff4a
Remove sudo from shell command during composer installation
tassoskoutlas Jan 24, 2020
500f3d8
Download Adminer only once
tassoskoutlas Jan 24, 2020
f62907b
Added Ansible 2.0 compatibility mode
tassoskoutlas Jan 24, 2020
5ef79cf
Remove warning from manual shell command invocation (composer & Adminer)
tassoskoutlas Jan 24, 2020
b8b630a
Repaired MOTD file
tassoskoutlas Jan 24, 2020
58032ad
Update custom motd filename with dashes instead of underscores
tassoskoutlas Jan 27, 2020
55b1802
Reformat heredoc for devbox motd
tassoskoutlas Jan 27, 2020
3196e49
Update playbook.yml to execute additional roles when the variable is …
tassoskoutlas Feb 4, 2020
0bb4e09
Add Mautic PHP extension depedencies
tassoskoutlas Feb 4, 2020
56d7cfc
Add NodeSource apt repository and key
tassoskoutlas Feb 4, 2020
28322c9
Add nodejs role with Mautic nodejs depedencies
tassoskoutlas Feb 4, 2020
bdf9e01
Add nodejs role to default.config.yml
tassoskoutlas Feb 4, 2020
5a06f15
Add bcmath Mautic depedency
tassoskoutlas Feb 4, 2020
2f92762
Pull out VM CPUs configuration into config file
tassoskoutlas Feb 4, 2020
1e9ba4d
Update PHP role for Mautic depedencies and performance
tassoskoutlas Feb 4, 2020
8f503a1
Merge pull request #3 from tassoskoutlas/install-mautic-requirements
tassoskoutlas Feb 4, 2020
fabfe0d
Update box reference to ubuntu/focal64
tassoskoutlas Oct 8, 2020
3e68e99
Close #14: Add all related node config in js role
tassoskoutlas Oct 8, 2020
3f19fa5
Update for Ubuntu 20.04 python3 substitution
tassoskoutlas Oct 8, 2020
e740da9
Merge pull request #15 from tassoskoutlas/update_to_ubuntu_2004_focal…
tassoskoutlas Oct 8, 2020
ddfd9f7
Update Ubuntu version to 20.04 LTS
tassoskoutlas Oct 8, 2020
ee6f818
Update PHP systemd definition to 7.4
tassoskoutlas Oct 8, 2020
a3a2f1f
Add zlib PHP extension
tassoskoutlas Oct 8, 2020
8e2585e
Removed php-zlib extension. It does not exist
tassoskoutlas Oct 10, 2020
3f85e98
Close #10 and Close #11
tassoskoutlas Oct 10, 2020
6cf2bc5
Close #16: Enable Ubuntu 20.04 official image to boot with vagrant 2.…
tassoskoutlas Oct 12, 2020
18448fa
Close #17: Add Drush support
tassoskoutlas Oct 13, 2020
1a3834d
Add directive to update composer to latest version
tassoskoutlas Oct 13, 2020
46ecea5
Close #18: Enable correct encoding and collation for created databases
tassoskoutlas Oct 13, 2020
5574e8d
Create drupal project codebase and setting files
tassoskoutlas Oct 13, 2020
a348b24
Add twig cache dir outside of NFS mount
tassoskoutlas Oct 13, 2020
bfe63f2
Fixed typo on twig cache dir, and ensure settings file are not recreated
tassoskoutlas Oct 14, 2020
5545b28
Create global variables for DB and source them in Apache
tassoskoutlas Oct 15, 2020
95b1c18
Enable drupal specific vhost template with environment variables
tassoskoutlas Oct 15, 2020
60353f4
Simplify database creation
tassoskoutlas Oct 15, 2020
a481f02
Automatically adjust Drupal's settings.php file
tassoskoutlas Oct 15, 2020
b44c037
Update README and config files with simplified instructions on projec…
tassoskoutlas Oct 15, 2020
f80ea09
Merge pull request #27 from tassoskoutlas/create_auto_drupal_install
tassoskoutlas Oct 16, 2020
d7817fb
Enable global environment variable in configuration
tassoskoutlas Oct 19, 2020
1df939f
Read environment variables from config and add them export them to en…
tassoskoutlas Oct 19, 2020
a7bf6b1
Source system enviroment variables to Apache envvars
tassoskoutlas Oct 19, 2020
9f1ab70
Add MySQL environment variables in .envvars
tassoskoutlas Oct 19, 2020
4558c93
Merge pull request #28 from tassoskoutlas/23_environment_variables
tassoskoutlas Oct 20, 2020
d750574
Update Drupal setup tasks to use desired version setting from config
tassoskoutlas Oct 20, 2020
4fabb81
Update default.config.yml with version string for project configuration
tassoskoutlas Oct 20, 2020
822faf7
Merge pull request #36 from tassoskoutlas/choose_drupal_version_to_in…
tassoskoutlas Oct 20, 2020
234a8ab
Adjust CHANGELOG.md for intendation
tassoskoutlas Oct 21, 2020
fbb2376
Correct typo in default.config.yml
tassoskoutlas Oct 21, 2020
7a38878
Move update apt into the beggining of the tasks
tassoskoutlas Oct 21, 2020
65b4f2e
Add version directive on default config project collection
tassoskoutlas Dec 14, 2020
74b7417
Update project setup task with comment on behaviour
tassoskoutlas Dec 14, 2020
f37f6dc
Remove sudo execution of composer self-update and add no-interaction …
tassoskoutlas Dec 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,55 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [2.2.0] - 2018-06-02

### Added
- Enabled private network settings
- Added configuration parameters for RSA key and github authentication
- Added vagrant-hostsupdater to set host's `/etc/hosts` file automatically

- Enabled private network settings
- Added configuration parameters for RSA key and github authentication
- Added vagrant-hostsupdater to set host's `/etc/hosts` file automatically

### Changed
- Changed php role to setup xdebug properly
- Changed the order and depedencies for apache and php roles
- Changed roles include in the playbook to be configurable in
- Changed `variables.yml` into `default.config.yml` and requires it to be copied
into `config.yml` for configuration of devbox
- Cleaned up `projects` variable

- Changed php role to setup xdebug properly
- Changed the order and depedencies for apache and php roles
- Changed roles include in the playbook to be configurable in
- Changed `variables.yml` into `default.config.yml` and requires it to be copied into `config.yml` for configuration of devbox
- Cleaned up `projects` variable

### Removed
- Removed temporarly enabed public network

- Removed temporarly enabed public network

## [2.1.0] - 2017-04-08

### Added
- New project role to handle project specific configuration
- Added `php-mbstring`
- Changed host with new Ansible variable syntax (> 2.0)
- Splits several YAML files into multiple and adds include statements to
individual `main.yml` files.

- New project role to handle project specific configuration
- Added `php-mbstring`
- Changed host with new Ansible variable syntax (> 2.0)
- Splits several YAML files into multiple and adds include statements to
individual `main.yml` files.

### Removed
- All configuration regarding projects (vhost and database) now resides with the
project role.

- All configuration regarding projects (vhost and database) now resides with the
project role.


## [2.0.0] - 2017-04-06

### Added
- Split the code into roles to be more manageable
- Adds CHANGELOG.md
- Tags release 1.0.0

- Split the code into roles to be more manageable
- Adds CHANGELOG.md
- Tags release 1.0.0

### Change
- Changes to ansible code syntax to be compatible with Ansible 2.2.1
- Changes to vagrant code syntax to be compatible with Vagrant 1.9.2
- Changes to vagrant to use Ubuntu Xenial 16.04

- Changes to ansible code syntax to be compatible with Ansible 2.2.1
- Changes to vagrant code syntax to be compatible with Vagrant 1.9.2
- Changes to vagrant to use Ubuntu Xenial 16.04

## [1.0.0] - 2015-08-24

### Added
- First release of code

- First release of code
205 changes: 101 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@

## Prerequisites

Devbox is a virtual devevelopment box for PHP and JavaScruipt development
Devbox is a virtual devevelopment box for PHP and JavaScript development
(including frameworks like Hugo, Symfony, WordPress and Drupal). Using the LAMP
stack provided you can start development without worrying about setting up your
computer as a development environment.

Devbox works with the following software:

- Vagrant >= 2.1.1
- Ansible >= 2.5
- VirtualBox
- Ubuntu Xenial 16.04
- Vagrant >= 2.2.10
- Ansible >= 2.9.6
- VirtualBox >= 6.1
- Ubuntu 20.04.1 LTS (Focal Fossa)

Devbox assumes that projects are developed with Git and requires a valid RSA key
from the local user which has been added in Github.

## Usage
## Install

Get devbox in your local machine:

Expand All @@ -38,69 +35,120 @@ environment:
vagrant up
```

You can login to the devbox with the following command:
## Basic usage

Login to devbox via SSH:

```
vagrant ssh
```

Happy coding! See below for configuration parameters.
For server changes in `config.yml` to take effect (e.g. add a new project) you
need to reprovision the environment:

```
vagrant provision
```

For virtual machine changes in `config.yml` to take effect (e.g. change the IP
address) you need to reload the configuration:

```
varnish reload
```

To access vagrant help:

```
vagrant help
```

## Configuration

The development environment can be customised via the `config.yml` file and the
variables contained within.
variables contained within.

### Configuring the VM

### Configuring a remote user
The virtual machine can be automatically configured via the variables in
**Machine** and **Folder mapping**. There are a number of options that allow
devbox to operate in various conditions.

The `remote_user` variable is used to set the user in the guest machine. The
default user in Vagrant is ubuntu and is reccomended to be left as is.
Folder mapping is achieved through NFS and bindfs to ensure that permisions are
set as expected. By default devbox is using 775 for directories and 644 for
files but behaviour can be overriden via `vm_folder_perm`.

### Configuring an RSA key
### Configuring Git, an RSA key and repositories

The `rsa_key` variable accepts as input a path from the host machine which
should resolve to an rsa key. It is used to authenticate in github and should be
added there prior to any git related operations in the development server.
The git configuration section contains variables that control the configuration
of Git and RSA keys. You can control how your local key is named in devbox so
you can add your development key indepedently of any other key already set.

The repositories configuration section contains a variable that is used to setup
the devbox `~/.ssh/config` file. Public key fingerprints can be used to validate
a connection to a remote server. Devbox automatically adds RSA fingerprints
in `~/.ssh/known_hosts` for the repositories declared.

### Configuring the server stack

The `config_roles` variable is used to customise the software stack configured
in the server. Comment out roles not needed.

### Configuring your projects
### Configuring projects

Vagrant allows to share directories between the host and the guest
systems. Devbox takes advantage of that feature to expose local projects which
can then be served through the LAMP stack.

Devbox expects a `projects` folder to exist in the same contains directory with
devbox:

```
.
├── devbox
└── projects
├── projectA
├── projectB
└── projectC
```

All directories contained withing projects will be exposed in `~/projects` in
the guest system.

For each project the following parameters can be set:

- domain (string): The URI to access project.
- docroot (string) The path of the project in devbox (user `{{ remote_user }}`
for indepedence
- db_user (string): The name of the database user to be used (root will be used
if empty)
- db_pass (string): The passwrd of the database user to be used (root will be used if empty)
- db_name (string): The database name to be used (if empty database creation is skipped)
- tech (string): The technology used in the project. Options include:
- hugo
- drupal
- symfony
Devbox is configurable to act as a standalone server hosting many projects or as
a development environment within a particular project. In either case it expects
that the folder containing the project or projects to be declared via
`projects_path`.

Each project is configured via the `projects` dictionary which accepts the
following parameters:

- **domain** (_string_): The URI to access project in the browser. The value is
automatically picked up and added to `/etc/hosts`.
- **docroot** (_string_) The path of the project in devbox. Can be any
location or combined with `projects_path`.
- **type** (_string_): The technology used in the project. Options include:
empty, hugo, drupal, wordpress, symfony.
- **database** (_string_): The database to be used. If empty database creation is skipped
- **repo** (_string_): a git path to checkout existing projects (uses path)

### Configuring Xdebug
Xdebug is enabled by default but you would need to set it up to your IDE. For
Eclipse you need to do the following:

1. Add a new server
2. Configure the new server with xdebug
3. Run the debugger

To setup a server go to `Window > Preferences > PHP > Servers` and add new. It
will ask for the following:

- Server tab
- Server name: add the individual project name
- Base url: the domain configured in project
- Document root: the location of the project on your host system
- Debbuger tab
- Debugger: xdebug
- Port: 9000

Next locate a file from your project in PHP Explorer, right click and select
`Debug as > Debug configurations`. It will ask for the following:

- Server tab
- PHP server: select the one you just created
- File: select the project index file
- Debuger tab
- Ensure XDebug is selected
- Enable 'Break At First Line'
- Click debug

This will launch a new window and a dialog box will appear informing about the
debug perspective in Eclipse. Accept and start debugging.

### Configuring additional software to be added

Expand All @@ -109,63 +157,12 @@ the main build. It is intended for smaller packages that do not require
customisation. If more software with significant customisation is needed
consider to open a pull request.

### Configuring Vagrant

Devbox offers a complete development environment out of the box. Vagrant is
controled through a `Vagrantfile` bunlded at the root of the repository. Within
that file there are parameters about:

- vagrant options about the base image, synchronising folders, network, etc
- virtual machine options about memory, etc
- provision options about ansible

Please follow through [vagrant documentation](https://www.vagrantup.com/docs/)
for a more thorough understanding of how it can be tweaked.

## Usage

### Using Vagrant

To connect to the VM use the following:

```
vagrant ssh
```

For changes in `config.yml` to take effect use:

```
vagrant provision
```

For changes in `Vagrantfile` to take effect vagrant configuration need to be roloaded:

```
varnish reload
```

Access help via:

```
vagrant help
```

### Accessing projects

Devbox listens to a private network with IP set to 10.10.10.10. Add an entry per
project in your `/etc/hosts` file:

```
10.10.10.10 PROJECT_DOMAIN
```

Then point your browser to the domain in port 8000:

```
http://PROJECT_DOMAIN
```
### Configuring additional tasks to be performed

You should see the homepage of your project.
The `additional_tasks` variable allows additional tasks to be performed after
the server has been provisioned. This can be used for some adhoc configuration
like downloading emacs configuration specific to the user or adding custom
aliases to `.bashrc`.

## Contributions

Expand Down
Loading