drupal development workflow in details
TRANSCRIPT
Drupal Development workflow with Drupal, Gerrit, Ægir & Jenkins at EASME.
Pol Dellaiera - @drupol
June 2014
• One server hosted by DG-GROW • No versioning • Command-line upgrades through SSH • No deployment strategy • One production site • No development server • No Drupal profile
February 2015
s-eci-versn.easme.cec.eu.int • Gerrit: http://s-eci-versn.easme.cec.eu.int:8080/ • Jenkins: http://s-eci-versn.easme.cec.eu.int:8088/ • CGit: http://s-eci-versn.easme.cec.eu.int/cgit
s-eci-idev.easme.cec.eu.int • Aegir: http://aegir.s-eci-idev.easme.cec.eu.int/ • Development instances (∞)
s-eci-ipro.easme.cec.eu.int • Production instances (∞, currently 1)
• 3 servers • Easily extendable • Deployment strategies • No need of an SSH access • No need of local XAMP • As many Drupal instances as we want • Source(custom only)under versioning
Advantages
• Might take a lot of time to build a platform • Workflow depending on multiple computers
Disadvantages
The big picture
• Git • Gerrit
Development server
Production server
• Jenkins • Ægir
Versioning server
• XAMP
Gerrit
Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system. Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer. Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer. This functionality enables a more centralized usage of Git.
Jenkins
Jenkins, formerly known as "Hudson Labs", is the leading open-source continuous integration server. Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, Jenkins focuses on the following two jobs: Building/testing software projects continuously Monitoring executions of externally-run jobs Jenkins keeps those outputs and makes it easy for you to notice when something is wrong.
Ægir
The Ægir hosting system allows developers and site administrators to automate many of the common tasks associated with deploying and managing large websites. Ægir makes it easy to install, upgrade, deploy, and backup an entire network of Drupal sites. Support for multi-server site deployment and management allows for migrating sites between servers, including large sites spread across multiple web servers.
Workflow of a change, from the user to the server.
1.Writing the code locally, 2.Testing the code on a test instance by synchronizing with SSH the
local profile directory with the remote, 3.Committing and pushing the code on the Git server, 4.Jenkins starts building a new instance with only your changes, 5.Aegir is notified of that new platform, 6.Code review and merge the patch into the master branch.
s-eci-idev.easme.cec.eu.int • Drupal instances
1. Writing the code locally, 2. Testing the code on a test instance by synchronizing with SSH the
local profile directory with the remote,
s-eci-versn.easme.cec.eu.int • Git/Gerrit
$ git commit –am "Feature update for demonstration purpose." $ git push
3. Committing and pushing the code on the Git server,
$ git commit –am "Feature update for demonstration purpose." $ git push
Gerrit list the changes on the "open change" page.
Gerrit: details, online review and history of the change.
You can also review the change in your IDE.
4. Jenkins will trigger a build of the project with only your change. It will also report to Gerrit the result of that new build.
5. Ægir is notified of that new build and will verify it.
The platform has been verified and is now available.
Creation of a new site on that new platform.
A new "install" task has been created and will be processed soon.
Login to featureupdate.intranet.s-eci.easme.cec.eu.int
The site has been created and is now available.
6. Code review and merge the patch into the master branch.
Dependencies[]
•Composer: Dependency Manager for PHP •Phing: PHP project build system •Drush: Command line tool, "Drupal is the GUI for Drush"
Available platforms
Any Drupal distributions like: • COD • Commerce Kickstart • Commons • Openatrium • Openfed • Openpublic • Panopoly • Restaurant
Custom distribution:
• EASME Intranet • … more to come soon.
Going further
• Tests, Behat, reporting • Include FPFIS-Multisite as a platform
Random ideas
• Use git instead of rsync/SSH for synchronizing platforms ? (pull VS push)