Difference between revisions of "Set Up Jenkins CLI User"

From Lingoport Wiki
Jump to: navigation, search
(Created page with "The first step in the configuration process is to create a Jenkins user which LingoBot can have access to. This is the primary mechanism that LingoBot uses to access the Lingo...")
 
(Get the jenkins_cli Jenkins Token and set up configuration)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The first step in the configuration process is to create a Jenkins user which LingoBot can have access to. This is the primary mechanism that LingoBot uses to access the Lingoport product suite, so it is very important that the configuration is done correctly.
+
This step of the configuration process creates a Jenkins user which the Jenkins CLI can have access to. The Jenkins CLI is used by the Lingoport Product Suite, so it is very important that the configuration is done correctly.
   
Please follow these instructions closely for the best results!
+
To avoid future issues, please follow these instructions closely for the best results.
   
== Create the Lingobot Jenkins user ==
+
== Create the Jenkins CLI user ==
 
[[File:manage_users.png|600px|center]]
 
   
 
* Navigate to your Lingoport Jenkins instance in a web browser.
 
* Navigate to your Lingoport Jenkins instance in a web browser.
  +
* Log in as the Administrator user. If there is not an administrator user, return to [[Lingoport_Suite_Installation#Set_up_the_Administrator_user_for_Jenkins|Set up the Administrator User for Jenkins]] to set it up before continuing.
* If an admin account has been configured, log in as the admin (otherwise no login is necessary) and click on the "'''Manage Jenkins'''" menu item on the left hand side of the window. (indicated by a small gear icon).
 
  +
* Select "'''Manage Jenkins'''"
** If you don't see this menu item, this means the current account does not have administrative privileges.
 
* Click on "'''Configure Global Security'''", and on this page make sure that the following boxes are checked:
 
** '''Enable''' security
 
** '''Jenkins' own user database'''
 
** One of the authorization methods (preferably "'''Matrix-based security'''").
 
*** IMPORTANT: If Matrix-based security is selected and no users have been configured yet, make sure that "Anonymous" has full privileges (all boxes next to Anonymous MUST be checked).
 
* Once this is done, click "'''Save'''" and return to the previous "Manage Jenkins" page.
 
 
[[File:create_user.png|600px|center]]
 
 
 
* Scroll down and click on "'''Manage Users'''", and on this page, select "'''Create User'''" from the left hand menu and fill out the form with the following information:
 
* Scroll down and click on "'''Manage Users'''", and on this page, select "'''Create User'''" from the left hand menu and fill out the form with the following information:
** Username: "lingobot"
+
** Username: "jenkins_cli"
 
** Password: Choose a secure password.
 
** Password: Choose a secure password.
 
** Confirm Password: Repeat your previous entry
 
** Confirm Password: Repeat your previous entry
** Full Name: "LingoBot"
+
** Full Name: "Jenkins CLI Automation"
** Email: "lingobot@lingoport.com"
+
** Email: "support@lingoport.com"
 
* Click "'''Create User'''"
 
* Click "'''Create User'''"
   
== Configure the security for the Lingobot user ==
+
== Configure the security for the jenkins_cli user ==
   
  +
* Still as the administrator user, return once again to the "'''Configure Global Security'''" page ('''Manage Jenkins > Configure Global Security''') and scroll down to the "'''Authorization'''" section.
[[File:lingobot_authorization2.png|600px|center]]
 
  +
* Un-select '''Administer''' access for Anonymous Users, if it is checked.. No boxes should be checked for Anonymous users.
 
  +
* Verify that Administrator has Administer access checked.
* Return once again to the "'''Configure Global Security'''" page ('''Manage Jenkins > Configure Global Security''') and scroll down to the "'''Authorization'''" section.
 
* In the "'''User/group to add'''" field under Matrix-based security, enter "lingobot" and click add. This should result in lingobot being added as a row in the security matrix above.
+
* In the "'''User/group to add'''" field under Matrix-based security, enter "jenkins_cli" and click OK. This should result in jenkins_cli being added as a row in the security matrix above.
* Enable the following security permissions for the lingobot account:
+
* Enable the following security permissions for the jenkins_cli account:
 
** Under "Overall"
 
** Under "Overall"
*** Administer
 
 
*** Read
 
*** Read
 
** Under "Job"
 
** Under "Job"
Line 48: Line 36:
 
*** Configure
 
*** Configure
 
*** Read
 
*** Read
  +
* Agent → Master Security: Select Enable Agent --> Master Access Control if it is not already checked.
* Once those boxes are checked, set the Anonymous user permissions to those in the picture and click "'''Save'''" and log out if you were previously logged in.
 
  +
* Click "'''Save'''" and log out if you were logged in as Administrator.
   
== Get the Lingobot Jenkins Token ==
+
== Get the jenkins_cli Jenkins Token and set up configuration ==
   
  +
* Log in as the newly created '''jenkins_cli''' account using the password you just created.
[[File:configure_jenkins_lingobot.png|600px|center]]
 
  +
* Once logged in, in the top-right hand corner of the window, click on the account name ('''Jenkins CLI Automation''')
 
* Log in as the newly created "lingobot" account using the password you just created.
 
* Once logged in, in the top-right hand corner of the window, click on the account name ('''LingoBot''')
 
 
* Select "'''Configure'''" from the menu on the left (or from the dropdown menu below the account-name button)
 
* Select "'''Configure'''" from the menu on the left (or from the dropdown menu below the account-name button)
 
[[File:Jenkins_token.png|600px|center]]
 
   
 
* On this page there should be a section called "'''API Token'''" and a corresponding button labeled "'''Show API Token...'''" or '''Add new Token'''. Click this button. If adding a new token, it can be named anything, it is just a label.
 
* On this page there should be a section called "'''API Token'''" and a corresponding button labeled "'''Show API Token...'''" or '''Add new Token'''. Click this button. If adding a new token, it can be named anything, it is just a label.
  +
* Copy the API Token that is displayed.
* Copy the API Token that is displayed and paste it into the LingoBot configuration file (/var/lib/jenkins/lingoport/lingobot-<x.y>/config/lingobot_config.sh) next to the '''LINGOBOT_JENKINS_TOKEN''' variable declaration.
 
  +
* Build the Jenkins job '''ConfigJenkinsCLI''' using '''Build with Parameters'''. JENKINS_USER should be '''jenkins_cli'''. Paste the token into the JENKINS_TOKEN field.
 
Example:
 
export LINGOBOT_JENKINS_USERNAME=lingobot
 
export LINGOBOT_JENKINS_TOKEN=1234567890abcdef14d4f2789bea4f22a
 
export LINGOBOT_JENKINS_DOMAIN=<nowiki>http://acme.company.com/jenkins</nowiki>
 
   
  +
Confirm that the job finishes successfully (it will test to see if it can login with the token).
You're done with this part! Just make sure that the LINGOBOT_JENKINS_USERNAME is set correctly to the username you chose when creating LingoBot's Jenkins account (by default it is set to "lingobot")
 
   
  +
Log out as the jenkins_cli user and return to the Administrator user.
Next Step: [http://wiki.lingoport.com/LingoBot_Dashboard_Setup LingoBot Dashboard Setup]
 

Latest revision as of 19:16, 24 July 2020

This step of the configuration process creates a Jenkins user which the Jenkins CLI can have access to. The Jenkins CLI is used by the Lingoport Product Suite, so it is very important that the configuration is done correctly.

To avoid future issues, please follow these instructions closely for the best results.

Create the Jenkins CLI user

  • Navigate to your Lingoport Jenkins instance in a web browser.
  • Log in as the Administrator user. If there is not an administrator user, return to Set up the Administrator User for Jenkins to set it up before continuing.
  • Select "Manage Jenkins"
  • Scroll down and click on "Manage Users", and on this page, select "Create User" from the left hand menu and fill out the form with the following information:
    • Username: "jenkins_cli"
    • Password: Choose a secure password.
    • Confirm Password: Repeat your previous entry
    • Full Name: "Jenkins CLI Automation"
    • Email: "support@lingoport.com"
  • Click "Create User"

Configure the security for the jenkins_cli user

  • Still as the administrator user, return once again to the "Configure Global Security" page (Manage Jenkins > Configure Global Security) and scroll down to the "Authorization" section.
  • Un-select Administer access for Anonymous Users, if it is checked.. No boxes should be checked for Anonymous users.
  • Verify that Administrator has Administer access checked.
  • In the "User/group to add" field under Matrix-based security, enter "jenkins_cli" and click OK. This should result in jenkins_cli being added as a row in the security matrix above.
  • Enable the following security permissions for the jenkins_cli account:
    • Under "Overall"
      • Read
    • Under "Job"
      • Build
      • Cancel
      • Configure
      • Create
      • Delete
      • Read
      • Workspace
    • Under "View"
      • Configure
      • Read
  • Agent → Master Security: Select Enable Agent --> Master Access Control if it is not already checked.
  • Click "Save" and log out if you were logged in as Administrator.

Get the jenkins_cli Jenkins Token and set up configuration

  • Log in as the newly created jenkins_cli account using the password you just created.
  • Once logged in, in the top-right hand corner of the window, click on the account name (Jenkins CLI Automation)
  • Select "Configure" from the menu on the left (or from the dropdown menu below the account-name button)
  • On this page there should be a section called "API Token" and a corresponding button labeled "Show API Token..." or Add new Token. Click this button. If adding a new token, it can be named anything, it is just a label.
  • Copy the API Token that is displayed.
  • Build the Jenkins job ConfigJenkinsCLI using Build with Parameters. JENKINS_USER should be jenkins_cli. Paste the token into the JENKINS_TOKEN field.

Confirm that the job finishes successfully (it will test to see if it can login with the token).

Log out as the jenkins_cli user and return to the Administrator user.