Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for shippable #462

Merged
merged 1 commit into from
Jun 6, 2015
Merged

added support for shippable #462

merged 1 commit into from
Jun 6, 2015

Conversation

caarlos0
Copy link
Contributor

@caarlos0 caarlos0 commented Jun 4, 2015

I wasn't able to test it in my machine though (problems with node-gyp)...

Anyways, I think it should work that way..

@espadrine
Copy link
Member

You do need a couple of installed libraries to run shields: phantomjs and cairo (see here).

It would be preferable to avoid SVG scraping. Do you know if there are plans to support this in Shippable's standard API?

Your PR as it stands triggers an Internal Server Error in shippable's server.

cache(function(data, match, sendBadge, request) {
var project = match[2]; // eg, 54d119db5ab6cc13528ab183
var branch = match[3];
var format = match[4];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2, 3, 4? I think 1, 2, 3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sorry..

@espadrine espadrine merged commit bfaa37a into badges:master Jun 6, 2015
espadrine added a commit that referenced this pull request Jun 6, 2015
@espadrine
Copy link
Member

Thanks for contributing anywho!

@caarlos0 caarlos0 deleted the shippable branch June 6, 2015 13:24
@caarlos0
Copy link
Contributor Author

caarlos0 commented Jun 6, 2015

@espadrine thing is: for some reason I can't install cairo here.. got different errors every time...

Don't know about the shippable api..

Thanks!

@mahirk
Copy link
Contributor

mahirk commented Jul 28, 2015

@espadrine @caarlos0 it seems like this service no longer works, it requires adding a whitespace replace to fetchFromSvg

var badge = buffer.replace(/(?:\r\n\s|\r\s|\n\s)/g, '');
var match = />([^<>]+)<\/text><\/g>/.exec(badge);

Sending in a PR for the same

@caarlos0
Copy link
Contributor Author

@mahirk yeah, maybe they changed the API...

@@ -312,6 +312,41 @@ cache(function(data, match, sendBadge, request) {
});
}));

// Shippable integration
camp.route(/^\/shippable?\/([^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first ? seems unnecessary.

espadrine added a commit that referenced this pull request Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants