plasticscm-plugin icon indicating copy to clipboard operation
plasticscm-plugin copied to clipboard

Jenkins Plugin Requires Interactive Login for Plastic SCM

Open MuhanedYahya opened this issue 1 year ago • 1 comments

I am integrating Plastic SCM with Jenkins on a Debian server. When trying to connect using the Plastic CM client CLI, the Jenkins job prompts for interactive input .

environment:

  • Jenkins version 2.462.3 running on debian-12
  • cm version 11.0.16.8953
  • PlasticSCM plugin version 4.4
  • Plastic Cloud

Image

I attempted to log in using a standard email and password, and then tried using a service account, but neither worked. I logged in manually, then copied the client.conf to /var/lib/jenkins/.plastic4/client.conf with the required permissions, but the issue persists.

here is my pipeline configuration:

pipeline {
    agent any

    stages {
        stage('test plasticscm') {
            steps {
                script {
                   try {
                        cm(
                            branch: 'main',
                            repository: 'legends',
                            server: 'Legends@cloud',
                            cleanup: 'STANDARD',
                            credentialsId: 'plastic',
                            workingMode: 'LDAP'
                        )
                    }
                    catch (error) {
                        throw error
                    }
                }
            }
        }

        // Your other stages can go here
    }
}

MuhanedYahya avatar Oct 22 '24 20:10 MuhanedYahya

Hi @MuhanedYahya, thanks for the report.

Based off the screenshot you shared, your Jenkins configuration is using a self-provisioned tool (as opossed to a cm installed manually in the agent machine). Unfortunately, our plugin doesn't support specifying a version to download the cm CLI tool.

There was a few versions of cm which broke the ability to specify credentials as CLI arguments.

I'd like to propose you to actions to troubleshoot and ensure that you're really using the latest version in your Jenkins pipeline:

  • Print out the version running in the agent
pipeline {
    agent any

    // ...

    stages {
        stage('Print cm version') {
            script {
                def plasticTool = tool name: 'Default', type: 'cmtool'
                sh "${plasticTool} version"
            }
        }
    }

    // ...

}

If the version isn't the latest one (11.0.16.8953), go to Manage Jenkins > Tools > Plastic SCM installations. You should see one Plastic SCM configuration. Please, take a screenshot and share it here as well. Then, below that, click "Add Plastic SCM" and duplicate the configuration of the tool that you already have. Use a different tool name (this will make you change the tool name: 'Default', ... line in the Print cm version step). Now, run the pipeline and check that it's printing the latest version.

mig42 avatar Oct 23 '24 10:10 mig42

I was using the Pipeline type instead of the freestyle pipeline in Jenkins, and that's why I got an error. Apart from that, I was able to solve this problem by manually logging into the server and setting the Plastic SCM credentials to be used as existing in Jenkins.

MuhanedYahya avatar Oct 10 '25 19:10 MuhanedYahya