Git hook equivalent in RTC SCM
We have Gitlab configured like following:
- If anyone pushes their code, first sever side git hook (pre-receive) will trigger SonarQube Quality checks, if any error in code it rejects that push.
-
Also checks for file types, if some files like
.zip,.oor.classare present, the code gets rejected by the same server side hook. - Same for file size.
Are the above 3 validations possible in IBM RTC SCM before delivering the code to the server? How? I know
.jazzignore
, but I want specifically for server side rules.
We want to integrate RTC with sonarqube and bamboo. For every checkin automatically sonarqube test shall run and post successful test, auto build using bamboo should run.
One answer
In RTC, the closest analogue for a git "push" to server is "deliver", not "check-in".
So I would recommend doing the SonarQube check in a deliver pre-condition, not a checkin pre-condition.
Also, RTC pre-conditions hold open a database transaction, so you don't want to perform long-running operations in pre-conditions.
Instead, I would recommend have a "build" step that runs the SonarQube checks, and then sets a property on the file indicating whether it passed the SonarQube check.
Then your deliver pre-condition can just verify that this property is set on the file versions being delivered.