Posts

Setting up a drupal development env using docker image on mac os.

Image
I have been trying to try various ways in which i can make building and destroying development environments quickly and also make them as close to production as possible, i have tried using vagrant before till i was bitten by the docker bug. There is an official docker image for drupal 8 and drupal 8 on the docker hub, i have tried using them before it wasn't a great wow moment to be honest. Creating a drupal image using official drupal docker image form docker hub. The docker image did not have drush or drupal console so it was a bit disappointing. I searched and came across  https://hub.docker.com/r/iiiepe/nginx-drupal/ The guys have done a lot of work in using docker in their deployment workflow, so i wanted to give this a try. I could have used docker hub to pull the iiiepe image, but i wanted to see what is inside and if i need to make changes i could. I first created a folder in my docker subfolder, I normally keep docker images and my projects separate. I checked...

Creating a drupal 8 container from scratch.

I tried the official drupal container according to https://www.drupal.org/node/2538074 Was'nt happy with the result  so i thought build one from scratch. What i want my drupal container to do? 1. Use my codebase which will be outside the container 2. Able to install drupal - correct file system permissions. 3. Clean urls should work 4. Drush & drupal console installed 5. Xdebug installed 6. Xhprof or any other profiler installed (optional) Anything else?

Create a drupal development environment using docker.

Image
Currently at work i am using docker to streamline and speedup of development and deployment to testing and production, I am using symfony currently and our app is dockerised, i wanted to do the same for drupal based apps. I searched for a official drupal docker repo and i did find this.  https://www.drupal.org/node/2538074 Unfortunately there was very terse explanation but pretty much worked, i found a few hiccups along the way so wanted to share what i did. Pre-requisite: Install docker for your environment. Lots of details are available at  https://docs.docker.com/ explaing docker and installing docker for your environment. The docker repo holds the drupal container at  https://hub.docker.com/_/drupal/ , following the instructions this is how to create the drupal container: In order to use my code base we need to mount the volume with the -v directive as below, we do this in one command: docker run -v /$HOME/work/drupal8:/var/www/html -p 8080:80 --name my...

Use Symfony2 to create template/skeleton code

Image
Pre-requisite: A lamp environment, i will be using a vagrant lamp box (scotch-box) i created earlier. To understand Symfony2 there is nothing better than getting ones hands dirty. We will try to use doctrine to build models, create views using twig and maybe use a dash of frontend magic using backbone or something similar. For the test project I chose a sales bundle where we will make models for item, item type and sale. Using symfony2 command line to create a model. Because i have used vagrant scotch-box to provision my dev environment, i need to first make sure i do vagrant up to start the VM. then i do vagrant ssh this will take me to the ssh locate where you have symfony installed, in my case it is /var/www/public/sandbox and give the following command: php app/console generate:bundle pick a name any name....well not actually, we need to be following coding standards set out in the symfony guide to ensure we name our bundle like this Bundle, so in my case i didn'...

Installing sqlyog on Mac OS X Yosemite

I like to use sqlyog for my work with mysql, but only windows binaries are supplied on the google code site. Another option is to use sqlyog in wine, so to install wine a simpler option is to use Homebrew (http://brew.sh/). Installation for homebrew is quite straightforward, however you need to have installed the command line tools with xcode, if not please install that first. The installation instructions are already on the first page of the homebrew website, so i will not reproduce this, once brew is installed, install wine. brew install wine when i tried installing wine, brew asked me to install a dependency and nicely told me to do the following wine: XQuartz is required to install this formula. You can install with Homebrew Cask:   brew install Caskroom/cask/xquartz so i just did that, once this was completed i could complete installing wine. Now head over to https://code.google.com/p/sqlyog/wiki/Downloads and install the latest sqlyog, at ...

Installing Symfony2

Installation for Symfony was straight forward, using the new symfony installer. head over to symfony https://symfony.com/download and download the installer, installation instructions are included on the page. Remember we are using the vagrant box we installed earlier, start vagrant using vagrant up and you should then have a public folder under your scotch-box folder under vagrant. Install symfony under this folder.

Using Vagrant and Puppet to build a PHP/Lamp environment

Vagrant is a real help in creating developer environments and is widely used by many development teams due to its flexibility and ease of replicating environments. In order to get ready with Drupal 8, I wanted to get to know Symfony this is an attempt to do that and hopefully this will help me do just that and help others who stumble upon this site. The steps for creating a development environment is below, I am using a Mac OS X Yosemite, you can use your favourite OS : 1. Install vagrant using vagrantup.com 2. Install a provider I have used VirtualBox. 3. Initialise a Vagrant environment. Vagrant should work form any where on your computer because the installer would have added this to your executable paths, so lets create a new folder called 'vagrant' and run the following command vagrant init hashicorp/precise64 This creates the Vagrantfile which is the main configuration file for vagrant. Open the Vagrantfile in your favourite editor or maybe just vi it. s...