GIT integration for TM1, part 2

Continuing the TM1 Git story, I’ll describe how to do a simple promotion of a few objects from one server to another.

This might be slightly different from overall Git-enabled philosophy of development, but it’s a direct replacement of how TM1 promotions work in most places I see now, i.e. promoting via copying the object files to a folder and carrying it over and it’s sometimes easier to start from doing the same thing with a new tool :)

Just to re-cap, you’d want to switch the tried and trusted ‘ stop the server / copy object files / start the server’ approach to Git promotions for following benefits:

  • Hot promotion — server doesn’t have to be restarted
  • Commit history and versioning

Overview

So let’s say we got 2 servers (I’m using Planning Sample from standard samples):

  • development
  • UAT

and we want to promote:

  • 1 rule
  • 1 process

from development to the UAT environment. We only want to promote the specified objects, not all changed objects between environments, because maybe there’s a lot of things happening in the development and a lot of changes that are not yet ready to be promoted. If you create a ‘per-environment’ branch in Git, comparing dev & testing branches allows you to identify changes.

Changing development and promoting to test environment

I’ll do the following for promotion:

  • Push changed objects from development to a new Git branch that will contain only the changed objects we’re moving between environments
  • Pull this branch to UAT environment — deployment done :)

I’ll be using PostMan for Rest API calls in the post instead of VSCode as in last one for no particular reason other than trying them both :) All the requests I’m running can be downloaded as a PostMan collection here, import it like this.

Ok, so here are our 2 servers:

  • I’m going to change a rule:
  • And I’m going to change another rule as well, but this one we will not promote:
  • A process:

To push the changes, I’d need to update the tm1project definition of the dev server to ‘exclude all objects’ and ‘include’ only the ones we’re promoting.

Pushing changes from Development to a new Git branch

Step by step promotion process:

  • I’m going to check what the current definition is with a Get call:
    It’s empty :)
  • And set it to new promotion definition, we’re Ignoring all objects and not ignoring (!) the ones we want to promote:
    {
    "Version": "1.0",
    "Ignore": [
    "Cubes/Views",
    "Cubes",
    "Dimensions",
    "Processes",
    "!Cubes('plan_Report')",
    "!Processes('plan_set_language')"
    ]
    }

  • Once it’s set, we do a Git Push to a new branch called change-XYZ from the base branch of dev and with a comment. Note how the source files reflect only the cube we included:

  • And execute the push plan.

  • Now I’ll see these objects on GitHub in a new branch:

Pulling changes from the new branch to UAT environment

Let’s do a pull on UAT side:

  • On UAT server, we’re going to do a GitPull from this branch, note how only the changed objects we had in the promotion are ‘updated’:
  • And execute GitPull for this Git Plan:
  • We’re done with promotion, UAT now has our changes