Is there a way to configure PagerDuty alerts on Travis CI builds? To reframe can we trigger PagerDuty alerts from Travis CI.
I could not find any information on google, do the two even integrate?
There is a tool in this repository. Hope it helps:
https://github.com/PagerDuty/pagebreak
You just need to add this to your .travis.yml:
notifications:
email:
recipients:
- <travis-pagerduty-service>#<subdomain>.pagerduty.com
on_success: never
on_failure: always
Related
I have created a local travis-build container, can any one help me to do the following
Once the developer check-in code travis build should trigger.
if the build is success code should get check-in.
if the build fails code shouldn't check-in.
Suggest me the which repository i have to use to do this and can i do it with jenkins?
The only way to use Travis CI on your local/on-prem is to purchase Travis CI Enterprise edition;
https://landing.travis-ci.com/enterprise/
https://docs.travis-ci.com/user/enterprise/
There are multiple approaches in integrating Jenkins with GitHub
Approach 1) Enable ssh communication between GitHub and Jenkins by copying public key file generated in Jenkins to GitHub account. This is one time task.
For any pipeline take any GitHub url(say ssh://git#github.com/account/repo.git) and add using Github plugin for that respective pipeline cocnfiguration
So, Jenkins file just need to have checkout SCM to checkout
Approach 2) Enable https communication by adding webhook for every new repo by generating token and enable https comunication between GitHub and Jenkins. But this approach should be repeated for every new repo created in GitHub.
We are using GitHub repo... in production
Which is the best practice of GitHub integration with Jenkins in production?
Both are basically two different things.
The first approach lets you set up credentials to checkout and push source code to GitHub using Jenkins. The second approach lets you set up automated build triggers when a change is detected in the repository.
In summary, the first is mandatory for a build to get the source code, while the second is optional as you can trigger builds manually as well, although automated triggers on code push are inherent to continuous integration. Also, you need not add webhooks individually for every repository. Rather, add it once at the organization level to have all the repositories in that organization covered including any new additions.
Unless you are talking about an on-premise GitHub Enterprise, you also have an alternative approach with GitHub Action.
Either by using the built-in CI/CD, which does include an embedded Jenkins Single-shot (slide 42).
Or with appleboy/jenkins-action, a GitHub Action that trigger Jenkins jobs.
That way, you call your own Jenkins server, but without having to declare a webhook and implement a listener for said webhook.
That is:
name: trigger jenkins job
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: trigger single Job
uses: appleboy/jenkins-action#master
with:
url: "http://example.com"
user: "example"
token: ${{ secrets.TOKEN }}
job: "foobar"
I am looking for CI which is integrated with JIRA. I found some good stuff for Jenkins but not for Travis CI.
Is any plugin is available for Travis CI - JIRA integration?
Thanks in advance
After few of repositories were removed from GitHub, and then synced repos on Travis CI, the number of repositories displayed next to the info has stayed the same. Although, the actual repositories are not visible on Travis CI anymore.
Why is that? Is there a way of removing previous repos from Travis CI also just because they were removed already from GitHub?
On your profile page, you can enable or disable repositories:
I've just setup Jenkins and i have some Repositories in my Stash.
I installed the "Git plugin" in jenkins.
I can now enter the repository url but there is nothing to enter my credentials.
It's possible using
http://username:password#mydomain/xx/yy.git
but that is something i dont want to do.
What else can i do to authenticate?
I am the author of this stash plugin that might help you: https://github.com/palantir/stashbot
Taking selectively from the readme:
To work with Jenkins, you MUST install the following jenkins plugins first.
Jenkins GIT plugin
Post build task
Next, build and install the plugin using the plugin SDK (more details in the readme)
Next, the stash admin goes into the Stashbot Admin page and creates a jenkins server config - here you give it the URL, username/password, etc details of the jenkins server.
Next, for each repository a "Stashbot CI Admin" link shows up for repo admins. From there you can check the "enabled" checkbox and tell it what branches you want build (via a regex) and what command it should run to do the build (optionally verifies and publishes).
After this point, the remainder is completely self-service. Any repo admin can ask for their project to "have CI" by filling out that form, and the jobs will automatically be created in the jenkins server.
Hope that helps.
Set up an SSH key for the user that runs your Jenkins builds and add it to the repository's SSH keys in Stash. See the Stash docs for instructions.
Two things to add to Gareth's answer.
While I agree that using SSH keys are definitely better than hard-coding the username/password, it's worth mentioning that Stash (currently) scales better with HTTP when it comes to CI. If you have quite a few builds we generally recommend using HTTP. We are currently extending our Git cache support to support SSH so this no longer an issue.
Somewhat related, you might be interested in watching and voting for the following feature which will make it easier to create CI specific keys.
Lastly having build icons show up in Stash is surprisingly handy, and you should have a look at the following plugin if you haven't already:
https://github.com/jenkinsci/stashNotifier-plugin
Since version 2.0 of "Git Plugin" for jenkins you should be able to directly add the required credentials for both ssh and username/password (based on credentials plugin).
See changelog of Git plugin: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Changelog for details.
For further integration of git and stash regarding pull requests you additionally need the "Stash Webhook for jenkins" add-on in stash and the "Stash Notifier" plugin for jenkins to connect each other.