Re: Execute a function from post actions in Jenkinsfile

2020-12-20 Thread Kernel Panic
Hello Yes, that's what I want to do Thank you so much. El domingo, 20 de diciembre de 2020 a las 14:51:45 UTC-3, Gianluca escribió: > Hi, > > I'm not sure I understood your issue on calling functions. Maybe there is > only a bit of confusion about the Jenkins pipeline syntax. > > From what you

Re: How to commit and push in a declartive pipeline with auto-checkout ?

2020-12-20 Thread Yannick Lacaute
git push --set-upstream repoUrl branch Le dimanche 20 décembre 2020 à 12:24:16 UTC+1, Yannick Lacaute a écrit : > Ok found it : > > git push --set-upstream repoUrl HEAD: > > > Le dimanche 20 décembre 2020 à 11:45:43 UTC+1, Yannick Lacaute a écrit : > >> Hi, >> >> I have this error when I try to

Re: Execute a function from post actions in Jenkinsfile

2020-12-20 Thread Gianluca Massera
Hi, I'm not sure I understood your issue on calling functions. Maybe there is only a bit of confusion about the Jenkins pipeline syntax. From what you said, you are already calling functions into the post sections: "cleanWs()" is a function, "emailext body: ... " is a function. So, maybe yo

Execute a function from post actions in Jenkinsfile

2020-12-20 Thread Kernel Panic
Hello there. I looking for an elagant way to execute code from the post {} section, I want to write a clean Jenkinsfile and execute code from shared libraries as posible. In the post section I have the tipical clean working directory like this: always { cleanWs() } I also send not

Re: Jenkinsfile Accessing variables from shared libraries

2020-12-20 Thread Yannick Lacaute
Hi, First, if you want "echo", you could just use echo without the sh : echo "hello" Then, if you want to print a variable in the echo, use this syntax : echo "hello ${myGroovyVariable}" You must use double quote, if you use single quote the echo will print *exactly* what you have written

Re: How to commit and push in a declartive pipeline with auto-checkout ?

2020-12-20 Thread Yannick Lacaute
Ok found it : git push --set-upstream repoUrl HEAD: Le dimanche 20 décembre 2020 à 11:45:43 UTC+1, Yannick Lacaute a écrit : > Hi, > > I have this error when I try to commit & push in a pipeline : > > *11:22:35* error: src refspec master does not match any. > *11:22:35* error: failed to push so

How to commit and push in a declartive pipeline with auto-checkout ?

2020-12-20 Thread Yannick Lacaute
Hi, I have this error when I try to commit & push in a pipeline : *11:22:35* error: src refspec master does not match any. *11:22:35* error: failed to push some refs to 'http://@foo.net/bar.git ' If I click on the url, I go in my

How to commit and push in a declartive pipeline with auto-checkout ?

2020-12-20 Thread Yannick Lacaute
Hi, I have this error when I try to commit & push in a pipeline : *11:22:35* error: src refspec master does not match any. *11:22:35* error: failed to push some refs to 'http://@foo.net/bar.git ' If I click on the url, I go in my