Re: Get stage name in pipeline

2019-08-23 Thread Faad Sayaou
  you can include this in every stage
  FAILED_STAGE=env.STAGE_NAME

and in your email you can call the property $FAILED_STAGE.
hope it helps


On Fri, 23 Aug 2019 at 12:42, Sureshkumar Ramar 
wrote:

> Hi,
> i am using jenkins pipeline. i want to send the failed stage name to the
> developer. is there a way to capture the failure stage in jenkins. it
> should work in parallel stages also.
>
> --
> Thanks & Regards,
> Suresh Kumar R
>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAM6nqfeQ9sPjgT-nPf%2BhWDY-nuE30%3D3O6No-10WLT3G%2B-jiPvg%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAM6nqfeQ9sPjgT-nPf%2BhWDY-nuE30%3D3O6No-10WLT3G%2B-jiPvg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 

*Best Regards / Mit freundlichen Grüßen,*

*Faad Sayaou,*

*Embedded Systems for Mechatronics Masters student | FH Dortmund | Germany*

*Fachhochschule Dortmund*

*University of Applied Sciences and Arts*

*Email*: f aad...@gmail.com

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL2KjjRd%3DbqTJdU99Tp8Bj22Q9ryPCZnN%3D9O10QpO5m7KW7N7g%40mail.gmail.com.


How to verify if directories exist on remote server from jenkinsfile?

2020-05-19 Thread Faad Sayaou
Hi All, 
I have 4 directories on my remote server and I will like to verify if the 
directories exist on the remote server. If not then create these 
directories. 

I already enabled key based login and I will like to know how to check from 
my jenkiins.


Best regards

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/50de8d98-0c2a-418e-87ba-20f69e71fc6e%40googlegroups.com.


Re: How to find specific warnings from jenkins console

2021-01-05 Thread Faad Sayaou
Hi Dany, thanks for the recommendation. I will check it out.
best regards

On Tue, 5 Jan 2021 at 10:13, Dany Jacob  wrote:

> you can try Warnings Next Generation | Jenkins plugin
>  and if the existing ones don't
> fit your need, you may simply write a custom parser.
>
> regards,
> DJ
>
> On Tue, Jan 5, 2021 at 2:29 PM faa...@gmail.com  wrote:
>
>> Hi All,
>> I would like to get specific warnings from the console that starts with
>> SCS as seen below. Is there any way on how to do that? My goal is to get
>> this warning and set the build to unstable and after that notifying the
>> developer per email about the issue. I am using security code scan in my
>> project that is why the warnings starts with SCS. Here is the warning
>> copied from the console.
>> *Program.cs(28,35): warning SCS0013: Weak cipher mode *
>>
>>
>>
>>
>> --
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/7879da3d-87d8-455b-a576-7a4c70c74d47n%40googlegroups.com
>> 
>> .
>>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAD%2BZqMnuSu%2B%3D3N3dJCSBA6Jwn87MY5F%3DhEcCHoxqRv_x0KrcLg%40mail.gmail.com
> 
> .
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL2KjjSZaF-XNzDz04%3D%2Buwvi4sr0fLDYMz01sk8vCudydsBTvA%40mail.gmail.com.


Changing Jenkins URL

2018-10-16 Thread Faad Sayaou
Hello everyone
I changed Jenkins URL field to "jenkins-app.mywebsite.com" in the 
jenkins.model.JenkinsLocationConfiguration.xml file and I tried accessing 
it on the browser but to no avail. My goal is to set up a running Jenkins 
instance where everyone in the company can access it with the link. Any 
help will be appreciated. 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b6a0e0ef-6c2b-471c-ac4a-a2927a736abf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Changing Jenkins URL

2018-10-23 Thread Faad Sayaou
Hi thanks for the reply. I am really new in this. How do you configure the
DNS for jenkins to use the URL i want? thanks

On Tue, 23 Oct 2018 at 09:03, Adrien Lecharpentier <
adrien.lecharpent...@gmail.com> wrote:

> Hello,
>
> this is not really enough. This field let you configure how Jenkins will
> notify the users of the instance, in case of build failure for example.
>
> You still need to configure the DNS, reverse-proxy or other elements.
>
> Best regards.
> -- Adrien
>
> Le mar. 16 oct. 2018 à 21:58, Faad Sayaou  a écrit :
>
>> Hello everyone
>> I changed Jenkins URL field to "jenkins-app.mywebsite.com" in the
>> jenkins.model.JenkinsLocationConfiguration.xml file and I tried accessing
>> it on the browser but to no avail. My goal is to set up a running Jenkins
>> instance where everyone in the company can access it with the link. Any
>> help will be appreciated.
>>
>> --
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/b6a0e0ef-6c2b-471c-ac4a-a2927a736abf%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/b6a0e0ef-6c2b-471c-ac4a-a2927a736abf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Adrien Lecharpentier
>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAKwJSvw7v9pMhT0Dz%3DfT_B7-exmmMFZcs9RLg-SbN5gYa%2B2rwA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAKwJSvw7v9pMhT0Dz%3DfT_B7-exmmMFZcs9RLg-SbN5gYa%2B2rwA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL2KjjSTUop73gPV997MgP0edh7v6uVoPp%2BsJYj3inL73-Dk_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Zipping build artifacts on jenkins

2018-11-08 Thread Faad Sayaou
Hello,
I am having difficulties zipping results from a build process in a 
jenkins pipeline. As of now, I am getting just an empty zipped directory 
called HelloJenkins.zip.  The build result is under 
*HelloJenkins/bin/release* and I will like to zip the entire zip folder. 
Below is my code


stage('build') {
 bat '"C:\\Program Files\\dotnet\\dotnet.exe" build 
HelloJenkins.sln /p:Configuration=Release /p:Platform=\"Any CPU\"'
}

 stage('zip stage') {

bat 'mkdir archive'
zip zipFile: 'HelloJenkins.zip', archive: true, dir: 
'archive'
archiveArtifacts artifacts: 'HelloJenkins.zip', 
fingerprint: true
} 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1fc7c8d3-669d-49f5-bb70-4358cad05f25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error: Batch scripts can only be run on windows nodes (on windows machine)

2018-11-08 Thread Faad Sayaou
Hello, I am having this strange error even though i am running jenkins on a 
windows machine (in a docker container). The script works perfectly on my 
second windows machine (jenkins installed locally and not in a container as 
the first machine)

The error states:  *java.io.IOException: Batch scripts can only be run on 
windows nodes.*




Any reason why I am getting this error??
Thanks

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2a5e7ad0-ca2f-4997-a963-5817ca98c584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error fetching remote origin in Jenkins pipeline

2018-11-09 Thread Faad Sayaou
Everything was working fine until i added a new file to my 
gitlab repository. It seems jenkins is not keeping track of changes made to 
my repository and somehow inconsistent. I am getting the error* Error 
fetching remote origin in Jenkins pipeline *after adding this file. Any 
help on how to repair this ?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/53ac03b6-1925-4e33-b2aa-e9334f6db948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins upload dotnet build results to nexus

2018-11-11 Thread Faad Sayaou
Hi all,
I am using a pipeline script to upload the result of my dotnet build (in a 
zip) to nexus repo 3. I am using the Nexus repository manager to do so. 
However, I am getting an error when I execute the build. Is there any way I 
can use maven to upload the zipped results to nexus?
here is my script 


*stage('Push to nexus') {*
*nexusPublisher nexusInstanceId: '1234', nexusRepositoryId: 
'myrepo', packages: [[$class: 'MavenPackage', mavenAssetList: [[classifier: 
'', extension: '', filePath: 
'/var/jenkins_home/workspace/DotnetTest/Release.zip']], mavenCoordinate: 
[artifactId: 'HelloJenkins', groupId: 'main', packaging: 'zip', version: 
'1.0.0']]]*
*   }*

I keep on getting error

*Failed build due to failure to upload file to Nexus Repository manager 
publisher.*

*com.sonatype.nexus.api.dh: Bad Request*

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/539a9e54--4e30-844f-f322f9d22697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Adding files before zipping (pipeline utility plugin Jenkins)

2018-11-15 Thread Faad Sayaou
Hello,
I currently have a pipeline which zips results of a build stage. I have a 
README.md file which i will like to add in my zip file when uploading to 
nexus. The file is included during checkout. how do I add this during the 
zip stage? I tried the approach below but it doesn't add the readme file in 
my final output folder

*zip dir: 'directroy/to/my/folder', glob:'', zipFile: 'folder.zip'  + 
'path/to/my/readmeFile/README.md'*


Can someone tell me the correct way of doing this?
Thanks


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/42183657-10a2-4b86-b139-dcb7bb0e82f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding files before zipping (pipeline utility plugin Jenkins)

2018-11-15 Thread Faad Sayaou
hi, so here is the thing. I am currently zipping two projects
*zip dir: 'directroy/to/my/folder1', glob:'', zipFile: 'folder1.zip'  *
*zip dir: 'directroy/to/my/folder2', glob:'', zipFile: 'folder2.zip'  + 
'folder2.zip' + **'path/to/my/readmeFile/README.md'*

zipping two folders works fine as expected. I do not want the readme file 
to be inside folder1 nor in folder2. I want a situation where if we 
download the zip file,
we should be able to see folder1.zip, folder2.zip and the readme.md file. 
On Thursday, 15 November 2018 19:15:41 UTC+1, Stuart Rowe wrote:
>
> Have you tried copying the *README.md* into *directory/to/my/folder* before 
> calling *zip*?
>
> On Thursday, 15 November 2018 09:38:27 UTC-8, Faad Sayaou wrote:
>>
>> Hello,
>> I currently have a pipeline which zips results of a build stage. I have a 
>> README.md file which i will like to add in my zip file when uploading to 
>> nexus. The file is included during checkout. how do I add this during the 
>> zip stage? I tried the approach below but it doesn't add the readme file in 
>> my final output folder
>>
>> *zip dir: 'directroy/to/my/folder', glob:'', zipFile: 'folder.zip'  + 
>> 'path/to/my/readmeFile/README.md'*
>>
>>
>> Can someone tell me the correct way of doing this?
>> Thanks
>>
>>
>>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9bda10bc-0c31-4985-82a8-3c14c2bb696d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins-nexus= bad gateway

2018-12-03 Thread Faad Sayaou
Hello,
I am currently having a problem with my jenkins nexus upload. It was 
however working before now I get an error
* return code is: 502, ReasonPhrase: Bad gateway.*

*uploading file bin.zip failed*

 And also I have this warning in my configuration (attached to this 
thread). I don't know if that is the reason for my failed uploads



-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/43dee365-8f2f-48e0-b0c0-b3ba2183663e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


xunit report from dotnet test command in jenkins pipeline

2018-12-09 Thread Faad Sayaou
Hello everyone,
I have been struggling with an issue for parsing test results to xunit for 
publishing. My goal is to display this in Jenkins UI for seeing all the 
passed tests. Below is my script
sh  *'dotnet test  --logger:trx path/to/my/project/project.csproj'*
*   xunit testTimeMargin: '3000', thresholdMode: 1, thresholds: [], 
tools: [xUnitDotNet(deleteOutputFiles: true, failIfNotNew: true, pattern: 
'**/*.trx', skipNoTestFiles: false, stopProcessingIfError: false)]*



Attached, is the output from the console. Can someone tell me what i am 
doing wrong?thanks

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/66e4faec-457b-4a82-994e-d3df010b3a0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


problems using google chat notification plugin

2019-01-03 Thread Faad Sayaou
Hello everyone,
I am trying to use the Google chat notification plugin to post successful 
or failed builds 
I used the pipeline snippet generator to generate the command for this. 
However there are different ways of the defining the URL.

I am now trying to configure google webhook but I do not know which link to 
insert in the avatar URL field.

Can someone help me please?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fe061d29-15b0-4eb5-885c-24e35ab8c93c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Creating 2 pipelines in a single jenkinsfile

2019-01-10 Thread Faad Sayaou
Hi everyone,
I have this scenario i would like to implement but i don not know if that 
is possible within a single jenkinsfile.
My idea was to have 2 pipelines

1st pipeline
 -git checkout
 -build
 -Test

2nd pipeline

if first build from the first pipeline was successful, then

-re-do the first 3 stages from 1st pipeline
-zip the build results
-and push to nexus

..is this however feasible within a single jenkinsfile?

thanks

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a301358d-d689-4a19-b5ba-b4cf0efd9043%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating 2 pipelines in a single jenkinsfile

2019-01-10 Thread Faad Sayaou
I was thinking maybe doing something like this would help but unfortunately 
not

node {
stages

}

node2 {

stages

}


but it is viewed by jenkins as a single pipeline. I am using the scripted 
pipeline syntax

On Thursday, 10 January 2019 16:25:11 UTC+1, Faad Sayaou wrote:
>
> Hi everyone,
> I have this scenario i would like to implement but i don not know if that 
> is possible within a single jenkinsfile.
> My idea was to have 2 pipelines
>
> 1st pipeline
>  -git checkout
>  -build
>  -Test
>
> 2nd pipeline
>
> if first build from the first pipeline was successful, then
>
> -re-do the first 3 stages from 1st pipeline
> -zip the build results
> -and push to nexus
>
> ..is this however feasible within a single jenkinsfile?
>
> thanks
>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0a680aab-e762-45f4-bd74-7098f5977afa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating 2 pipelines in a single jenkinsfile

2019-01-10 Thread Faad Sayaou
Hi everyone. thank you all for your wonderful replies.
First of all, I will like to have a two separate pipelines in order to 
manage builds from feature branches as well as to make sure the right and 
stable version is uploaded to my nexus repository. I tried Denis's approach 
by creating two separate pipelines and copy build results from the first to 
the second if stable, but I had problems doing this because I am still new 
in jenkins. 
 could you suggest how this can be done?

On Thursday, 10 January 2019 20:11:48 UTC+1, Adrien Lecharpentier wrote:
>
> I agree with Arnaud. 
>
> However, having an input means that if you cancel the input, you'll have 
> aborted the build. So, even if the first 3 steps are successful, you'll 
> have an aborted build.
>
> You could try/catch the input, but that will complexify the pipeline imo.
>
> Could you explain why you need to conditionally upload the results and not 
> doing it each time it's successful? If you have some concerns about the 
> "space usage", you could make sure to replace the same package each time, 
> or configure nexus to have some cleanup tasks. 
>
> Le jeu. 10 janv. 2019 à 19:49, Arnaud bourree  > a écrit :
>
>> Hi,
>>
>> Denis answer is good but why are you doing that?
>> You said if pipeline #1 succeed, you run pipeline #2 which redo same 
>> steps including git checkout then push result to nexus. 
>> But you don't have guarantee that git checkout will fetch same source 
>> code. 
>> Why not add input validation on nexus stage in single pipeline?
>>
>> Arnaud 
>>
>> Le jeu. 10 janv. 2019 à 17:54, Denis > a 
>> écrit :
>>
>>> You can create two pipeline jobs and have the first one trigger the 
>>> second one as a downstream job.
>>> i.e in a finally block you can check the result of the build and trigger 
>>> the pipeline that publish to nexus 
>>>
>>> On January 10, 2019 5:30:03 PM GMT+02:00, Faad Sayaou >> > wrote:
>>>>
>>>> I was thinking maybe doing something like this would help but 
>>>> unfortunately not
>>>>
>>>> node {
>>>> stages
>>>>
>>>> }
>>>>
>>>> node2 {
>>>>
>>>> stages
>>>>
>>>> }
>>>>
>>>>
>>>> but it is viewed by jenkins as a single pipeline. I am using the 
>>>> scripted pipeline syntax
>>>>
>>>> On Thursday, 10 January 2019 16:25:11 UTC+1, Faad Sayaou wrote:
>>>>>
>>>>> Hi everyone,
>>>>> I have this scenario i would like to implement but i don not know if 
>>>>> that is possible within a single jenkinsfile.
>>>>> My idea was to have 2 pipelines
>>>>>
>>>>> 1st pipeline
>>>>>  -git checkout
>>>>>  -build
>>>>>  -Test
>>>>>
>>>>> 2nd pipeline
>>>>>
>>>>> if first build from the first pipeline was successful, then
>>>>>
>>>>> -re-do the first 3 stages from 1st pipeline
>>>>> -zip the build results
>>>>> -and push to nexus
>>>>>
>>>>> ..is this however feasible within a single jenkinsfile?
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>> -- 
>>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>>
>>> -- 
>>> 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 jenkinsci-use...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/97F68F8F-DB51-4C09-B894-D8A57A30DFB0%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/97F68F8F-DB51-4C09-B894-D8A57A30DFB0%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> 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 jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/CAESUf_AYVtmQN%2BhinWSB-DgLtZ3QKTHYn0woYeEHQLfEwiBw4Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAESUf_AYVtmQN%2BhinWSB-DgLtZ3QKTHYn0woYeEHQLfEwiBw4Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Adrien Lecharpentier
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/29186f5a-c024-4f72-a474-1ebc95e23594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to modify xml elements from an xml file in jenkins

2019-01-14 Thread Faad Sayaou


I have an issue with my pipeline. I have an XML file in my project repo and 
I will like to read this file and change values after my checkout stage.

verNum.xml

1.0.0 

and my jenkinsfile

node {
stage ('checkout') {
...
}
stage ('readfile') {
readFile("verNum.xml")
}
}

I would increment the last digit of the version number with my build 
number. say something like this 1.0.${BUILD_NUMBER}.

Your help is highly welcomed.

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ed511a5d-a023-447f-9686-8a664cb193b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to Auto-increment XML tag value in jenkins

2019-01-21 Thread Faad Sayaou
Hi, I have an xml file in my project repo which after checkout, I will like 
to auto increment the last value of the version number for every build. I 
am already accessing the version number using xmlslurper and storing this 
in a variable. I have something like this in my pipeline script and my xml 
file is just a single line script with 1.0.0.0  and I 
will like auto increment the last digit for every build. NB: I do not want 
to use jenkins's build number. That would have been easy by just changing 
the last digit to $BUILD_NUMBER in my project repo. 


  any help please?

@NonCPS

String getVersion(String path) {
def version = new xmlSlurper().parse(new File(path))
return version.toString()
}

node {


stage ('checkout') {
 
 .

   }

   stage ('build) {
   def pwd2=pwd()
   def v=getVersion("${pwd2}/VersionNumber.xml")
 

   sh ' dotnet publish path/to/project -p:Fileversion=$v '

  }
}

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a9d3b4a3-b565-471b-9366-c364faed7a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Faad Sayaou
Hello everyone,

I would like to auto increment a number for every Jenkins build.  I have a 
function which reads value (1.0.0.0) from a file which goes as follows 


String IncBuildNum() {

def v= getVersion("path/to/file.xml")

def splitted= v..split('\\.')
splitted[3]= (((splitted[3] +1 as BigDecimal) + 1 ) as String)

return splitted.join('.')
}

However, I will like to increase this number 1 for every Jenkins build. 
Right now 
Is this possible?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0c7cec4a-5506-4e62-9c51-165059505386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Faad Sayaou
The build number gets really large which is something we do not want. Would 
have been good if there was a way to reset it. 

On Thursday, 24 January 2019 21:01:39 UTC+1, Justin Harringa wrote:
>
> Any reason you couldn't use the BUILD_NUMBER environment variable for this?
>
> On Thursday, January 24, 2019 at 10:12:30 AM UTC-8, Faad Sayaou wrote:
>>
>> Hello everyone,
>>
>> I would like to auto increment a number for every Jenkins build.  I have 
>> a function which reads value (1.0.0.0) from a file which goes as follows 
>>
>>
>> String IncBuildNum() {
>>
>> def v= getVersion("path/to/file.xml")
>>
>> def splitted= v..split('\\.')
>> splitted[3]= (((splitted[3] +1 as BigDecimal) + 1 ) as String)
>>
>> return splitted.join('.')
>> }
>>
>> However, I will like to increase this number 1 for every Jenkins build. 
>> Right now 
>> Is this possible?
>>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8db59767-f91c-400e-a012-6a46db036261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to push to Gitlab after Jenkins build

2019-01-27 Thread Faad Sayaou
0

I have a stage at the end of my pipeline job which has to push changes back 
to a particular Gitlab branch. After trying out several solutions proposed 
on stackoverflow, I am still not able to push to the branch

sh("git add .")
sh("git commit -a -m ' New changes'")
sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@ ')

I expected it to be pushed to the branch which it checked out from but I 
get the following result on the console

   - git commit -a -m ' New changes' [detached HEAD bc78567] New changes
   - Everything up-to-date

any reason for this issue?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/00dbb024-1cb8-47f5-bdb5-255c3e2f0907%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to push to Gitlab after Jenkins build

2019-01-27 Thread Faad Sayaou
After trying this command, i still had an error which says

error: RPC failed; result=22, HTTP code =404

fatal: The remote end hung up unexpectedly

fatal: The remote end hung up unexpectedly

Everything up-to-date



However, I made changes in a file from my pipeline script and I am now 
surprised that it says everything is up to date



On Sunday, 27 January 2019 22:14:03 UTC+1, Faad Sayaou wrote:
>
> 0
>
> I have a stage at the end of my pipeline job which has to push changes 
> back to a particular Gitlab branch. After trying out several solutions 
> proposed on stackoverflow, I am still not able to push to the branch
>
> sh("git add .")
> sh("git commit -a -m ' New changes'")
> sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@ ')
>
> I expected it to be pushed to the branch which it checked out from but I 
> get the following result on the console
>
>- git commit -a -m ' New changes' [detached HEAD bc78567] New changes
>- Everything up-to-date
>
> any reason for this issue?
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7cd80d9e-ba4c-4326-ac54-a874e45c30ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to include other files using (pipeline utility plugin) in jenkins pipeline

2019-01-29 Thread Faad Sayaou
Hello,
I am using the pipeline utility plugín for zipping build results in order 
to do a nexus upload in my pipeline script.
However, I have a readme.md file in my workspace which i will like to 
include when zipping my build artifacts. I tried the following stages

   stage ('zip stage') {

zip dir: 'My/path/bin', glob: '', zipFile: 'bin.zip' + 
'**/some/other/path/bin.zip' + 'README.md'

}
 stage ('nexus') {
 nexusArtifactUploader artifacts: [[artifactId: 'myID', 
 classifier: '', file: 'bin.zip', 
 type: 'zip']], credentialsId: '***', 
 groupId: 'myGroupID', nexusUrl: 'nexus.c 
om', 
 nexusVersion: 'nexus3', protocol: 'https', repository: 'Test', 
 version: '1.0.${BUILD_NUMBER}',
}

the README.md is however not included after checking the uploaded artífacts.

Any idea of how to include this file?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9584f089-fe67-451b-912c-c39d9be8bdc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to include other files using (pipeline utility plugin) in jenkins pipeline

2019-01-29 Thread Faad Sayaou
Hi thanks for your reply. Thats exactly what i have but i managed to solve 
it by doing  sh ('zip -ur bin.zip README.md'). It successfully added the 
readme file in my bin.zip 

On Wednesday, 30 January 2019 08:27:24 UTC+1, Richard Bywater wrote:
>
> Based on my reading of what you have put, it looks like you'd end up with 
> a zip file called "bin.zip**/some/other/path/bin.zipREADME.md" - is that 
> definitely what you have in your pipeline?
>
>
> Richard.
>
> On Wed, Jan 30, 2019 at 7:59 PM Faad Sayaou  > wrote:
>
>> Hello,
>> I am using the pipeline utility plugín for zipping build results in order 
>> to do a nexus upload in my pipeline script.
>> However, I have a readme.md file in my workspace which i will like to 
>> include when zipping my build artifacts. I tried the following stages
>>
>>stage ('zip stage') {
>>
>> zip dir: 'My/path/bin', glob: '', zipFile: 'bin.zip' + 
>> '**/some/other/path/bin.zip' + 'README.md'
>>
>> }
>>  stage ('nexus') {
>>  nexusArtifactUploader artifacts: [[artifactId: 'myID', 
>>  classifier: '', file: 'bin.zip', 
>>  type: 'zip']], credentialsId: '***', 
>>  groupId: 'myGroupID', nexusUrl: 'nexus.c 
>> <http://nexus.1worldsync.de/>om', 
>>  nexusVersion: 'nexus3', protocol: 'https', repository: 'Test', 
>>  version: '1.0.${BUILD_NUMBER}',
>> }
>>
>> the README.md is however not included after checking the uploaded 
>> artífacts.
>>
>> Any idea of how to include this file?
>>
>> -- 
>> 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 jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/9584f089-fe67-451b-912c-c39d9be8bdc8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/9584f089-fe67-451b-912c-c39d9be8bdc8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6c5b7051-ad15-4982-a3fb-2e2865204d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to include pipeline errors in email (Email-ext plugin)

2019-02-04 Thread Faad Sayaou


I am trying to have the reason as it is printed on the console of my 
Jenkins instance why a build failed through email. I did the following

try {
.

} catch (err) {
cause=err
emailext body:"Error: $cause ",
to: 'myem...@gmail.com'

}

The result on the console is something like "dotnetge command not found" 
and i will like to have this same type of error through email. This is what 
i get through email

Error: hudson.AbortException: script returned exit code 127

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/779ecdf8-22e5-4d2c-a437-862e8f20b5ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins pushing to a Nuget hosted repository (Nexus)

2019-02-23 Thread Faad Sayaou
Hi All,
I am trying to push my nuget package generated from dotnet build and pack 
command. I already installed the Nuget plugin and I also configured API key 
and server URL.
I left the NuGet command line executable field empty in the jenkins config.

I did a sh *"nuget push myNuget.package.$version.symbols.nupkg -s 
$NugetServer -sk *"

I get an error on the console saying *nuget command not found*


*Please help!*

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f22991dc-2ddf-4a4a-b316-41baa9ea2d35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sending email for unstable build

2019-02-28 Thread Faad Sayaou
Hi everyone
I am using the extended email plugin for notification when the build fails 
by using try catch. I will also like to send email when the build is 
unstable. Below is the structure of my pipeline 

node {
   
   try 
   {
 
stage('Checkout') {
cleanWs()
checkout scm

}


stage('Restore') {

sh "dotnet restore  $proj"

   }

stage('Build') {
sh "dotnet restore  $proj"

   }
stage ('Unit test') {

   sh "dotnet test  $test"
   } 
   }
} catch (err) {
 emailext body: 
' ${JOB_NAME} ${BUILD_NUMBER} is failing! Somebody should do 
something about that. 
https://jenkins-map.1worldsync.com/job/Test/${BUILD_NUMBER}/console 
',
 subject: 'FAILURE', to: 'someEmail..'
}


I will like to send not only when the pipeline fails but when the build is 
unstable. thanks 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/18dd58b1-9352-4b31-ab90-5aecd326003a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


sending email for unstable builds

2019-02-28 Thread Faad Sayaou
Hi everyone
I am using the extended email plugin for notification when the build fails 
by using try catch. I will also like to send email when the build is 
unstable. Below is the structure of my pipeline 

node {
   
   try 
   {
 
stage('Checkout') {
cleanWs()
checkout scm

}


stage('Restore') {

sh "dotnet restore  $proj"

   }

stage('Build') {
sh "dotnet restore  $proj"

   }
stage ('Unit test') {

   sh "dotnet test  $test"
   } 
   }
} catch (err) {
 emailext body: 
' ${JOB_NAME} ${BUILD_NUMBER} is failing! Somebody should do 
something about that. https://jenkins-ma.com/job/Test/${BUILD_NUMBER}/console 
',
 subject: 'FAILURE', to: 'someEmail..'
}


I will like to send not only when the pipeline fails but when the build is 
unstable. thanks

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2c7db49d-68ef-4c41-8cd2-39ff6855ad83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sending email for unstable builds

2019-02-28 Thread Faad Sayaou
thanks @Simon and @Sagar for your responses.  'currentBuild.currentResult'
is definitely what i needed and works as intended.

On Fri, 1 Mar 2019 at 06:37, Simon Bayer  wrote:

> Check This if u need post build actions for different build status:
> https://jenkins.io/doc/pipeline/tour/post/
>
>
>  Ursprüngliche Nachricht 
> Von: Simon Bayer 
> Datum: 01.03.19 06:32 (GMT+01:00)
> An: jenkinsci-users@googlegroups.com
> Betreff: Re: sending email for unstable builds
>
> Dear Faad, dear Sagar,
> U could check the global variable  'currentBuild.currentResult' in e.g.
> post build actions. Maybe it suits your needs. Doks:
> https://opensource.triology.de/jenkins/pipeline-syntax/globals#currentBuild
>
> Best regards
>
>
>  Ursprüngliche Nachricht 
> Von: Sagar Utekar 
> Datum: 01.03.19 03:06 (GMT+01:00)
> An: jenkinsci-users@googlegroups.com
> Betreff: Re: sending email for unstable builds
>
> You can check the status of build by using BUILD_STATUS, if it is unstable
> then send a mail
>
> On Fri, 1 Mar 2019, 02:11 Faad Sayaou,  wrote:
>
>> Hi everyone
>> I am using the extended email plugin for notification when the build
>> fails by using try catch. I will also like to send email when the build is
>> unstable. Below is the structure of my pipeline
>>
>> node {
>>
>>try
>>{
>>
>> stage('Checkout') {
>> cleanWs()
>> checkout scm
>>
>> }
>>
>>
>> stage('Restore') {
>>
>> sh "dotnet restore  $proj"
>>
>>}
>>
>> stage('Build') {
>> sh "dotnet restore  $proj"
>>
>>}
>> stage ('Unit test') {
>>
>>sh "dotnet test  $test"
>>}
>>}
>> } catch (err) {
>>  emailext body:
>> ' ${JOB_NAME} ${BUILD_NUMBER} is failing! Somebody should do 
>> something about that. 
>> https://jenkins-ma.com/job/Test/${BUILD_NUMBER}/console 
>> <https://jenkins-map.1worldsync.com/job/Heinemann_Build_pipeline/$%7BBUILD_NUMBER%7D/console>',
>>  subject: 'FAILURE', to: 'someEmail..'
>> }
>>
>>
>> I will like to send not only when the pipeline fails but when the build
>> is unstable. thanks
>>
>> --
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/2c7db49d-68ef-4c41-8cd2-39ff6855ad83%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/2c7db49d-68ef-4c41-8cd2-39ff6855ad83%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CANYh6tf5h6_LAafRrKLROquy3mO95puNkbMY0%3DATh5uRnkXeyw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CANYh6tf5h6_LAafRrKLROquy3mO95puNkbMY0%3DATh5uRnkXeyw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/DM6PR15MB3452B3FF105E05324B50A9C4AC760%40DM6PR15MB3452.namprd15.prod.outlook.com
> <https://groups.google.com/d/msgid/jenkinsci-users/DM6PR15MB3452B3FF105E05324B50A9C4AC760%40DM6PR15MB3452.namprd15.prod.outlook.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

*Best Regards / Mit freundlichen Grüßen,*

*Faad Sayaou,*

*Embedded Systems for Mechatronics Masters student | FH Dortmund | Germany*

*Fachhochschule Dortmund*

*University of Applied Sciences and Arts*

*Email*: f aad...@gmail.com

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL2KjjQ-6Q66229-Zh-5BRYtMvRANN-dmOZCwteJ7Re9n%3D1Tcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to download artifacts from nexus

2019-03-09 Thread Faad Sayaou
Hello,
I have a pipeline which builds my project and uploads the result as a zip 
file on nexus. I am now making a second pipeline which will download the 
zip files from Nexus in order to deploy the application to a server.

1. Is there any plugin which I can use to get the latest version of my zip 
files from Nexus?
2. Is it also possible to dynamically read all applications from my nexus 
server in my jenkinsfile? 

My plan is to have a drop-down menu where I can select the application 
which I want to deploy to the server, and it downloads the latest version 
of the selected application.

thanks


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e0b02168-b9f1-4953-830a-26a5de95661a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sending email for unstable builds

2019-03-12 Thread Faad Sayaou
thanks for your contribution. Is there any other way of failing of failing 
the pipeline when unit test stage is unstable? I have something like the 
following in my code to ignore the failed test but I will like to stop the 
pipeline and publish unit test result.

I am currently experiencing a strange effect when using the MStest plugin. 
My test report is only generated when the test is successful but when it 
fails, no test report is generated. 

node {


stage('Checkout') {
cleanWs()
checkout scm

return
skipRemainingStages = true
}


stage('Restore') {

sh "dotnet restore  $proj"

}

stage('Build') {
sh "dotnet publish $proj --output $outputFolder --configuration 
Release -p:Version=$buildVersion -p:FileVersion=$buildVersion"

   }
stage ('Unit test') {

   sh  "dotnet restore $UnitTest"
   sh returnStdout: true, script: "dotnet test $UnitTest --logger 
\'trx;LogFileName=unit_tests.xml\' || true"


   step ([$class: 'MSTestPublisher', testResultsFile:"**/*.xml", 
failOnError: true, keepLongStdio: true])

} 

 stage ('publish') {

}

}


I do not want to publish when the build is unstable. Like I mentioned 
earlier. I want to stop the build and publish test result. I tried using 
answers suggested above but could not help in my use-case.any idea?

On Monday, 11 March 2019 14:14:40 UTC+1, Mark Lübbehüsen wrote:
>
> Hi,
>
> its better you send emails in the post action
>
> post {
>   always {
>
> }
> success {
> }
> unstable {
>
> 
> }
>     failure {
>
> }
> aborted {
> }
> }
>
> https://jenkins.io/doc/pipeline/tour/post/
>
>
> Am Donnerstag, 28. Februar 2019 21:41:50 UTC+1 schrieb Faad Sayaou:
>>
>> Hi everyone
>> I am using the extended email plugin for notification when the build 
>> fails by using try catch. I will also like to send email when the build is 
>> unstable. Below is the structure of my pipeline 
>>
>> node {
>>
>>try 
>>{
>>  
>> stage('Checkout') {
>> cleanWs()
>> checkout scm
>>
>> }
>>
>>
>> stage('Restore') {
>>
>> sh "dotnet restore  $proj"
>>
>>}
>>
>> stage('Build') {
>> sh "dotnet restore  $proj"
>>
>>}
>> stage ('Unit test') {
>>
>>sh "dotnet test  $test"
>>} 
>>}
>> } catch (err) {
>>  emailext body: 
>> ' ${JOB_NAME} ${BUILD_NUMBER} is failing! Somebody should do 
>> something about that. 
>> https://jenkins-ma.com/job/Test/${BUILD_NUMBER}/console 
>> <https://jenkins-map.1worldsync.com/job/Heinemann_Build_pipeline/$%7BBUILD_NUMBER%7D/console>',
>>  subject: 'FAILURE', to: 'someEmail..'
>> }
>>
>>
>> I will like to send not only when the pipeline fails but when the build 
>> is unstable. thanks
>>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2387b46c-4e0d-4747-81ec-b8c6dae3316c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to create environment variables with a script?

2019-03-15 Thread Faad Sayaou
Hi,
Is there any method of creating environment variables via a script? The 
goal is to have a script that I can run whenever I have a freshly installed 
jenkins instance. Then I don't have to set all the variables manually.
Same question also for pipelines.

Thanks

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ab270a3b-499e-485f-86d8-90f4220846bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create environment variables with a script?

2019-03-16 Thread Faad Sayaou
Hi, I found a way of creating it via the script console (in reference to an 
answer in this group). Maybe this could help others in the future

instance = Jenkins.getInstance()
globalNodeProperties = instance.getGlobalNodeProperties()
envVarsNodePropertyList = globalNodeProperties.getAll(hudson.slaves.
EnvironmentVariablesNodeProperty.class)


newEnvVarsNodeProperty = null
envVars = null


if ( envVarsNodePropertyList == null || envVarsNodePropertyList.size() == 0 
) {
  newEnvVarsNodeProperty = new hudson.slaves.
EnvironmentVariablesNodeProperty();
  globalNodeProperties.add(newEnvVarsNodeProperty)
  envVars = newEnvVarsNodeProperty.getEnvVars()
} else {
  envVars = envVarsNodePropertyList.get(0).getEnvVars()


}


envVars.put("Username", "myUsername")
envVars.put("Password", "myPassword")




instance.save()

you can add as many as you want and this would create the env vars. I also 
found the piece of code on StackOverflow which creates a pipeline but I 
would like to create multiple pipelines and not just one. any idea how to 
do this with the code below?

import hudson.plugins.git.*;
def scm = new GitSCM("g...@github.com/yourRepo.git")
scm.branches = [new BranchSpec("*/TestBranch")];
def flowDefinition = new 
org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition(scm, "Jenkinsfile")
def parent = Jenkins.instancedef job = new 
org.jenkinsci.plugins.workflow.job.WorkflowJob(parent, "New Job")
job.definition = flowDefinition

parent.reload()


On Saturday, 16 March 2019 17:35:56 UTC+1, Ivan Fernandez Calvo wrote:
>
> For pipelines take a look to the environment directive documentation 
> https://jenkins.io/doc/pipeline/tour/environment also you can define 
> variable by asigning a value to env variable 
>
> script { env.VARIABLE_NAME = ’value’ } 
>
> See also 
> https://jenkins.io/doc/book/pipeline/shared-libraries/ 
>
> https://wiki.jenkins.io/plugins/servlet/mobile?contentId=58000129#content/view/58000129
>  
>
>
> To set environment variables or properties at Jenkins start time you could 
> use init scripts 
> https://wiki.jenkins.io/plugins/servlet/mobile?contentId=38142057#content/view/3814205
>  
> or CasC https://jenkins.io/projects/jcasc/

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1e321b1e-d1e3-4662-be78-c2057faff475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using active choice reactive parameter in jenkinsfile

2019-03-19 Thread Faad Sayaou
Hi, I am using active choice reactive parameter and I would like to access the 
selected value from my jenkinsfile. Is that possible with this plugin ? 

I used active choices parameter as follows 

Name: select_ environment 
Groovy script : return [“dev”,”QA”,”prod”]

Based on the selected environment, a list of servers 
Are displayed and a user can select the server using the 
Reactive choice parameter.
The I tried accessing the reactive choice parameter when a user ticks the radio 
button by doing $select_server 
But this does not work. Any idea please how I can 
Access that from my jenkinsfile ? 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/281ef4f6-440b-41e4-b893-18692ee49a81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Creating multiple pipeline jobs using groovy

2019-03-25 Thread Faad Sayaou
Hi,
Is there any way I can create multiple pipeline jobs using 
A single groovy script ? Say 5 pipeline jobs by setting 
Name of the job 
Git repository 
Script path= Jenkinsfile
Perhaps credentials too 

Thanks 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fa625936-3217-4363-b6a8-ad425f424ac5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Accessing active choice reference parameter in jenkinsfile

2019-04-04 Thread Faad Sayaou
Hello,
This might be simple but I having difficulties accessing 
Active choice reference parameter in my jenkinsfile. It is simple using “active 
choices reactive parameter” by doing 
${params.myvalue} but this doesn’t work when I use it with “active choices 
reactive reference parameter”.
Any idea how I can read this in my jenkinsfile ? 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ce1a1235-393a-4983-82ac-79324d9bda42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Programmatically create Jenkins dashboard view

2019-04-29 Thread Faad Sayaou
Hi everyone, 
I have several dashboard views and I would like to know if there is a 
possibility of creating these views using groovy script? 

Thanks 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/908e3da1-b3da-4683-b620-732f363fd609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Programmatically create Jenkins dashboard view

2019-05-02 Thread Faad Sayaou
Hi, thanks for your reply. your reply was indeed helpful. Is it also
possible to do this via the groovy script? I saw an example in creating a
listview but couldn't find any example about dashboard view. My idea was to
have one script to run through the jenkins script console and
everything is created.
Thanks

On Tue, 30 Apr 2019 at 14:20, Nick Stolwijk  wrote:

> You can create views with the JobDSL [1].
>
> [1]
> https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.views.NestedView.views
>
> Hth,
>
> Nick Stolwijk
>
> ~~~ Try to leave this world a little better than you found it and, when
> your turn comes to die, you can die happy in feeling that at any rate you
> have not wasted your time but have done your best ~~~
>
> Lord Baden-Powell
>
>
> On Tue, Apr 30, 2019 at 8:20 AM Faad Sayaou  wrote:
>
>> Hi everyone,
>> I have several dashboard views and I would like to know if there is a
>> possibility of creating these views using groovy script?
>>
>> Thanks
>>
>> --
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/908e3da1-b3da-4683-b620-732f363fd609%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAA9S6i6nMH6unEBWdYCE%2B3ddcSUwqm_hY9hWAC8NjuEGovsZ6g%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAA9S6i6nMH6unEBWdYCE%2B3ddcSUwqm_hY9hWAC8NjuEGovsZ6g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

*Best Regards / Mit freundlichen Grüßen,*

*Faad Sayaou,*

*Embedded Systems for Mechatronics Masters student | FH Dortmund | Germany*

*Fachhochschule Dortmund*

*University of Applied Sciences and Arts*

*Email*: f aad...@gmail.com

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL2KjjTJRzZUf%3Dmw7P%3DYACUsFbT-LUnRzg-m2NotwnZoOsEbSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Active Choices Reactive Reference Parameter -> use the parameter in a bash ?

2019-05-13 Thread Faad Sayaou
have you tried
${params.ReactiveRefParam}
???


On Monday, 13 May 2019 11:27:01 UTC+2, b o b i wrote:
>
> In 
> Scenario 2: Pass a dynamically created value that is *hidden* (can't be 
> edited by the user)
>
> return " class=\"setting-input\" type=\"text\">"
>
>
> *ReactiveRefParam* is the Reactive Reference value that will be passed to 
> the build
>
>
> in my bash script the variable is *ReactiveRefParam* empty
>
> How do I use it in a bash script?
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/57cdcab1-e652-47e1-a835-8706a3d26581%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Creating jobs grid portlet using groovy

2019-05-14 Thread Faad Sayaou
Hi,
I created a script to create a dashboard view but I am having difficulties 
creating job grid in my groovy script. 
Any idea how to include portlets via groovy ?

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e333b8f5-5683-45c3-934f-955ed52977e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.