Re: sending email for unstable builds

2019-02-28 Thread Sagar Utekar
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 
> ',
>  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.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: How to send entire console logs/ output or specific stage output to email or save it to file

2019-02-21 Thread sagar . utekar
Thank you. 
I did it using this. 

emailext (attachLog: true, body: '', subject: 'Sending build logs',to: 
'exam...@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/f3f6b2fa-2172-448a-85e1-79ef2aa52bdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to send entire console logs/ output or specific stage output to email or save it to file

2019-02-21 Thread sagar . utekar
Hi guys,

I am trying to save logs of each build to file or send it through email, I 
found a way to send email as in post build action, but it is just sending 
an url for Jenkins build console.
If someone knows how can I achieve this, please help.

Thank you !

-- 
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/95eed1d7-2b76-4362-9b4e-9b505be62c3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No way to configure gitlab webhook in multibranch pipeline for detected branches(Individual) from Gitlab repository

2019-02-05 Thread Sagar Utekar
I am using multibranch pipeline for Gitlab repository, after a lot of 
efforts it is now showing all the branches from repository. But now I am 
facing issue as there is no way to configure Gitlab webhook for individual 
pipline in multibranch pipeline, though it is showing option to build 
trigger when there is any change on gitlab,etc but there is no option to 
save changes, as I am creating secret token for gitlab webhook, there 
should be way to save it, else it will not reflect chnages and start build 
for that pipeline. 

It is also not triggering build on any branch pipeline on change in 
repository.

-- 
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/558f2c49-88c4-4a25-a9b2-85efad5aab5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline stages skipping for mulitbranch gitlab repository

2019-02-05 Thread Sagar Utekar
Previously I was trying to use multibranch pipeline for gitlab repository 
which has multiple branches, but as there is no way to configure webhook 
and save changes for individual branch pipeline, I moved second approach 
which is using Normal pipeline for same repository but when I make any 
changes to branches other than master it does not executes stages from 
Jenkins pipeline and shows this message :

refs/heads/*:refs/remotes/origin/*
skipping resolution of commit remotes/origin/master, since it originates from 
another repository

-- 
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/df5e50a8-626f-474c-98e7-7e4605de500c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.lang.NoSuchMethodError: No such DSL method 'scanForIssues' found among steps

2018-10-29 Thread sagar utekar
from here you can download hpi file for warnings plugin
https://updates.jenkins.io/download/plugins/warnings/

and add it using upload section of manage plugin -> advanced section

On Mon, Oct 29, 2018 at 7:39 PM def  wrote:

> OK, from here:
> https://github.com/jenkinsci/warnings-plugin/tree/5.0
>
> But Jnekins requires a .*hpi* file.
> Do I have to build this, or package it somehow?
>
> On Monday, 29 October 2018 14:02:45 UTC, def wrote:
>
>> Thanks @ulli for your reply.
>>
>> *'Did you install the 5.0 beta version of the plugin? This step is not
>> available in the 4.x version.*'
>> Ahh... :) No. Where do I get that from and how to install in Jenkins?
>>
>> On Sat, Oct 27, 2018 at 6:07 PM Ulli Hafner 
>> wrote:
>>
>>>
>>>
>>> Von meinem iPad gesendet
>>>
>>> Am 26.10.2018 um 09:50 schrieb dean warren :
>>>
>>> I am trying to get the Warnings plugin collecting CheckStyle results
>>> within a pipeline.
>>>
>>> I believe I am using all the latest versions of pipeline related
>>> modules, and the warnings modules.
>>>
>>>
>>>
>>> A simplified version of my Jenkinsfile is something like:
>>>
>>> timestamps {
>>> node ('name') {
>>> try
>>> {
>>> stage ('Checkout') {
>>> checkout scm
>>> }
>>> stage ('Build & Test') {
>>> sh 'bash -x test.sh'
>>> }
>>> stage ('CheckStyle') {
>>> sh 'java -jar
>>> /home/user/checkstyle/checkstyle-6.5-all.jar -c /home/user/checkstyle.xml
>>> -f xml -c target/checkstyle-results.xml src'
>>> // Doesn't work
>>> //step([$class: 'CheckStylePublisher',
>>> //canRunOnFailed: true,
>>> //defaultEncoding: '',
>>> //healthy: '100',
>>> //pattern: '**/target/checkstyle-result.xml',
>>> //unHealthy: '90',
>>> //useStableBuildAsReference: true
>>> //])
>>>
>>>
>>> This publisher requires the CheckStyle plugin.
>>>
>>> // Doesn't work
>>> //step([$class: 'WarningsPublisher', consoleParsers:
>>> [[parserName: 'CheckStyle']]])
>>>
>>>
>>>
>>> The warnings publisher from the 4.x version does not support CheckStyle
>>> yet.
>>>
>>>
>>> // Doesn't work
>>> def checkstyle = scanForIssues tool: [$class:
>>> 'CheckStyle'], pattern: '**/target/checkstyle-result.xml'
>>> publishIssues issues:[checkstyle]
>>> }
>>> }
>>> catch (caughtErr)
>>> {
>>> }
>>> finally
>>> {
>>> }
>>> }
>>> }
>>>
>>>
>>> Did you install the 5.0 beta version of the plugin? This step is not
>>> available in the 4.x version.
>>>
>>> Where I have tried three different methods to collect the checkstype
>>> results, none of which work (I have left two of them commented out for
>>> reference - but beleive these are methods for the legacy checkstyle plugin,
>>> not the newly integrated warnigns plugin?).
>>>
>>>
>>> I believe the last method using scanForIssues is the correct method as
>>> per here:
>>>
>>>
>>> https://github.com/jenkinsci/warnings-plugin/blob/master/Jenkinsfile.local
>>>
>>>
>>>
>>> However on build, I see the checkstyle results being generated, but get
>>> the following error message
>>> java.lang.NoSuchMethodError: No such DSL method 'scanForIssues' found
>>> among steps
>>>
>>> Any ideas?
>>> Thanks in advance!
>>>
>>>
>>> --
>>> 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/00750112-2e37-4213-91b3-01c87686433c%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/71651BEB-5A46-4E4C-B8E5-C8C688B3D162%40gmail.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 

Re: Connecting Jenkins to GitHub

2018-10-28 Thread sagar utekar
Hi,

Search for a GitHub integration plugin.

Here is a YouTube video link you can refer -
https://youtu.be/Z3S2gMBUkBo

Thank you.

On Mon, 29 Oct 2018, 08:55 HB,  wrote:

> Thank you for the reply.  I am not seeing 'gith' plugin, is that short for
> a plugin?  Here are the plugins that I have installed referring to git and
> ssh:
>
> Git client plugin
> 2.7.3
> Git plugin
> 3.9.1
> GIT server Plugin
> 1.7
> GitHub API Plugin
> 1.92
> GitHub Branch Source Plugin
> 2.4.1
> GitHub plugin
> 1.29.3
>
> SSH Credentials Plugin
> 1.14
> SSH Slaves plugin
> 1.28.1
>
> Am I missing plugins that you are referring to?  Thanks again, any
> guidance is greatly appreciated..
>
> HB
>
> On Sunday, October 28, 2018 at 7:07:08 PM UTC-7, Robert Rajendra wrote:
>>
>> To integrate Jenkins with github. You need to install gith , github
>> plugins with ssh plugin you can read the docs regarding these and get the
>> work done
>>
>> On Mon, 29 Oct 2018, 3:06 am HB,  wrote:
>>
>>> All,
>>>
>>> I am completely new to Jenkins but am tasked with getting a working
>>> environment up and running.
>>>
>>> Everything appears to running well as follows:
>>>
>>> RHEL 7.5
>>> Jenkins ver 2.148
>>>
>>> Installed using the below yum repo:
>>> [jenkins]
>>> name=Jenkins
>>> baseurl=http://pkg.jenkins.io/redhat
>>> gpgcheck=1
>>>
>>> I have it configured to use Active Directory for user authentication and
>>> roles.
>>>
>>> My questions revolve around getting Jenkins connected to GitHub.  I am
>>> following these steps:
>>>
>>> https://gist.github.com/misterbrownlee/3708738
>>>
>>> I have created a 'utility user' (say git-jenkins) in GitHub that will
>>> ideally be the user that Jenkins uses to connect to GitHub.  I also have
>>> created a key pair for the connection.  Since Jenkins runs as user
>>> 'jenkins' on the server, I created the key pair as this user and imported
>>> the public key to the 'git-jenkins' utility user in GitHub.
>>>
>>> I also set:
>>>
>>> Global Config user.name Value
>>> Global Config user.email Value
>>>
>>> to the 'git-jenkins' GitHub utility user via: Manage Jenkins -->
>>> Configure System.
>>>
>>>
>>> I am trying to follow these steps:
>>>
>>> - Make sure the Manage Jenkins > Configure System has the right path to
>>> git
>>> - Set the global git user.name and user.email to match your global
>>> config options
>>> - Configure GitHub Web Hook to Manually manage hook urls
>>> - Click the (?) icon next to the manual option and copy the hook URL you
>>> see there
>>> - Optionally set the service account email as the Jenkins sender email
>>> address
>>>
>>> However, I am not able to successfully 'test connection' to GitHub in
>>> Manage Jenkins --> Configure System..
>>>
>>> I am able to clone the repository from the command line with a different
>>> user than the 'git-jenkins' utility user via Jenkins.  But since the
>>> 'jenkins' user on the server does not have a login shell out of the box, I
>>> am unable to test from the command line.
>>>
>>> Can anyone point me in the right direction here as to what I might be
>>> missing?  I hope I have not confused the situation too much.
>>>
>>> Thanks in advance,
>>>
>>> HB
>>>
>>> --
>>> 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/68a52bb7-f242-4cd4-9e53-4792259958fa%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/84ebfffc-fc47-455c-9115-ae2660086196%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/CAH_GKWvy2wekc4Umhf85A_eEjnqi3%3DsQPK1S3kB%3DeS7UCva44g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins and kubernetes cluster communication

2018-10-21 Thread sagar utekar
Hi all,

I have Jenkins and minikube setup running kubernetes locally on my machine. I 
am trying to deploy container from private docker registry to minikube 
kubernetes cluster. I tried to follow official doc and searched on internet for 
same but there is no any clear documentation for this. Please help me in this. 

Note : I have local setup for Jenkins and minikube

-- 
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/ca945302-45a0-4a8b-a17d-ac8b39bf069b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins plugin to access Kubernetes API

2018-10-21 Thread sagar utekar
On Thursday, October 4, 2018 at 10:45:19 PM UTC+5:30, olivier blanc wrote:
> I am looking for a Jenkins plugin to interact with kubernetes api from 
> jenkins pipeline.
> Is there such a plugin ?
> Thanks
> Olivier

Have you solved this issue, I am also looking for solution for same thing.

-- 
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/f59bfcb5--4a4f-9441-9e432b45e4d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.