Jenkins + Gitlab, how do you properly deploy key?



  • Good day. How do you use the key? Creating the key. /jenkins_home/.ssh/rsa, rights to the key are displayed on the user jenkins, gitlab'e the key is added as deploy key, and in the design of the project, the same is used. ssh:project_gitlab_ref♪ Permission denied. In case of a case, I tried a case with a file. /var/lib/jenkins/.ssh/config containing:

    Host repname.gitlabaddr
    HostName gitlabaddr
    User jenkins
    IdentityFile /path/id_rsa_name
    

    It didn't work. I guess it's not how I tell the HostName. Because:

    stderr: /var/lib/jenkins/.ssh/config: line 1: Bad configuration option: home
    /var/lib/jenkins/.ssh/config: terminating, 1 bad configuration options
    

    Now indicated as gitlab.2d.local-testv3



  • In Jenkins construction, come in Manage Jenkins ation Manage Credentials and get a new one. SSH username with private key.

    введите сюда описание изображения

    In the construction of a specific task, where the path to repository is indicated, select the credentials used.

    введите сюда описание изображения

    Jenkins will attempt to collateral in the repository. If he can't show a misstatement.

    Authorization is only necessary when your project has a private or Protected visibility level. If you don't want to build the copying, choose the level of the public:

    введите сюда описание изображения




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2