Last active
February 6, 2018 12:36
-
-
Save coorasse/706d9456fcbe359744d1 to your computer and use it in GitHub Desktop.
Bitbucket Codeship PullRequest integration script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var bitbucket_project_name = 'YOUR BITBUCKET PROJECT_NAME LIKE coorasse/airesis'; | |
var codeship_project_code = 'YOUR CODESHIPO PROJECT UUID CODE (look for it in the badge instructions page or general settings page)'; | |
var regexp = new RegExp("^https://bitbucket.org/" + bitbucket_project_name + "/pull-request/","g"); | |
if ((regexp).test(window.location.href)) { | |
var branch = $('dd.unabridged a').first().html(); | |
var url = 'https://codeship.com/projects/'+codeship_project_code+'/status?branch='+branch; | |
var row = $('<div></div>') | |
var column1 = $('<dt>Codeship</dt>'); | |
var column2 = $('<dd><img src="'+url+'"/></dd>'); | |
row.append(column1); | |
row.append(column2); | |
$('.clearfix.description').after(row); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this script since the only way to integrate Codeship and Bitbucket, until today, was to follow this guide.
I didn't want to install an Heroku app just to see a badge on my Pull Request page on Bitbucket and since I already had plugin for my browser ready to inject javascript in pages I wrote this simple script.