PHPackages                             fourkitchens/acquia-cloud-hooks - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fourkitchens/acquia-cloud-hooks

ActiveAcquia-cloud-hooks[Utility &amp; Helpers](/categories/utility)

fourkitchens/acquia-cloud-hooks
===============================

1.2.3(3mo ago)06.1k↑393.3%[2 issues](https://github.com/fourkitchens/acquia-cloud-hooks/issues)Shell

Since Aug 15Pushed 3mo ago9 watchersCompare

[ Source](https://github.com/fourkitchens/acquia-cloud-hooks)[ Packagist](https://packagist.org/packages/fourkitchens/acquia-cloud-hooks)[ RSS](/packages/fourkitchens-acquia-cloud-hooks/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (12)Used By (0)

Acquia Cloud Hooks
==================

[](#acquia-cloud-hooks)

Automated deployment hooks for Acquia Cloud Platform. These hooks run in response to code deployments and commits, handling Drupal deployment steps and Varnish cache clearing. The `post-code-deploy` hook also handles database/file synchronization.

How It Works
------------

[](#how-it-works)

Acquia Cloud Hooks are shell scripts that Acquia automatically executes when certain events occur in your environment. This package provides two hooks with different responsibilities:

HookTriggerScript`post-code-deploy`A tag or branch is deployed to an environment`common/post-code-deploy/build.sh``post-code-update`A commit is pushed to a branch currently deployed to an environment`common/post-code-update/build.sh`What Each Hook Does
-------------------

[](#what-each-hook-does)

Both hooks share these steps:

1. **Skip the RA environment** — the Release Agent environment is always bypassed.
2. **Check for a `skipbuild` file** — if present, exits immediately (see below).
3. **Authenticate** with the Acquia Cloud API via ACLI.
4. **Run deployment commands** via `helper/deploy.sh` (or a custom script if one exists).
5. **Clear Varnish caches** for all active domains in the environment.

### post-code-deploy only

[](#post-code-deploy-only)

In addition to the shared steps, `post-code-deploy` also **syncs data** from the canonical environment (default: `prod`):

- On non-canonical environments: copies the database and files from `prod` (runs concurrently).
- On the canonical environment: creates a database backup before deploying.

### Default Deploy Script

[](#default-deploy-script)

`helper/deploy.sh` runs the standard Drupal deployment sequence:

```
drush updatedb
drush cache-rebuild
drush config-import
drush config-import  (second pass)
drush cache-rebuild

```

### Custom Deploy Script

[](#custom-deploy-script)

To override the default deploy steps, create `scripts/custom/deploy.sh` in your project root. If this file exists, it will be called instead of `helper/deploy.sh`.

Setup
-----

[](#setup)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require fourkitchens/acquia-cloud-hooks
```

### 2. Configure API Credentials

[](#2-configure-api-credentials)

For each environment, create a `bashkeys.sh` file at the private file path:

```
/mnt/gfs/home/{site}/{environment}/nobackup/bashkeys.sh

```

The file must export your Acquia Cloud API credentials:

```
export ACQUIACLI_KEY="your-api-key"
export ACQUIACLI_SECRET="your-api-secret"
```

Generate API tokens at:

### 3. Configuration Variables

[](#3-configuration-variables)

**`common/post-code-deploy/build.sh`** (data sync variables):

VariableDefaultDescription`ACQUIA_CANONICAL_ENV``prod`Environment to sync database and files from`ACQUIA_DATABASE_NAME``$site`Database name to backup/copy`ACLI_MAX_TIMEOUT``600`Max seconds to wait for async API operations`ACLI_DELAY``15`Seconds between API status checksThese variables are not present in `post-code-update` as it does not perform data sync.

Skipping a Build
----------------

[](#skipping-a-build)

To disable automated deployment for a specific environment without removing the hook, create an empty file at:

```
/mnt/gfs/home/{site}/{environment}/nobackup/skipbuild

```

**Example:**

```
touch /mnt/gfs/home/mysite/dev/nobackup/skipbuild
```

When this file is detected, the hook exits immediately with a message:

```
The skip file was detected. You must run backups and build commands manually.

```

All automated steps are skipped — no database sync, no file sync, no Drush commands, no Varnish clearing. The hook exits with code `0` so the deployment itself still succeeds.

To re-enable automated builds, delete the file:

```
rm /mnt/gfs/home/mysite/dev/nobackup/skipbuild
```

> **When to use `skipbuild`:** This is useful when you need to manually control a deployment — for example, when migrating data, running a complex update that requires manual steps, or temporarily disabling automation on a specific environment without affecting others.

Dependencies
------------

[](#dependencies)

- [Acquia CLI (acli)](https://github.com/acquia/cli) — must be available at `vendor/bin/acli`
- [Drush](https://www.drush.org/) — must be available at `vendor/bin/drush`
- PHP — required for the helper scripts (`helper/*.php`)

Helper Scripts
--------------

[](#helper-scripts)

ScriptPurpose`helper/deploy.sh`Default Drupal deployment commands`helper/get-env-uuid.php`Retrieves an environment UUID via ACLI`helper/get-env-domains.php`Retrieves active domains for an environment`helper/wait-for-notification.php`Polls async Acquia API operations until completion

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance82

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% 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 ~220 days

Recently: every ~151 days

Total

7

Last Release

95d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0e61c319d853fdc35670358f4d441cfc1167a8e0fbce4f075ca707c916a3fe8?d=identicon)[fourkitchens](/maintainers/fourkitchens)

---

Top Contributors

[![generalredneck](https://avatars.githubusercontent.com/u/526491?v=4)](https://github.com/generalredneck "generalredneck (7 commits)")[![duncancm9](https://avatars.githubusercontent.com/u/8762630?v=4)](https://github.com/duncancm9 "duncancm9 (4 commits)")

### Embed Badge

![Health badge](/badges/fourkitchens-acquia-cloud-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/fourkitchens-acquia-cloud-hooks/health.svg)](https://phpackages.com/packages/fourkitchens-acquia-cloud-hooks)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5721.7k4](/packages/pfefferle-wordpress-activitypub)

PHPackages © 2026

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