How to export credentials from one jenkins instance to another?

后端 未结 5 1997
一向
一向 2020-12-13 20:35

I am using the credentials plugin in Jenkins to manage credentials for git and database access for my team\'s builds. I would like to copy the credentials from one jenkins i

5条回答
  •  -上瘾入骨i
    2020-12-13 21:16

    UPDATE: TL;DR Follow the link provided below in a comment by Filip Stachowiak it is the easiest way to do it. In case it doesn't work for you go on reading.

    Copying the $HUDSON_HOME/credentials.xml is not the solution because Jenkins encrypts paswords and these can't be decrypted by another instance unless both share a common key.

    So, either you use the same encription keys in both Jenkins instances (Where's the encryption key stored in Jenkins? ) or what you can do is:

    1. Create the same user/password, you need to share, in the 2nd Jenkins instance so that a valid password is generated
    2. What is really important is that user ids in both credentials.xml are the same. For that (see the credentials.xml example below) for user: Jenkins the identifier c4855f57-5107-4b69-97fd-298e56a9977d must be the same in both credentials.xml

      
        
          
            
              
            
                            
              
                GLOBAL
                c4855f57-5107-4b69-97fd-298e56a9977d
                Para SVN
                jenkins
                J1ztA2vSXHbm60k5PjLl5jg70ZooSFKF+kRAo08UVts=    
                                        
              
            
          
        
      
      

提交回复
热议问题