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
So let’s say we got 2 servers (I’m using Planning Sample from standard samples):
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.
- 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:
- 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: