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

Fix Circle CI Integration | Circle CI API v1.1 #798

Merged
merged 2 commits into from
Oct 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ <h3 id="build"> Build </h3>
<td><code>https://img.shields.io/magnumci/ci/96ffb83fa700f069024921b0702e76ff/new-meta.svg</code></td>
</tr>
<tr><th> CircleCI: </th>
<td><img src='https://img.shields.io/circleci/project/BrightFlair/PHP.Gt.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/BrightFlair/PHP.Gt.svg</code></td>
<td><img src='https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg</code></td>
</tr>
<tr><th> CircleCI branch: </th>
<td><img src='https://img.shields.io/circleci/project/BrightFlair/PHP.Gt/master.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/BrightFlair/PHP.Gt/master.svg</code></td>
<td><img src='https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg</code></td>
</tr>
<tr><th> CircleCI token: </th>
<td><img src='https://img.shields.io/circleci/project/BrightFlair/PHP.Gt/master.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/token/YOURTOKEN/project/BrightFlair/PHP.Gt/master.svg</code></td>
<td><img src='https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg?maxAge=2592000' alt=''/></td>
<td><code>https://img.shields.io/circleci/token/YOURTOKEN/project/github/RedSparr0w/node-csgo-parser/master.svg</code></td>
</tr>
<tr><th data-doc='visualStudioTeamServices'> Visual Studio Team services: </th>
<td><img src='https://img.shields.io/vso/build/larsbrinkhoff/953a34b9-5966-4923-a48a-c41874cfb5f5/1.svg?maxAge=2592000' alt=''/></td>
Expand Down
13 changes: 7 additions & 6 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4479,15 +4479,16 @@ cache(function(data, match, sendBadge, request) {

// CircleCI build integration.
// https://circleci.com/api/v1/project/BrightFlair/PHP.Gt?circle-token=0a5143728784b263d9f0238b8d595522689b3af2&limit=1&filter=completed
camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(github|bitbucket)?[+\/]?([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var token = match[1]
var userRepo = match[2]; // eg, `BrightFlair/PHP.Gt`.
var branch = match[3];
var format = match[4];
var token = match[1];
var type = match[2] || 'github'; // github OR bitbucket
var userRepo = match[3]; // eg, `RedSparr0w/node-csgo-parser`.
var branch = match[4]
var format = match[5];

// Base API URL
var apiUrl = 'https://circleci.com/api/v1/project/' + userRepo;
var apiUrl = 'https://circleci.com/api/v1.1/project/' + type + '/' + userRepo;

// Query Params
queryParams = {};
Expand Down
12 changes: 6 additions & 6 deletions try.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ <h3 id="build"> Build </h3>
<td><code>https://img.shields.io/magnumci/ci/96ffb83fa700f069024921b0702e76ff/new-meta.svg</code></td>
</tr>
<tr><th> CircleCI: </th>
<td><img src='/circleci/project/BrightFlair/PHP.Gt.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/BrightFlair/PHP.Gt.svg</code></td>
<td><img src='/circleci/project/github/RedSparr0w/node-csgo-parser.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg</code></td>
</tr>
<tr><th> CircleCI branch: </th>
<td><img src='/circleci/project/BrightFlair/PHP.Gt/master.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/BrightFlair/PHP.Gt/master.svg</code></td>
<td><img src='/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg</code></td>
</tr>
<tr><th> CircleCI token: </th>
<td><img src='/circleci/project/BrightFlair/PHP.Gt/master.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/token/YOURTOKEN/project/BrightFlair/PHP.Gt/master.svg</code></td>
<td><img src='/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg' alt=''/></td>
<td><code>https://img.shields.io/circleci/token/YOURTOKEN/project/github/RedSparr0w/node-csgo-parser/master.svg</code></td>
</tr>
<tr><th data-doc='visualStudioTeamServices'> Visual Studio Team services: </th>
<td><img src='/vso/build/larsbrinkhoff/953a34b9-5966-4923-a48a-c41874cfb5f5/1.svg' alt=''/></td>
Expand Down