Integration of gitlab with apigeecli

My usecase:
first we need to extract the service account from the DCP secret manager and then use apigeecli tool to generate an access token using the service account. This steps need to be added in before_script. Can anyone help me how to come up with the commands for the same?