PHPackages                             hipex/deploy-configuration - 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. hipex/deploy-configuration

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

hipex/deploy-configuration
==========================

Hipex deploy image configuration files

2.4.2(5y ago)11255.3k—8%6[4 issues](https://github.com/HipexBV/DeployConfiguration/issues)OSL-3.0PHP

Since Oct 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/HipexBV/DeployConfiguration)[ Packagist](https://packagist.org/packages/hipex/deploy-configuration)[ RSS](/packages/hipex-deploy-configuration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (25)Used By (0)

Hipex Deploy Configuration
==========================

[](#hipex-deploy-configuration)

These documentation is the guide to painlessly setup an automated deploy on the [Hipex B.V.](https://www.hipex.io/)platform. The repository contains:

- Configuration objects
- Documentation

Whats inside?
-------------

[](#whats-inside)

- Deployer configuration hosts / tasks
- Hipex server setup
- Email / New Relic notification
- CloudFlare flush

Configuration
-------------

[](#configuration)

1. Composer `require hipex/deploy-configuration --dev` package. Only needed when you want to have autocomplete in your `deploy.php`file.
2. Copy the deploy templates inside the root of your project as `deploy.php`. You can find the template in [templates/deploy.php](./templates/deploy.php). As you can see a `$configuration` variable is assigned a instance of a `Configuration` class. This configuration object contains the whole deploy configuration and can be altered to your needs using getters/setters. Change configuration matching you use case, and refer to the documentation for other build in configurations and tasks.
3. Setup your CI server
    1. GitLab CI [templates/.gitlab-ci.yml](./templates/.gitlab-ci.yml).
    2. Bitbucket [templates/bitbucket-pipelines.yml](./templates/bitbucket-pipelines.yml).
4. For Magento 2 your first build will fail due to missing configuration. Login to the server and depending on your project file edit the `app/etc/env.php` or `app/etc/local.xml`. You will find these files in `~/domains//application/shared/`.

Build steps
-----------

[](#build-steps)

### 1. Build

[](#1-build)

Builds the application to prepare to run in a production environment.

You can define commands which needs to be executed during the build stage as follows:

`$configuration->addBuildCommand(new \HipexDeployConfiguration\Command\Build\Composer())`

This command will execute a `composer install` in your project folder install all project dependencies.

All possible commands can be found in the `HipexDeployConfiguration\Command\Build` namespace. Refer to the API docs for usage and options.

This repository contains a few application templates which specifies the common tasks and their order to get the application build correctly. See application templates for more information.

### 2. Deploy

[](#2-deploy)

Deploys the application which was build in the build stage to a given set of hosts.

First you need to define your environments / infrastructure.

```
$stageAcceptance = $configuration->addStage('acceptance', 'acceptance.mydomain.com', 'my_ssh_username');
$stageAcceptance->addServer('productionxxx.hipex.io', [
    ServerRole::APPLICATION_FIRST,
    ServerRole::APPLICATION,
    ServerRole::LOAD_BALANCER,
    ServerRole::VARNISH,
    ServerRole::REDIS,
]);

```

To set extra SSH options () for your server you can also provide these. For example:

```
$stage->addServer(
    'productionxxx.hipex.io',
    [ServerRole::APPLICATION],
    [],
    ['LogLevel' => 'verbose']

```

You can define commands which needs to be executed during the deploy stage as follows:

`$configuration->addDeployCommand(new \HipexDeployConfiguration\Command\Deploy\Magento2\CacheFlush())`

All possible commands can be found in the `HipexDeployConfiguration\Command\Deploy` namespace. Refer to the API docs for usage and options.

### 3. Provision Platform services / configurations

[](#3-provision-platform-services--configurations)

Optionally you can have some services and application configurations setup automatically from your git repository to the Hipex platform

For example you could maintain your cron configuration in your GIT repository and have it automatically deployed to particular servers.

```
$configuration
  ->addPlatformConfiguration(
    (new \HipexDeployConfiguration\PlatformConfiguration\CronConfiguration())
        ->setStage('production')
  )

```

Or setup a varnish instance

```
$configuration->addPlatformService(new \HipexDeployConfiguration\PlatformService\VarnishService())

```

For all possible tasks and configuration please refer to the API docs.

### 4. AfterDeploy tasks

[](#4-afterdeploy-tasks)

After deploy tasks are triggered after a succesfull deployment. For example notifications are available.

Usage: `$configuration->addAfterDeployTask(\HipexDeployConfiguration\AfterDeployTask\SlackWebhook())`

Application template
--------------------

[](#application-template)

We provide a few application template which define the common set of tasks to be executed for a specific application type. You could use those so you don't have to specify each task manually.

Available templates:

- Magento 1
- Magento 2

Example usage: `$configuration = new Magento2('git@git.foo.bar:magento-2/project.git', ['nl'], ['nl'])`

Required environment variables
------------------------------

[](#required-environment-variables)

Some specific environment variables are required to allow the deploy image access to the git repository or to be able to send out notifications.

### Required

[](#required)

- `SSH_PRIVATE_KEY` Unencrypted SSH key. The key needs to have access to: main git repository, private packages and the SSH user. Must be base64 encoded like this:

```
cat ~/.ssh/deploy_key | base64
```

ServerRoles and Stages
----------------------

[](#serverroles-and-stages)

Servers are defined with a given set of server roles

```
$stage = $configuration->addStage('production', 'www.mydomain.com', 'my_ssh_username');
$stage->addServer('production1.hipex.io', [
    ServerRole::APPLICATION,
]);
$stage->addServer('production2.hipex.io', [
    ServerRole::LOADBALANCER,
]);

```

Most of the configurations can be specifically set for a given serverrole and/or stage.

```
$nginxConfiguration = (new NginxConfiguration('/etc/nginx/production'))
  ->setServerRoles([ServerRole::APPLICATION])
  ->setStage('production')
$configuration->addPlatformConfiguration($nginxConfiguration)

```

This nginx configuration task will only be executed on production1, because this is the only one having server role `APPLICATION`

Most tasks are assigned logical server roles already, so no need to specify them in those cases.

Testing
-------

[](#testing)

To test your build &amp; deploy you can run your deploy locally.

First make sure you have all the required env variables setup using.

```
export SSH_PRIVATE_KEY=***
export DEPLOY_COMPOSER_AUTH=***
.... etc
```

Then start your build / deployment run command from root of the project.

*repeat -e for all env vars that are present during build*

```
docker run -it -e SSH_PRIVATE_KEY -e DEPLOY_COMPOSER_AUTH -v `pwd`:/build hipex/deploy hipex-deploy build -vvv
```

```
docker run -it -e SSH_PRIVATE_KEY -e DEPLOY_COMPOSER_AUTH -v `pwd`:/build hipex/deploy hipex-deploy deploy acceptance -vvv
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~45 days

Total

21

Last Release

1863d ago

Major Versions

1.2.2 → 2.0.02020-01-24

### Community

Maintainers

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

---

Top Contributors

[![Fgruntjes](https://avatars.githubusercontent.com/u/984466?v=4)](https://github.com/Fgruntjes "Fgruntjes (44 commits)")[![bramstroker](https://avatars.githubusercontent.com/u/2345875?v=4)](https://github.com/bramstroker "bramstroker (22 commits)")[![hipexio](https://avatars.githubusercontent.com/u/61146062?v=4)](https://github.com/hipexio "hipexio (12 commits)")[![pjbeens](https://avatars.githubusercontent.com/u/58983096?v=4)](https://github.com/pjbeens "pjbeens (9 commits)")[![pieterjohannes](https://avatars.githubusercontent.com/u/897571?v=4)](https://github.com/pieterjohannes "pieterjohannes (8 commits)")[![edwinljacobs](https://avatars.githubusercontent.com/u/11278380?v=4)](https://github.com/edwinljacobs "edwinljacobs (1 commits)")[![stijnbernards](https://avatars.githubusercontent.com/u/6909174?v=4)](https://github.com/stijnbernards "stijnbernards (1 commits)")[![thlassche](https://avatars.githubusercontent.com/u/2959888?v=4)](https://github.com/thlassche "thlassche (1 commits)")

### Embed Badge

![Health badge](/badges/hipex-deploy-configuration/health.svg)

```
[![Health](https://phpackages.com/badges/hipex-deploy-configuration/health.svg)](https://phpackages.com/packages/hipex-deploy-configuration)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.1k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

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