• Stars
    star
    451
  • Rank 94,628 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 12 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RMT is a handy tool to help releasing new version of your software

RMT - Release Management Tool

Build Status Latest Stable Version Total Downloads License

RMT is a handy tool to help releasing new versions of your software. You can define the type of version generator you want to use (e.g. semantic versioning), where you want to store the version (e.g. in a changelog file or as a VCS tag) and a list of actions that should be executed before or after the release of a new version.

Installation

Option 1: As a development dependency of your project

In order to use RMT in your project you should use Composer to install it as a dev-dependency. Just go to your project's root directory and execute:

composer require --dev liip/rmt

Then you must initialize RMT by running the following command:

php vendor/liip/rmt/command.php init

This command will create a .rmt.yml config file and a RMT executable script in your project's root folder. You can now start using RMT by executing:

./RMT

Once there, your best option is to pick one of the configuration examples below and adapt it to your needs.

If you are using a versioning tool, we recommend to add both Composer files (composer.json and composer.lock), the RMT configuration file(.rmt.yml) and the RMT executable script to it. The vendor directory should be ignored as it is populated when running composer install.

Option 2: As a global Composer installation

You can add RMT to your global composer.json and have it available globally for all your projects. Therefor just run the following command:

composer global require liip/rmt

Make sure you have ~/.composer/vendor/bin/ in your $PATH.

Option 3: As a Phar file

RMT can be installed through phar-composer, which needs to be installed therefor. This useful tool allows you to create runnable Phar files from Composer packages.

If you have phar-composer installed, you can run:

sudo phar-composer install liip/RMT

and have phar-composer build and install the Phar file to your $PATH, which then allows you to run it simply as rmt from the command line or you can run

phar-composer build liip/RMT

and copy the resulting Phar file manually to where you need it (either make the Phar file executable via chmod +x rmt.phar and execute it directly ./rmt.phar or run it by invoking it through PHP via php rmt.phar.

For the usage substitute RMT with whatever variant you have decided to use.

Option 4: As Drifter role

If your are using https://github.com/liip/drifter for your project, you just need three step

  • Activate the rmt role
  • Re-run the provisionning vagrant provision
  • Init RMT for your project php /home/vagrant/.config/composer/vendor/liip/rmt/RMT

Usage

Using RMT is very straightforward, just run the command:

./RMT release

RMT will then execute the following tasks:

  1. Execute the prerequisites checks
  2. Ask the user to answers potentials questions
  3. Execute the pre-release actions
  4. Release
    • Generate a new version number
    • Persist the new version number
  5. Execute the post-release actions

Here is an example output:

screenshot

Additional commands

The release command provides the main behavior of the tool, additional some extra commands are available:

  • current will show your project current version number (alias version)
  • changes display the changes that will be incorporated in the next release
  • config display the current config (already merged)
  • init create (or reset) the .rmt.yml config file

Configuration

All RMT configurations have to be done in .rmt.yml. The file is divided in six root elements:

  • vcs: The type of VCS you are using, can be git, svn or none
    • For git VCS you can use the two following options sign-tag and sign-commit if you want to GPG sign your release
  • prerequisites: A list [] of prerequisites that must be matched before starting the release process
  • pre-release-actions: A list [] of actions that will be executed before the release process
  • version-generator: The generator to use to create a new version (mandatory)
  • version-persister: The persister to use to store the versions (mandatory)
  • post-release-actions: A list [] of actions that will be executed after the release

All entries of this config work the same. You have to specify the class you want to handle the action. Example:

version-generator: "simple"`
version-persister:
   vcs-tag:
       tag-prefix: "v_"

RMT also support JSON configs, but we recommend using YAML.

Branch specific config

Sometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the master branch. To do so, you have to place your default config into a root element named _default, then you can override parts of this default config for the branch master. Example:

_default:
    version-generator: "simple"
    version-persister: "vcs-tag"
master:
    pre-release-actions: [changelog-update]

You can use the command RMT config to see the merge result between _default and your current branch.

Version generator

Build-in version number generation strategies.

  • simple: This generator is doing a simple increment (1,2,3...)

  • semantic: A generator which implements Semantic versioning

    • Option allow-label (boolean): To allow adding a label on a version (such as -beta, -rcXX) (default: false)
    • Option type: to force the version type
    • Option label: to force the label

    The two forced option could be very useful if you decide that a given branch is dedicated to the next beta of a given version. So just force the label to beta and all release are going to be beta increments.

Version persister

Class in charge of saving/retrieving the version number.

  • vcs-tag: Save the version as a VCS tag

    • Option tag-pattern: Allow to provide a regex that all tag must match. This allow for example to release a version 1.X.X in a specific branch and to release a 2.X.X in a separate branch
    • Option tag-prefix: Allow to prefix all VCS tag with a string. You can have a numeric versionning but generation tags such as v_2.3.4. As a bonus you can use a specific placeholder: {branch-name} that will automatically inject the current branch name in the tag. So use, simple generation and tag-prefix: "{branch-name}_" and it will generate tag like featureXY_1, featureXY_2, etc...
  • changelog: Save the version in the changelog file

    • Option location: Changelog file name an location (default: CHANGELOG)

Prerequisite actions

Prerequisite actions are executed before the interactive part.

  • working-copy-check: check that you don't have any VCS local changes
    • Option allow-ignore: allow the user to skip the check when doing a release with --ignore-check
  • display-last-changes: display your last changes
  • tests-check: run the project test suite
    • Option command: command to run (default: phpunit)
    • Option timeout: the number of seconds after which the command times out (default: 60.0)
    • Option expected_exit_code: expected return code (default: 0)
  • composer-json-check: run a validate on the composer.json
    • Option composer: how to run composer (default: php composer.phar)
  • composer-stability-check: will check if the composer.json is set to the right minimum-stability
    • Option stability: the stability that should be set in the minimum-stability field (default: stable)
  • composer-security-check: run the composer.lock against https://github.com/fabpot/local-php-security-checker to check for known vulnerabilities in the dependencies. ⚠️ The local-php-security-checker binary must be installed globally.
  • composer-dependency-stability-check: test if only allowed dependencies are using development versions
    • Option ignore-require and ignore-require-dev: don't check dependencies in require or require-dev section
    • Option whitelist: allow specific dependencies to use development version
  • command: Execute a system command
    • Option cmd The command to execute
    • Option live_output boolean, do we display the command output? (default: true)
    • Option timeout integer, limits the time for the command. (default: 600)
    • Option stop_on_error boolean, do we break the release process on error? (default: true)

Actions

Actions can be used for pre or post release parts.

  • changelog-update: Update a changelog file. This action is further configured to use a specific formatter.
    • Option format: simple, semantic, markdown or addTop (default: simple)
    • Option file: path from .rmt.yml to changelog file (default: CHANGELOG)
    • Option dump-commits: write all commit messages since the last release into the changelog file (default: false)
    • Option insert-at: only for addTop formatter: Number of lines to skip from the top of the changelog file before adding the release number (default: 0)
    • Option exclude-merge-commits: Exclude merge commits from the changelog (default: false)
  • vcs-commit: commit all files of the working copy (only use it with the working-copy-check prerequisite)
    • Option commit-message: specify a custom commit message. %version% will be replaced by the current / next version strings.
  • vcs-tag: Tag the last commit
  • vcs-publish: Publish the changes (commits and tags)
  • composer-update: Update the version number in a composer file (note that when using packagist.org, it is recommended to not have a tag in composer.json as the version is handle by version control tags)
  • files-update: Update the version in one or multiple files. For each file to update, please provide an array with
    • Option file: path to the file to update
    • Option pattern: optional, use to specify the string replacement pattern in your file. For example: const VERSION = '%version%';
  • build-phar-package: Builds a Phar package of the current project whose filename depends on the 'package-name' option and the deployed version: [package-name]-[version].phar
    • Option package-name: the name of the generate package
    • Option destination: the destination directory to build the package into. If prefixed with a slash, is considered absolute, otherwise relative to the project root.
    • Option excluded-paths: a regex of excluded paths, directly passed to the Phar::buildFromDirectory method. Ex: /^(?!.*cookbooks|.*\.vagrant|.*\.idea).*$/im
    • Option metadata: an array of metadata describing the package. Ex author, project. Note: the release version is added by default but can be overridden here.
    • Option default-stub-cli: the default stub for CLI usage of the package.
    • Option default-stub-web: the default stub for web application usage of the package.
  • command: Execute a system command
    • Option cmd The command to execute
    • Option live_output boolean, do we display the command output? (default: true)
    • Option timeout integer, limits the time for the command. (default: 600)
    • Option stop_on_error boolean, do we break the release process on error? (default: true)
  • update-version-class: Update the version constant in a class file. DEPRECATED, use files-update instead
    • Option class: path to class to be updated, or fully qualified class name of the class containing the version constant
    • Option pattern: optional, use to specify the string replacement pattern in your version class. %version% will be replaced by the current / next version strings. For example you could use const VERSION = '%version%';. If you do not specify this option, every occurrence of the version string in the file will be replaced.

Extend it

RMT is providing some existing actions, generators, and persisters. If needed you can add your own by creating a PHP script in your project, and referencing it in the configuration via it's relative path:

version-generator: "bin/myOwnGenerator.php"

Example with injected parameters:

version-persister:
    name: "bin/myOwnGenerator.php"
    parameter1: value1

As an example, you can look at the script /bin/UpdateApplicationVersionCurrentVersion.php configured here.

WARNING: As the key name is used to define the name of the object, you cannot have a parameter named name.

Configuration examples

Most of the time, it will be easier for you to pick up an example below and adapt it to your needs.

No VCS, changelog updater only

version-generator: semantic
version-persister: changelog

Using Git tags, simple versioning and prerequisites

vcs: git
version-generator: simple
version-persister: vcs-tag
prerequisites: [working-copy-check, display-last-changes]

Using Git tags, simple versioning and composer-prerequisites

vcs: git
version-generator: simple
version-persister: vcs-tag
prerequisites:
    - composer-json-check
    - composer-stability-check:
        stability: beta
    - composer-dependency-stability-check:
        whitelist:
            - [symfony/console]
            - [phpunit/phpunit, require-dev]

Using Git tags, simple versioning and prerequisites, and gpg sign commit and tags

vcs: 
  name: git
  sign-tag: true
  sign-commit: true
version-generator: simple
version-persister: vcs-tag
prerequisites: [working-copy-check, display-last-changes]

Using Git tags with prefix, semantic versioning, updating two files and pushing automatically

vcs: git
version-generator: semantic
version-persister:
    name: vcs-tag
    tag-prefix : "v_"
pre-release-actions:
    files-update:
        - [config.yml]
        - [app.ini, 'dynamic-version: %version%']
post-release-actions: [vcs-publish]

Using semantic versioning on master and simple versioning on topic branches, markdown formatting for changelog

_default:
    vcs: git
    prerequisites: [working-copy-check]
    version-generator: simple
    version-persister:
        name: vcs-tag
        tag-prefix: "{branch-name}_"
    post-release-actions: [vcs-publish]

# This entry allow to override some parameters for the master branch
master:
    prerequisites: [working-copy-check, display-last-changes]
    pre-release-actions:
        changelog-update:
            format: markdown
            file: CHANGELOG.md
            dump-commits: true
        update-version-class:
            class: Doctrine\ODM\PHPCR\Version
            pattern: const VERSION = '%version%';
        vcs-commit: ~
    version-generator: semantic
    version-persister: vcs-tag

Contributing

If you would like to help, by submitting one of your action scripts, generators, or persisters. Or just by reporting a bug just go to the project page https://github.com/liip/RMT.

If you provide a PR, try to associate it some unit or functional tests. See next section

Tests

Requirements

To be able to run the tests locally, you need:

  • phpunit
  • git
  • mercurial

You can install all of them with Brew:

> brew install phpunit git hg

The tests are also testing the creation of the RMT phar. So you have to allow this in your php.ini, by uncommenting this line:

phar.readonly = Off

Finally, to run the tests, just launch PHPUnit

> phpunit

Functional tests

The functional tests are fully functional temporary RMT setup. Each time you run functional test, it creates a temporary folder with a RMT project. Then the test suite is running RMT commands on it, and check the results. That's why you need to have Git and Mercurial installed.

Debug

To debug RMT functional tests, the best is to go into this temporary folder and manually explore the project. To do so, just add a small $this->manualDebug(); into the test suite. This will break the test with the following output:

MANUAL DEBUG Go to:
> cd /private/var/folders/hl/gnj5dcj55gbc93pcgrjxbb0w0000gn/T/ceN2Mf

Then you just have to go into the mentioned folder and start debugging

Authors

License

RMT is licensed under the MIT License. See the LICENSE file for details.

More Repositories

1

LiipImagineBundle

Symfony Bundle to assist in imagine manipulation using the imagine library
PHP
1,654
star
2

LiipFunctionalTestBundle

Some helper classes for writing functional tests in Symfony
PHP
639
star
3

TheA11yMachine

The A11y Machine is an automated accessibility testing tool which crawls and tests pages of any web application to produce detailed reports.
JavaScript
618
star
4

LiipMonitorBundle

Integrates the LiipMonitor library into Symfony
PHP
469
star
5

php-osx

DEPRECATED: See https://php-osx.liip.ch/ for details. The uploader and website for the PHP 5 package for OS X 10.6 built with https://github.com/liip/build-entropy-php
PHP
329
star
6

LiipThemeBundle

Provides theming support for Symfony bundles
PHP
291
star
7

bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress
PHP
277
star
8

sheriff

Conditional marshalling for Go
Go
243
star
9

LiipHelloBundle

[DEPRECATED] Alternative Hello World Bundle for Symfony2 using several FriendsOfSymfony Bundles
PHP
201
star
10

LiipTestFixturesBundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications
PHP
162
star
11

serializer

A PHP serializer that generates PHP code for maximum performance
PHP
128
star
12

LiipCacheControlBundle

DEPRECATED! This bundle is superseded by FOSHttpCacheBundle. A migration guide is in the README of LiipCacheControlBundle
PHP
108
star
13

kanbasu

A lightweight CSS framework written in Sass.
SCSS
92
star
14

LiipDoctrineCacheBundle

[DEPRECATED] use https://github.com/doctrine/DoctrineCacheBundle
PHP
71
star
15

LiipMagentoBundle

[DEPRECATED] Proof of concept for integrating Magento into Symfony2 applications
PHP
67
star
16

LiipMonitor

Deprecated: Generic PHP library to run application health checks
PHP
61
star
17

Radios

An mp3 streaming Application for the iPhone and the iPad
Objective-C
59
star
18

drifter

Drifter is a framework to help provision developer boxes using Ansible and Vagrant
HTML
57
star
19

chusho

A library of bare & accessible UI components and tools for Vue.js 3
TypeScript
54
star
20

LiipUrlAutoConverterBundle

[DEPRECATED] This bundle will add a Twig Extension for templates with a new filter for automatically converting urls and emails in a string to html links
PHP
50
star
21

SEO-keywords-generator

Keyword generator providing multiple commands in order to manage keyphrases for SEO monitoring tools such as AWRCloud
Python
50
star
22

packaging

deb and rpm packaging solution for php projects
PHP
49
star
23

extend-block-example-wp-plugin

Example how to extend an existing Gutenberg block in WordPress
JavaScript
48
star
24

styleguide-starterkit

A starterkit to create styleguides with Fractal and Webpack.
JavaScript
37
star
25

LiipSearchBundle

[DEPRECATED] Google XML API for searching is discontinued
PHP
35
star
26

LiipProcessManager

Provides a simple locking mechanism based on UNIX process id's written to a "PID file".
PHP
33
star
27

LiipVieBundle

[DEPRECATED] in favor of SymfonyCmfCreateBundle
JavaScript
32
star
28

viewmodel-savedstate-helpers

Easily save your Android ViewModel state with Kotlin
Kotlin
32
star
29

fanci

Fanci is a lightweight node module to extract, rename and transform JSON based on a template
JavaScript
30
star
30

LiipContainerWrapperBundle

[DEPRECATED] Don't screw DI by just injecting everything.
PHP
29
star
31

LiipCodeBundle

[DEPRECATED] A set of Symfony2 console commands to help developers deal with the various ways of identifying classes, templates, bundles, services, etc. Provides console commands to find their file path or class, as well as editor shortcuts.
PHP
26
star
32

LiipTranslationBundle

Tools for translation management
PHP
25
star
33

guess-the-liiper-ios

Guess the Liiper iOS version made with React Native
JavaScript
25
star
34

dockerbox

A small vagrant based docker box for using docker on OS X and Windows (based on https://github.com/phusion/open-vagrant-boxes)
Shell
25
star
35

packager

Lightweight package installer written in python
Python
22
star
36

LiipXsltBundle

[DEPRECATED] Renderer for XSLT templates in Symfony2 (not actively maintained)
PHP
20
star
37

LiipHyphenatorBundle

[Deprecated] Adds support to Symfony for hyphenating long words using the Org_Heigl_Hyphenator library.
PHP
20
star
38

wrench

wrench: a CLI tool for Passbolt
Python
19
star
39

SweetPreferences

Add syntactic sugar to your Android SharedPreferences
Kotlin
19
star
40

barcode.js

POC for a JavaScript barcode reader, blog post to follow
JavaScript
19
star
41

presence

Presence shows you the availabilities of your set up team by analyzing their Google Calendar
PHP
18
star
42

django-ansible

Deploy Django projects generated by liip/django-template with Ansible
Python
18
star
43

animate-blocks-wordpress-plugin

Animate Gutenberg blocks plugin for WordPress
JavaScript
18
star
44

django-template

Project template for Django projects
Python
17
star
45

metadata-parser

A PHP metadata parser for domain models
PHP
16
star
46

commit-hook-email

GitLab and Github Commit Email Hook
PHP
16
star
47

DataAggregator

[DEPRECATED] The data aggregator cumulates/filters information provided by one or more loader and routes them to one or more persistence layers.
PHP
16
star
48

magento-xhprof

[In Development] Profile Magento with XHProf
PHP
15
star
49

bund-drupal-starterkit

PHP
14
star
50

styleguide

Liip Web Styleguide
SCSS
14
star
51

roger-q

Tool to work with RabbitMQ queues, including commands to dump, deduplicate and publish messages
PHP
14
star
52

liip10yearsgame

Jump and run through Liip's 10 year history
JavaScript
13
star
53

SwissGovernmentChatbots

13
star
54

ckanext-ddi

CKAN extension for DDI, developed for the World Bank
Python
12
star
55

LiipSoapRecorderBundle

[DEPRECATED] Recorder/Player for SOAP communications
PHP
12
star
56

pontsun

The Liip docker local development orchestrator
12
star
57

LiipMultiplexBundle

[DEPRECATED] Symfony2 controller that allows calling multiple URL's in one request as well as JSON-ifying any controller
PHP
12
star
58

wp-tyk-dev-portal

A WordPress plugin that adds a developer portal for a Tyk API Gateway
PHP
12
star
59

LiipRokkaImagineBundle

integration between LiipImagineBundle and rokka.io
PHP
11
star
60

LiipKit

LiipKit regroups usefull classes/extensions used in many applications
Swift
11
star
61

LiipDrupalConnectorModule

An abstraction layer between the procedural world of Drupal and OOP.
PHP
11
star
62

serializer-jms-adapter

An adapter to make liip/serializer a drop-in replacement for jms/serializer
PHP
10
star
63

LiipFormTranslationChoiceBundle

[DEPRECATED] A Symfony2 bundle that provides a form widget and a validator that work with translation domains
PHP
10
star
64

packaging_demo

A demo project for the packaging solution at http://github.com/liip/packaging
PHP
9
star
65

LiipOneallBundle

[DEPRECATED] Symfony2 Bundle to integrate oneall.com
PHP
9
star
66

oc-blocks-theme

OctoberCMS theme that demonstrates the use of repeater groups to assemble static pages with customizable building blocks.
HTML
9
star
67

taxi-zebra

Zebra backend for Taxi
Python
8
star
68

niweaapp

The Tages-Anzeiger iPas App done in Niwea aka HTML5/CSS/JS
JavaScript
8
star
69

directus-utilities

Utility library for directus
TypeScript
8
star
70

frctl-twig

frctl-twig is an PHP Twig adapter for Fractal consisting of an NPM and a Composer package.
PHP
8
star
71

LiipFoxycartBundle

[DEPRECATED] Symfony Foxycart integration Bundle
PHP
8
star
72

discourse-multilingual-support

Provide some tools to have a better multilingual support on Discourse
Ruby
8
star
73

wrapper-block-example-wp-plugin

This is a WordPress plugin which shows how to create a wrapper block for Gutenberg.
JavaScript
7
star
74

e2e-tests-example-wp-plugin

Example how to write E2E tests for a Gutenberg block in WordPress
JavaScript
7
star
75

bower-lockfile-resolver

adds a missing feature of bower: a lockfile with all pacakages versions pinned
JavaScript
6
star
76

bund_ds

Vue
6
star
77

magerant

Magento Vagrant Setup (powered by Ansible)
Shell
6
star
78

jelapi

A Jelastic API Python library
Python
6
star
79

requests_gpgauthlib

A GPGAuth Client in Python
Python
5
star
80

ckan-vagrant

Vagrant based CKAN development environment
Ruby
5
star
81

LiipDrupalCrudAdminModule

The idea behind this module is to provide a most forward standard implementation to handle CRUD operations.
PHP
5
star
82

storybook-starterkit

A starterkit to create styleguides with Storybook and Twig.
JavaScript
5
star
83

directus-extension-gzip-hook

Directus extension gzip hook
TypeScript
4
star
84

liip-cookbooks

4
star
85

OpenLayersOfflineDemo

Demonstrate the offline storage with OpenLayers
JavaScript
4
star
86

fabliip

Set of Fabric functions to help deploying websites.
Python
4
star
87

Okapi

Okapi is a small framework for building web applications. It's built on PHP and XSLT and is fantastic for integration with REST web services.
PHP
4
star
88

html2kirby

Convert HTML markup to Kirby Markup
Python
4
star
89

liip-magento-shared

Liip Magento Shared
PHP
4
star
90

Backbone.localStorageSync

A caching layer between the client and server
JavaScript
4
star
91

Sodium.Xamarin

Xamarin compatible wrapper for libsodium
C#
3
star
92

LiipDrupalRegistryModule

This module provides an API to store key/value pairs of information.
PHP
3
star
93

magento-config-search

PHP
3
star
94

LiipTeraWurflBundle

[DEPRECATED] Symfony2 Bundle for the wurfl user agent. Not working! For reasons why check the url below ..
PHP
3
star
95

kanbasu-vue

Kanbasu components as Vue components
JavaScript
3
star
96

bund_drupal_starterkit_theme

CSS
3
star
97

smoke-detector

🚭 Allow us to be notified when there is smoke in the office.
Python
3
star
98

ushahidi-plugins-mobile

Mobile Accessible Version of Ushahidi
PHP
3
star
99

image-selector-example-wp-plugin

Example how to create an image selector for a Gutenberg block in WordPress
JavaScript
3
star
100

LiipDataAggregatorBundle

[DEPRECATED] The data aggregator cumulates information provided by a loader and routes them to a persistence layer
PHP
3
star