How Do You Create a GitLab API Token?

Problem scenario
You have GitLab and Jenkins set up already.  You want to use a GitLab API token in Jenkins.  How do you create a GitLab API token?

1.  Log into the GitLab web UI.  (If you need directions on setting up GitLab, see this posting.)
2.  In the upper righthand corner, go to the circle icon next to an icon of a down arrow.  Click on it and go to "Profile" (which should appear underneath this icon).
3.  Click the pencil icon in the upper righthand portion of the screen.  When you hover over this icon, it should say "Edit."
4.  Find "Access Tokens" on the lefthand side of the screen.
5.  Type an arbitrary name in the "Name" field.
6.  Enter a date the token will expire.
7.  Check the radio boxes under "Scopes" as you see fit.
8.  Click "Create personal access token."
9.  Save the alphanumeric string under "Your New Personal Access Token".  You will not be able to see it again.

Leave a comment

Your email address will not be published. Required fields are marked *