how to configure slack to display jenkins build status? - jenkins

how do I configure slack and jenkins -
to get jenkins build statuses (with link to build) into specific slack room,
automatically after build is finish ?

found an answer to my question in slack site,
after installing jenkins plugin in slack
(from : https://hubot-nga.slack.com/apps)
I got detailed instructions + unique team-domain and integration token.
in addition all the required steps to complete the integration in jenkins.

Related

How to trigger a Jenkins build from XRay jira?

I am trying to trigger a build in Jenkins directly from Xray. I have been successfully able to create a trigger in jira and has provided the webhook url and other information needed to run the build. But on triggering the build from any Test Plan, I am getting the following error:
Error publishing web request. Response HTTP status:503
ERROR: The requested URL could not be retrieved.
When i'm hitting the same webhook url in any browser, then the build is getting triggered in jenkins, hence it seems there's no issue with the provided webhook url.
One thing to note is that our Xray is in Jira cloud whereas the Jenkins is running behind a VPN. Can anyone help me in resolving the above issue?
If your Xray on Jira Cloud is trying to acess Jenkins, the Jenkins server needs to have a public URL. If you have it behind the firewall then it's not possible for Xray or any other tool to trigger it directly.
You can call the Jenkins URL from your browser because you are probably with your vpn connected.
The possible workaround would be to use a tool such as ngrok, as mentioned in the docs, to make a tunnel, but beware with the security implications of exposing your Jenkins url to the world.
For reference, Xray cloud provides documentation/examples showcasing how to take advantage of Jira Cloud automation capabilities to trigger jobs, for example in Jenkins.

How can I update an issue status in JIRA via Jenkins?

I am trying to connect JIRA via Jenkins and updating the JIRA Issue status once my Jenkins Job is triggered and successfully executed or failed . I am looking forward to use Jenkins POST Build Actions. Also before that I am also facing an validating credential issue .
I have tried using JIRA Plugin , but I dont see and JIRA Issue Updater field in my Jenkins Job created .
I expect
A. To connect and Validate JIRA Plugin
B. Update my ticket status in JIRA post JOB execution
If you are using a Freestyle Job there is a post action called JIRA: Update relevant Issue
If you are using Jenkinsfiles you should look at the documentation here.

How do I send jenkins build log as an attachment to a slack channel and JIRA

I want to have the option to send the whole jenkins build log to a slack channel. I currently output the status of the builds successfully to slack, I would like to send the build log if the build fails. Does anyone know how to do this?
I have tried creating a shell script to zip up the log on the jenkins server and then posting it.
You can use Incoming WebHooks or Slash Commands both are the same.
I'm also using both for sending my Jenkins to build artifact to slack channel but.
You can add an attachment also in this hooks or Jenkins generate URL for all build artifacts and you can just pass that URL on slack and user can download it via slack.
you have to user slack plugin on Jenkins and configure your slack token and stuff like that.
If you need more detail contact me.

Bitbucket | Trigger Build on Pull request [duplicate]

This question already has answers here:
How to trigger jenkins build upon bitbucket pull request merged
(2 answers)
Closed 5 years ago.
I have a Jenkins job which I want to trigger when I evaluate a pull request on Bitbucket. The Jenkins job is correctly configured (by the looks of it) with the 'Poll SCM' option checked.
I have setup the 'Bitbucket Server Webhook to Jenkins' as follows. When I click on 'Trigger Jenkins' as part of the configuration check, it works well. Corresponding logs on the Jenkins server show up properly.
Now, when I receive a pull request, I would want to trigger the same Jenkins job. However, which I click on the 'Trigger Build' option, nothing happens. The Jenkins job is not triggered. I dont see correspnding logs on the Jenkins server. No logs on the bitbucket server as well.
Where am I going wrong?
I am using an 'Atlassian Bitbucket v4.7.1' evaluation installation and a Jenkins 1.651 installation.
Just tried bitbucket 4.13 with webhook to jenkins for bitbucket 3.0.1 plugin. Follow the instruction on the plugin site, you need to install the git plugin on the jenkins side, enable git checkout and make sure it works, and enable polling of scm. The jenkins version used is pulled from docker hub with tag jenkins/jenkins:lts.
If the above does not work for you, from my reading you can have a few options as of today Nov 12 of 2017:
Use the generic post webhooks plugin that supports pull request trigger. And from jenkins pick it up with the generic webhooks plugin, then maybe do a secondary trigger from jenkins.
Upgrade the bitbucket server and webhooks to jenkins plugin. The server 4.13 does not work well with later webhooks to jenkins plugin. A paid version of the plugin probably is your best choice.
Or try bamboo that comes with the "plan banches" feature.

Jenkins Integration with Jira issue

I have installed Jenkins Plugin for JIRA on my JIRA installation and also JIRA Plugin for Jenkins on to my Jenkins installation. I have added an application link in JIRA settings.
I am facing below issue:
1) On Application Links page there is a warning that my Jenkins Application "seems to be offline". While Adding a jenkins link it gives me error : The host doesn't respond. Change the url or click next to confirm.
Jira Version - 6.0.5
Jenkins Version - 1.562
Jenkins-Jira Plugin Version - 1.4.3
Thanks to anybody who's willing to help me out on this.
You can follow four steps:
Install JIRA Plugin in Jenkins
In Jenkins:
Manage Jenkins > manager plugins > available
search and choose Jenkins JIRA plugin , Jenkins JiraTestResultReporter plugin and Jenkins JIRA Issue Updater
Install Jenkins Plugin in JIRA.
https://marketplace.atlassian.com/plugins/com.marvelution.jira.plugins.jenkins
see: Installation section.
Add Jenkins 's Application Links in JIRA
The integration between JIRA and Jenkins has Application Links as its base. This allows administrators to configure and manage the Jenkins
To get started, go to [JIRA_BASEURL]/plugins/servlet/applinks/listApplicationLinks and click on the Add Application Link button to add a new Application Link for Jenkins.
or administration > plugin > Application Link > add Application Link; do as instruction
note: Optionally, but required if Jenkins is secured,
configure Outgoing Authentication that JIRA should use.
To do this, click on the Edit link next to the Jenkins Application Link, and select OutGoing Authentication tab
Provide the Username of the user to use to authenticate against Jenkins with
Provide the Password of the use
Jenkins Configuration
After the installation of the Jenkins Plugin for JIRA, and the configuration of at-least one Application Link, administrators will be able to control which Jobs are included in the synchronisation process and which aren't.
in Administration > plugins (add-ons) >Jenkins Configuration
Download JIRA plugin for Jenkins and install this plugin in Jenkins
way 1: copy it to Jenkins's plugin folder. and restart Jenkins
way2: Manage Jenkins > manager plugins > advanced > Upload Plugin . Choose file and upload then restart Jenkins
Enable Jenkins job in JIRA
then just use a known JIRA Issue Key in a commit message of your source code repo
Jenkins will make all the change sets (commits) available to the JIRA plugin when syncing a build.
The sync process uses the change sets to look for JIRA Issue Keys. Once this process locates a link, then that build will be available in the CI Build Panels.
download jenkins-jira-plugin at http://mvnrepository.com/artifact/com.marvelution.jira.plugins/jenkins-jira-plugin

Resources