PHPackages                             kgaut/drupal-makefile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. kgaut/drupal-makefile

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

kgaut/drupal-makefile
=====================

Generic makefile rules to manage a drupal 8+ project

1.0.9(1y ago)211.4k↓50%GPL-3.0+Makefile

Since Jun 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kgaut/drupal-makefile)[ Packagist](https://packagist.org/packages/kgaut/drupal-makefile)[ Docs](https://github.com/kgaut/makefile)[ RSS](/packages/kgaut-drupal-makefile/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (23)Used By (0)

Makefile for Drupal
===================

[](#makefile-for-drupal)

Generic makefile rules to manage a drupal 8+ project

Installation
------------

[](#installation)

```
composer require kgaut/drupal-makefile
```

Edit your `.env` file and copy / paste the following vars, do not forget to change values according to your setup :

```
### --- PROD_ENV ----
# SSH User
PROD_USER=my_user
# SSH Host or IP
PROD_HOST=my_host
# SSH path to website (composer folder, not docroot) (ie : ~/website)
PROD_PATH=/path/to/website
# path to drush (ie : ~/website/vendor/bin/drush)
PROD_DRUSH=path/to/drush
# Prod url
PROD_URL=my-website.net
# Database folder containing dumps relative to PROD_PATH (ie: db)
PROD_DB_PATH=db

### --- PREPROD_ENV ----
# SSH User
PREPROD_USER=my_user_preprod
# SSH Host or IP
PREPROD_HOST=my_host_preprod
# SSH path to website (composer folder, not docroot) (ie : ~/website)
PREPROD_PATH=/path/to/website
# path to drush (ie : ~/website/vendor/bin/drush)
PREPROD_DRUSH=~/website/vendor/bin/drush
# preprod url
PREPROD_URL=preprod.my-website.net
# Database folder containing dumps relative to PREPROD_PATH (ie: db)
PREPROD_DB_PATH=db

### --- LOCAL_ENV ----
# Local path to drupal temporary files
LOCAL_TMP_PATH=./files/tmp
# Local path where to store database dumps
LOCAL_DB_PATH=db

```

Edit `Makefile` and add just after the line `include .env` (or after the line `include docker.mk`, depending on your docker4drupal version) :

```
include vendor/kgaut/drupal-makefile/drupal.mk

```

Mount your local dump folder to `/var/db` within your mariadb container.

Sample of mariadb service definition :

```
  mariadb:
    image: wodby/mariadb:$MARIADB_TAG
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 30s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD
    volumes:
      - ./$LOCAL_DB_PATH:/var/db

```

Availables rules
----------------

[](#availables-rules)

### db-dump

[](#db-dump)

`make db-dump`Create a local database gziped dump.

### db-preprod-dump

[](#db-preprod-dump)

`make db-preprod-dump`Create a preproduction database gziped dump.

### db-prod-dump

[](#db-prod-dump)

`make db-prod-dump`Create a production database gziped dump.

### db-prod-import

[](#db-prod-import)

`make db-prod-import`Empty local database, import the most recent database dump from production, rebuild caches, run database updates, import configuration and provide an authentification url as user 1.

### db-preprod-import

[](#db-preprod-import)

`make db-preprod-import`Empty local database, import the most recent database dump from preproduction, rebuild caches, run database updates, import configuration and provide an authentification url as user 1.

### db-prod-get

[](#db-prod-get)

`make db-prod-get`Download the most recent database dump from production.

### db-preprod-get

[](#db-preprod-get)

`make db-preprod-get`Download the most recent database dump from preproduction.

### db-import

[](#db-import)

`make db-preprod-get`Empty local database, import the most recent dump available localy, rebuild caches, run database updates, import configuration and provide an authentification url as user 1.

### db-post-import

[](#db-post-import)

`make db-preprod-get`Rebuild caches, run database updates, import configuration and provide an authentification url as user 1.

### db-empty

[](#db-empty)

`make db-empty`Empty local database.

### dd-tail

[](#dd-tail)

`make dd-tail`Tail the drupal-debug.txt files.

### watchdog

[](#watchdog)

`make watchdog`Tail the watchdog entries.

Note : for this command to works, you'll need to patch drush/drush by adding the following lines to the patches section of your composer file :

```
"drush/drush" : {
    "Adding --tail option to drush ws." : "https://github.com/kgaut/drush/commit/8b79fb395d344ae6f07300e87408db49d158b80b.diff"
},

```

For more informations :

### ssh-prod

[](#ssh-prod)

`make ssh-prod`Open a ssh connexion to production server.

### ssh-preprod

[](#ssh-preprod)

`make ssh-preprod`Open a ssh connexion to preproduction server.

### sapi

[](#sapi)

`make sapi`Rebuild Search API indexes

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~75 days

Recently: every ~169 days

Total

22

Last Release

580d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c8cc2314f3a86369098d1465b7144f6c4249e82d98c6f39fabb76bb97d396d?d=identicon)[kgaut](/maintainers/kgaut)

---

Top Contributors

[![kgaut](https://avatars.githubusercontent.com/u/736910?v=4)](https://github.com/kgaut "kgaut (45 commits)")

---

Tags

drupal

### Embed Badge

![Health badge](/badges/kgaut-drupal-makefile/health.svg)

```
[![Health](https://phpackages.com/badges/kgaut-drupal-makefile/health.svg)](https://phpackages.com/packages/kgaut-drupal-makefile)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.1k25.4M207](/packages/deployer-deployer)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[yousign/zdd-message-bundle

Assert Zero Downtime Deployment compliance for messages

28113.5k](/packages/yousign-zdd-message-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
