Change the username in the subtitle in Jenkins Pipeline DSL

I have a project that integrates EC2 instances as build slaves, the username is "ec2-user".

I am viewing a repository with the following submodules:

checkout([
          $class: 'GitSCM',
          branches: [[name: 'deadbeefdeadbeefcafebabe']],
          doGenerateSubmoduleConfigurations: false,
          extensions: [
             [$class: 'SubmoduleOption',
              disableSubmodules: false,
              parentCredentials: true,
              recursiveSubmodules: true,
              reference: '',
              trackingSubmodules: false]
          ], submoduleCfg: [],
          userRemoteConfigs: [
             [credentialsId: 'deadbeef-cafe-babe-cafe-babebeef1234',
              refspec: 'refs/changes/12/34567/89',
              url: 'ssh://user@host:29418/some/project']
          ]
])

Please note that the URL has a username.

Now the .gitmodules file looks like this:

[submodule "path/in/project"]
    path = path/in/project
    url = ssh://host:29418/other/project
    branch = somebranch

The username is not specified in the submodule description. When the time comes for a submodule clone, the clone is denied with invalid credentials. Manually editing the .gitmodules file and adding user@in front of the URL works, but at best it is a bad workaround. Changing the URL on the disk and then turning off the check again also does not work.

Jenkins , ? , , ?

+4

Source: https://habr.com/ru/post/1657078/


All Articles