Thanks for answering,

I tried what you suggested but adding it as a env variable to the node 
variables does not work either. Regarding adding it to the jenkins user 
path I am not sure what you mean, I am not sure how to do that in windows 
10, I start jenkins just by executing the .war file

El miércoles, 31 de marzo de 2021 a las 15:35:37 UTC+2, Jérôme Godbout 
escribió:

> Jenkins run as his own user by default, check node user or login user you 
> are using. The cppcheck must be into that user env PATH variable. 
>
>  
>
> I work round this to avoid spamming the PATH variable on the machine by 
> doing env config into Jenkins, and I use that env variable to give a full 
> path on each node.
>
>  
>
> https://<MyJenkinsHost>/computer/<MyNodeName>/configure
>
>  
>
>  
>
> Then each node can install or put his binary into a custom path depends on 
> the node. I use the node label to declare his capacity:
>
>  
>
>  
>
> That way I run into a node that provide DOXYGEN for example, I then need 
> to resolve the doxygen path with the env variable or if the variable is not 
> present I assume the tool is inside the node current PATH var already (save 
> some time for tool that are install system wide).
>
>  
>
> *Jérôme Godbout, B. Ing.*
>
>
> Software / Firmware Team Lead
> *O:* (418) 682-3636 ext.: 114  
>
> *C:* (581) 777-0050 
> [email protected]
>
> [image: signature_16446078] <https://www.dimonoff.com/>
>
> *dimonoff.com* <https://www.dimonoff.com/>
>
> 1015 Avenue Wilfrid-Pelletier, 
>
> Québec, QC G1W 0C4, 4e étage
>
>  
>
>  
>
> *From: *[email protected] <[email protected]> on 
> behalf of jesus fernandez <[email protected]>
> *Date: *Wednesday, March 31, 2021 at 5:44 AM
> *To: *Jenkins Users <[email protected]>
> *Subject: *how can I run cppcheck in Jenkins?
>
> I have a playground pipeline and I am trying to start using cppcheck, but 
> when I execute the command in the cmd (I am running windows 10) it works 
> fine, but if executing the command inside the pipeline, it returns 
> ```'cppcheck' is not recognized as an internal or external command``` I 
> have installed the plugin and restarted Jenkins... what am I missing then? 
> . This is the sample pipeline:
>
> ```
>
> pipeline {
>
>     agent any    
>
>     stages {
>
>         stage('Static Analysis') {
>
>             steps {
>
>                 script{
>
>                     env.FAILED_STAGE=env.STAGE_NAME
>
>                     bat'cppcheck "D:/Source/Game"'
>
>                 }
>
>             }
>
>         }
>
>     }
>
> }
>
> ```
>
>  
>
> however the exactly same command, copied and pasted into the cmd, works 
> just fine, analyze the folder and gives me the cppcheck.xml file. 
>
>  
>
> Also if running the pipeline like this it seems to work just fine:
>
> ```
>
>         stage('Static Analysis') {
>
>             steps {
>
>                 script{
>
>                     bat'call  "C:\\Program Files\\Cppcheck\\cppcheck.exe" 
> D:\\Source\\Game  --xml --xml-version=2 . 2> cppcheck.xml'
>
>                 }
>
>             }
>
>         }
>
> ```
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/04691194-8864-411b-bd34-2ed8e20ab9fan%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/04691194-8864-411b-bd34-2ed8e20ab9fan%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/071dc060-c260-4885-9d15-f96043d15964n%40googlegroups.com.

Reply via email to