Skip to content

Latest commit

 

History

History
89 lines (56 loc) · 3.74 KB

README.md

File metadata and controls

89 lines (56 loc) · 3.74 KB

Matomo-buildpack

Buildpack for running a Matomo instance on a Cloud Platform (Scalingo, Clever Cloud, Dokku, Heroku, etc.).

Matomo

Matomo is a free and open source web analytics application, designed to be an open and compliant with GDPR alternative to Google Analytics.

It is mainly a PHP + MySQL/MariaDB application (with a little bit of AngularJS).

History

This repository was originally designed to run Matomo and its Tag Manager System part on Scalingo (a french PaaS) platform.

Scalingo proposed an adapted application forked from the original Matomo project, installable with a "one-click deploy button".

There were some critical problems with this application:

  • the TMS part and some other important plugins were not installed/available
  • one could not pre-install and pre-activate Matomo purchased plugins ; thus, when the application restarted, installed plugins disappeared
  • the upgrade of the application was too dependant of Scalingo capacity and willness to merge the parent forked repository (that is not easy)

After a failing first attempt to improve the Scalingo/matomo repository, we decided to radically change our approach, and try a new one inspired by the Metabase buildpack.

All that we want is to run an already packaged software. It seems then better to strat from the released program than to package it ourselves. This is what this buildpack does.

Buildpack

This buildpack does the following, see bin/compile:

  • for a given release/tag, it downloads (via a cUrl command) the Matomo archive
  • unzip it
  • install some plugins, useful in a Cloud-based context
    • AdminCommands
    • DbCommands
    • LicenseKeyCommands

The first two plugins are custom ones, initially developed by the Scalingo Team 💪.

The version of the Matomo is defined in the bin/version file.

This buildpack follows the Cloud Native Buildpacks Specification. So it should be compatible with Scalingo, Dokku or Heroku.

Matomo releases

Each tag of this repository corresponds to a Matomo official release.

For example, tag v3.14.1 corresponds to Matomo#3.14.1.

Usage

In your Cloud application, define it as a multi-buildpacks application with matomo-buildpack and a php-based buildpack.

For example, for Scalingo, create a .buildpacks with:

https://github.com/1024pix/matomo-buildpack#v3.14.1
https://github.com/Scalingo/php-buildpack

You can find a production-ready application here.

Upgrading

Releasing a new version of this buildpack is as easy as running the command:

./upgrade-matomo-version <new_matomo_version> #ex: 3.14.2

This script does the following:

  • change the bin/version with the one given in parameter
  • declare and push a new tag named vX.Y.Z

Rebuild an already published version

If you need to re-publish a version for some reasons, simply make your changes, then run:

# some changes and git operations
git tag -d v3.14.1 && \
  git push --delete origin v3.14.1 && \
  git tag -a "v3.14.1" -m "Release v3.14.1" && \
  git push --tag

License

This software has been distributed under AGPL-3.0 license.