background preloader

Team development with git

Facebook Twitter

Introduction | GitHub workflows for Drupal site development. My first Drupal 8 module: step-by-step example | Drupalwoo. Our custom module: contact form For my first Drupal 8 module, I'm going to create a custom 'Contact me' form. Not that it makes much sense considering that there is already a site-wide contact form shipping with Drupal core, but it's just to see how I can accomplish that in Drupal 8. Learning by doing is the way to go here, so download the latest version of Drupal 8 and play along! Getting Drupal to find and recognize our module Custom module folder structure In Drupal 8, the core and non-core modules are organized a little differently. Here's a visual representation /drupal /core... /modules -- this is where all the core modules are located, such as block, comment, etc /profiles /scripts /tests /themes /modules -- I create these two sub-folders myself to keep the contrib community modules and the ones I write myself separately /contrib /custom -- this is where we will place our new custom module So let's go ahead and create our module sub-folder under /modules/custom. .info file is now .info.yml <?

<? Use drush make to organize and maintain your project. How do you maintain your site code-base? Do you activate notification for updates, and when a new version comes out you simply FTP it to your server? How 2002. Or do you put the whole shebang inside a Git repo, pushing, merging and pulling the entire code-base regularly? Talking about overkill. And how do you keep track of applied patches? Luckily for us, there's a very elegant solution to the above (and many more) issues. What Is Drush If you don't know what Drush is, it stands for DRUpal SHell.

What Is Drush Make Drush ships with a make command. Drush make is what Drupal.org uses behind the scenes to build Drupal distributions. New: Now With YAML! With the latest version of Drush, following the move of Drupal 8 away from the INI format in favor of YAML, .make files can be (and should, from now on), be written using YAML. Note: as noted in the comments by s427, the new YAML format does not seem to work with Drush 6, at least on Windows (but probably it is not related to the OS).

Api: 2. Building a Drupal site with Git. Introduction This document is intended to outline a basic process of using Git in the context of a basic site building, testing and deployment process. While there are many possible approaches to fitting Git into this process, this particular set of procedures should work in most circumstances and contains many best practices for using Git in this manner. When applied properly and with some forethought, Git is a very powerful tool for helping to manage collaboration, configuration and code changes during the life cycle of a Drupal-based project.

Further documentation will be written to show how best to integrate other tools such as Drush into this process. This documentation assumes that the project will be following a basic 4-tier development environment model: developers work on most code locally, then push that code up through Development, Staging and Production environments. What can you manage with code? Creating the Central Repository (On your remote server) Locally Cloning Drupal. How to structure your Drupal modules directory | BeFused.

Ever feel like your Drupal code is becoming a disorganised mess? Most Drupal sites contain a decent number of contributed modules. Before long, you might write your own custom modules. And then you might generate Features, which are also modules. You end up with a heck of a lot of modules! Organising code into relevant buckets is critical, especially as you add more and more modules to your Drupal application. I have seen a variety of different approaches and strategies to organising code across all of the Drupal projects I have worked on and they all have their pros and cons. Where does the modules folder live?

Your modules directory could live in sites/all or sites/example.com, or both. |--sites| |-- all| | |-- modules| | |-- themes| |-- example.com| | |-- modules| | |-- themes In this setup, any modules and themes that can be used by any site reside in sites/all. If you run a single site on a single instance of Drupal, your structure will be simplified. Custom inside Contrib Wrapping up. Git/git-subtree.txt at master · git/git. WhiteHouse/buildmanager. Drushsubtree/README.md at master · WhiteHouse/drushsubtree.