Giter Site home page Giter Site logo

drupal-blog's Introduction

Drupal Enterprise Boilerplate

This boilerplate is based on how we are currently working with Drupal at Taller. It may not be suitable for all kinds of projects and still needs lots of decoupling.

Dependencies

  • Docker
  • Docker-compose
  • Make

How to Use

Installing locally

  • Clone this repository
  • Remove .git folder
  • Now is the moment I suggest you to create your own Git repo and commit the boilerplate code, but it is really up to you
  • Find/replace the following variables (be carefull not to replace in this Readme):
APP_IMAGE_NAME The name of the Docker image for your site
DB_CONTAINER_NAME The name of the Docker container with the database
CI_ACQUIA_DIR The name of the folder to use in CI when deploying to Acquia. Should be different from the repository's name
ACQUIA_GIT_DOMAIN The domain of Acquia's Git repository, not the client domain
ACQUIA_GIT_REPO The Acquia's Git repository of your project
GIT_USER_EMAIL The email to be in the Git config while building in Semaphore and deploying to Acquia
GIT_USER_NAME The name to be in the Git config while building in Semaphore and deploying to Acquia
DRUPAL_SITE_NAME The name of your Drupal site
SERVER_ADMIN Apache server admin
  • Run make
  • If everything went right, you should be able to access your Drupal site in your localhost
  • Commit Drupal generated files

Coding Standards

PHP Code Sniffer

To mantain the Drupal Coding Standards in our custom code, we use the PHPCS lib with the Coder module.

To run it against your project, use the following command from Makefile:

make sniff

Some errors in the sniffer can be automatically corrected by running:

make beautify

The remaining errors you'll have to fix by yourself.

Deploying

Currently, the integration and delivery features of this boilerplate assume you are using Semaphore CI for building and hosting the environments in Acquia Cloud. Add more generic scripts that can be used to build in other CI systems or deploy in other servers is one of the many improvements we need to do.

  • In the setup of the Semaphore project, place the following command:
make ci-setup
  • In a job of this project, place the following commands:
git config --global core.autocrlf true
make ci-check
make ci-install
make ci-tests
make ci-install-prod
make ci-deploy
make ci-clean
docker volume ls -qf dangling=true | xargs -r docker volume rm
docker-cache snapshot

Debugging

If you want to use xdebug for debugging your code you just need to use the command below to enable it (or run the command again to disable):

make xdebug

Note: The command above must be executed within the container, in the folder where the Makefile is located.

You'll receive a message indicating if xdebug is ON or OFF.

Once xdebug is enabled, add breakpoints in the file you want to debug, go to the section Debug in your VSCode (the PHP Debug extension is required) and clicks on the button Start Debugging (this button it's located on the top, beside a Listen for XDebug text). Now, you just have to access the application in your favorite browser and you'll see your VSCode stopping in the breakpoints you added.

To run in Acquia

  • Clone the Acquia repository and add a symlink to docroot named web. This way, the autoload generated by composer will work properly in Acquia servers.

Features

  • Ready to use Drupal installation
  • Drush
  • Drupal Console
  • Node (with NVM)
  • Pre configured Acquia deploy scripts
  • Configured Git Hook to execute the code sniffer on pre-push.
  • cweagans/composer-patches as a dependency, so patch support is already in place

FYI

  • This boilerplate works best with Drupal ^8.5
  • By default, the latest Drupal 8 version is installed
  • You should always commit your composer.lock file

drupal-blog's People

Contributors

selhar avatar

Watchers

James Cloos 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.