Home > database >  Run the command in Linux machine, just the same way batch is used in Windows machine
Run the command in Linux machine, just the same way batch is used in Windows machine

Time:03-24

I am new to linux System, there was scenario where through my Jenkinsfile I have to run the command bat 'mvn sonar:sonar -Dsonar.projectKey=testproject -Dsonar.host.url=https://localhostxy.com -Dsonar.login=xyzloginid'on linux machine, but getting an error as I was using batch.

The same batch command is working on window based machine.

Please suggest me an alternate way to run it on Linux based machine.

Jenkinsfile stage as below, its working on Windows, please suggest the changes to make it work on linux based machine.

stage('SonarQube Code QualityCheck') {
        steps {           
            bat 'mvn sonar:sonar -Dsonar.projectKey=testproject -Dsonar.host.url=https://localhostxy.com -Dsonar.login=xyzloginid'            
            }
     }

Thanks in advance for the help.

CodePudding user response:

Here is the solution:

stage('SonarQube Code QualityCheck') {
  steps {           
    sh 'mvn sonar:sonar -Dsonar.projectKey=testproject -Dsonar.host.url=https://localhostxy.com -Dsonar.login=xyzloginid'            
  }
}
  • Related