glue-agency / akeneo-glue-backoffice
Reports an Akeneo PIM to the Glue Dashboard after each deploy
Package info
github.com/glue-agency/akeneo-glue-backoffice
Type:symfony-bundle
pkg:composer/glue-agency/akeneo-glue-backoffice
Requires
- php: ^7.4|^8.0
- ext-curl: *
- ext-json: *
- symfony/config: ^4.4|^5.4|^6.4|^7.0
- symfony/console: ^4.4|^5.4|^6.4|^7.0
- symfony/dependency-injection: ^4.4|^5.4|^6.4|^7.0
- symfony/http-kernel: ^4.4|^5.4|^6.4|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Reports an Akeneo PIM to the Glue Dashboard after each deploy: the host it is served on, its Akeneo version and edition, its PHP version and the Composer packages it requires. Staging, dev and any other environment report too, but only where they answer. The Akeneo counterpart of glue-agency/craft-glue-backoffice, glue-agency/laravel-glue-backoffice and glue-agency/m2-glue-backoffice.
Installation
composer require glue-agency/akeneo-glue-backoffice
Symfony Flex adds the bundle to config/bundles.php on its own. Without Flex, or when it didn't, add it there yourself:
GlueAgency\Backoffice\GlueBackofficeBundle::class => ['all' => true],
Requires Akeneo 5.0 or later (Symfony 4.4 or later, PHP 7.4 or later) and PHP's curl extension, which Akeneo already requires. It installs and reports with Composer 1 as well as 2: some Akeneo 5.0 hosts still deploy with Composer 1.
Configuration
Read from the environment, so from the PIM's .env files. Akeneo's own .env is overwritten on upgrades: set them in .env.local, or in whichever env file the deploy shares between releases.
| Variable | |
|---|---|
GLUE_BACKOFFICE_TOKEN |
The install's own reporting token, issued on its page on the Dashboard. |
GLUE_BACKOFFICE_URL |
The Dashboard. Defaults to https://dashboard.glue.be/; only set it to try a report against another one. |
AKENEO_PIM_URL |
Akeneo's own: the address it puts in its links. Its host is what the PIM reports as its name. |
None of them has to be set, and none is read before the command runs: a PIM without them boots as before, and adding the token needs no cache clear.
Every host reports, and its deploy names the environment, as it names the repository: --environment (below), never Akeneo's APP_ENV. Akeneo ships with APP_ENV=prod, which staging and dev keep, so it cannot tell them from live. production (and prod or live) is live: its report is the whole one, which the Dashboard keeps as the install's Akeneo section. Any other environment only reports where it answers (AKENEO_PIM_URL), which the Dashboard lists beside live's. The command requires --environment, so no host is ever filed as live by default: a staging or dev host left unnamed would overwrite live's report. Upgrading the bundle therefore goes with naming every host's environment in deploy.php, in the same commit.
Reporting
bin/console glue:backoffice:report --repository-name=git@bitbucket.org:glue-team/project.git
--repository-name is optional: without it, the repository is left out of the report.
--environment names where this host runs: production (or prod, live) on live, staging, dev or any other name elsewhere. It is required, on a dry run too: left out or empty, the command refuses (No environment given: pass --environment=production on live, or this host's environment (staging, dev, …) anywhere else. Not reporting.) and exits with 1, which fails the deploy, as a refused report does.
--dry-run prints the report as JSON and sends nothing. It needs --environment but no token, keeps no uid and works in every environment, so it is the way to check what a PIM would report on any host, a developer's machine included.
Every report says which environment it came from and prints every value it sent, so the deploy log shows what the Dashboard was told:
Reported Akeneo 'staging-woodypim.hypernode.io' from the staging environment
URL 'https://staging-woodypim.hypernode.io'
Repository
Name 'git@bitbucket.org:glue-team/woody_pimup.git'
The command reports nothing, says why, and exits cleanly when no token is configured (Running in the staging environment, no Glue Dashboard token configured, not reporting.).
When the Dashboard refuses the report it prints every message it sent back, which tell the deployer what to do, and exits with 1. So does a Dashboard that can't be reached. Hooked in after deploy:symlink, that fails the deploy after the release is already live, as the Craft, Laravel and Magento reporters do.
What live reports:
- its URL,
AKENEO_PIM_URL, unless it is Akeneo's shipped localhost; - the host of
AKENEO_PIM_URLas the PIM's name, which the Dashboard shows as its PIM URL. A PIM still on Akeneo's shippedhttp://localhost:8080, or without a URL, is named after the machine instead; - Akeneo's version as Composer installed it, without the
vof its tags (7.0.88,2026.5), and its edition:EEwhenakeneo/pim-enterprise-devis installed,CEotherwise. Not Akeneo's ownversion.txt, which is missing before 7.0 and still read 7.0.85 on 2026.4; - the PHP version;
- the Composer packages the PIM requires directly — its root
composer.json'srequire, not its whole lock file, and notrequire-dev— with the installed version and description; Akeneo itself is among them asakeneo/pim-community-dev, and platform requirements (php,ext-*) are left out; - the repository, when given.
Any other environment reports its environment, the PIM's name and URL, and the repository, and nothing else: no version, uid, edition or packages. A Dashboard older than environments refuses such a report, which fails that host's deploy, rather than file it as live: update the Dashboard first.
Every value is cut to 255 characters, the most the Dashboard keeps.
Live's report carries a uid, a UUID made on the first report and kept in var/file_storage/glue-backoffice-uid. Akeneo keeps its catalog's files in var/file_storage, so every deploy shares it between releases and the uid stays the same from one deploy to the next. The Dashboard knows the PIM by its token, not by this uid: a PIM on a fresh file storage reports a new uid and its own token accepts it, and a uid that can't be written is no reason to fail a deploy.
Onboarding a PIM
The Dashboard has to know the Akeneo platform first (the release that adds it, Nov 2026). Before it, the Dashboard refuses the report with platform: The selected platform is invalid. and the deploy fails.
- On the Dashboard, use the install the brand already has: a PIM beside a Craft site or a Magento shop is one install, and all of them report with that install's one token. If it has none yet, add it by hand (platform Akeneo, its domain and current version).
- Switch the install to automatic and issue it a reporting token. A token can't be read back once issued: if another platform of the install already reports with it, issue a new one and give it to every platform.
- Give every host its
environmentindeploy.php(below) and deploy, then addGLUE_BACKOFFICE_TOKEN=<token>to each host's shared.env.local. - Require this package, hook the report into the deploy (below) and deploy. The PIM's first report fills in its Akeneo section and its packages.
A PIM that isn't deployed any more can't report: keep it as a manual install on the Dashboard, with its version typed there.
Deployer
From a Deployer 7 deploy.php:
host('woodypim.hypernode.io') ->set('labels', ['stage' => 'main']) ->set('environment', 'production'); host('staging.woodypim.hypernode.io') ->set('labels', ['stage' => 'staging']) ->set('environment', 'staging'); desc('Report to the Glue Dashboard'); task('glue:backoffice_report', function () { run('{{bin/php}} {{release_or_current_path}}/bin/console glue:backoffice:report --repository-name={{repository}} --environment={{environment}}'); }); after('deploy:symlink', 'glue:backoffice_report');
Each host names its own environment: its stage is a branch (main, master), not where it runs. A host without environment fails the task, and so the deploy, rather than report as live; don't give environment a default for every host either.
On Deployer 6, which has no {{release_or_current_path}}, run {{deploy_path}}/current/bin/console instead.
Testing
composer install
vendor/bin/phpunit