Integrating sonarqube scanner into GitLab CI build pipeline

Hello everybody,
I want to integrate sonarqube into my GitLab CI build pipeline, but have no idea how to do it.
My question is if anybody has already done it and could share their code?

I currently use gradle to invoque sonarqube plugin from gitlab ci

Sonar gitlab plugin