skipcheck

tm1cm · Walkthrough 3 of 5

Promote a change with git

You keep the model in git, make a change, and put on the next server exactly the files that change touched, deleted ones included. Here the change is to PriceCube's rules, with an old view removed.

  • A project with the model in it: Set up a project and get your model. This one has two environments, test and prod. Here both point at the same SData sample; yours are different servers.
  1. Commit the model as it is. A project is an ordinary git repository:

    Terminal

    git init -q && git add . && git commit -q -m "The model as it is on test"

    PowerShell

    git init -q; git add .; git commit -q -m "The model as it is on test"

    Nothing is left to commit: the log and credentials.yaml are in the scaffold's .gitignore.

    Terminal

    git status --short
  2. Make the change and commit it. Edit the files, or change the model on test and get it again. Here a line is added to a rule, and a view is deleted:

    Terminal

    echo "# Reviewed for the 2027 budget" >> data/rule/PriceCube.rule
    git rm -q data/view/SalesCube/Trace_simple.view
    git commit -q -am "Review PriceCube's rules, drop an old view"

    PowerShell

    Add-Content data/rule/PriceCube.rule "# Reviewed for the 2027 budget"
    git rm -q data/view/SalesCube/Trace_simple.view
    git commit -q -am "Review PriceCube's rules, drop an old view"
  3. Review it. The change is the files the commit touched, which is what a pull request shows a reviewer:

    Terminal

    git diff --name-only HEAD~1 -- data

    Output

    data/rule/PriceCube.rule
    data/view/SalesCube/Trace_simple.view
  4. Put exactly that commit on prod. Given files, tm1cm moves only their objects, whatever the filters in tm1cm.yaml say, and a file that's gone deletes its object:

    Terminal

    git diff -z --name-only HEAD~1 -- data | xargs -0 tm1cm --mode put --environment prod

    Output

    … 10 lines before
    2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin
    2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube
    2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation DELETE_VIEW: SalesCube:Trace_simple
    2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 11 at http://localhost:8011/api/v1/

    PowerShell

    tm1cm --mode put --environment prod (git diff --name-only HEAD~1 -- data)

    Output, as on macOS

    … 10 lines before
    2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin
    2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube
    2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation DELETE_VIEW: SalesCube:Trace_simple
    2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 11 at http://localhost:8011/api/v1/

    The rule is updated and the view deleted, and nothing else is touched.

  5. Put one file the same way:

    Terminal

    tm1cm --mode put --environment prod data/rule/PriceCube.rule

    Output

    … 10 lines before
    2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin
    2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube
    2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 13 at http://localhost:8011/api/v1/

tm1cm --mode put --environment prod, with no files, puts every object tm1cm.yaml includes: it compares the files with the server, and changes only what differs, deleting what the server has and the files don't. Run a get from that server into another folder first to see what it has, or use the interactive shell to look at the differences before doing them.

Run it from CI, so that a merged pull request is put on the server.

All the settings, filters, options and exit codes are in the reference.