Working With Composer and Git (Including Breakdance)

4 min read

Table of Contents

  1. Introduction
  2. Predeploy Script
  3. Troubleshooting


If you’re using a theme or plugin that requires Composer, it will likely result in a fatal error on activation. The popular Breakdance builder plugin uses Composer, and this article will walk you through how to use Composer with our Git integration using Breakdance as an example. The script provider can be adjusted to work with any plugin that requires Composer to function.

The Fatal Error

This following fatal error example is because when Breakdance is deployed via Git, you will need to use composer via the deploy scripts to install its dependencies. It looks as follows:

					This is the error that it is showing: Fatal error: Uncaught Error: Class 'Breakdance\Lib\Vendor\Whoops\Handler\Handler' not found in /var/www/ Stack trace: 
#0 /var/www/ require_once() 
#1 /var/www/ require_once('/var/www/exampl...') 
#2 /var/www/ require_once('/var/www/exampl...') 
#3 /var/www/ include_once('/var/www/exampl...') 
#4 /var/www/ require_once('/var/www/exampl...') 
#5 /var/www/ require_once('/var/www/exampl...') 
#6 /var/www/ require_once('/var/www/exampl...') 
#7 /var/www/ require('/var/www in /var/www/ on line 12

Predeploy Script

Our Git integration offers multiple deployment scripts that can be run before or after deploying your Git repositories. There are two predeploy scripts  and two postdeploy scripts, and these can can be added to the gpconfig directory inside your repo like so:

  1. .gpconfig/
  2. .gpconfig/
  3. .gpconfig/
  4. .gpconfig/

These are bash scripts, and we’ll be using the This will run prior to the Git pull. More information on all of these scripts can be found here:

An Overview of GridPane Git Options: Full and Hybrid Repo Types


This will work on both regular Git websites and multitenancy Git websites.

Breakdance Predeploy-server Script

Add the following to your

timeout 300 wget
timeout 300 chmod 755 $GP_GIT_RELEASE_PATH/wp-content/plugins/breakdance/plugin/vendor/bin/mozart
timeout 300 php composer.phar update -n --working-dir=$GP_GIT_RELEASE_PATH/wp-content/plugins/breakdance/plugin/
timeout 300 php composer.phar install -n --working-dir=$GP_GIT_RELEASE_PATH/wp-content/plugins/breakdance/plugin/


Push the changes, and Breakdance should now activate and operate as expected.


If you receive a shellcheck error after deploying your repo with the above script present, this will be due to a formatting issue. 

Error: /var/www/breakdance.test/releases/release-1678189338/.gpconfig/ failed a shellcheck

Running a Shellcheck

To confirm the reason for the shellcheck error, you can copy the given path and run the following:

shellcheck --exclude="SC2145,SC2068,SC2261,SC2086,SC2034" "/path/to/"

For example: 

shellcheck --exclude="SC2145,SC2068,SC2261,SC2086,SC2034" "/var/www/breakdance.test/releases/release-1678189338/.gpconfig/"

You’ll likely see the following:

^-- SC1017: Literal carriage return. Run script through tr -d '\r' .

The Fix

To fix the issue do the following:

  1. Copy and paste the above script into a simple text file
  2. Delete the contents of your predeploy-server script
  3. Copy and paste the contents out of your text file back into your predeploy-server script and save.

This should remove any unexpected formatting that’s causing the shellcheck failure.