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

🚢 Deploy! #1742

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
400ae01
Add circleci logo (#1595)
Mar 25, 2018
0a24899
Only compute user/repo if suggesting badges for GitHub (#1601)
espadrine Mar 25, 2018
17ddd18
Skip Twitter suggestion if URL does not have protocol (#1604)
espadrine Mar 26, 2018
ed419b0
[microbadger] Fix tests (#1600)
PyvesB Mar 27, 2018
7e239f7
chore(package): update semver-regex to version 2.0.0 (#1596)
greenkeeper[bot] Mar 28, 2018
01646de
upgrade glob to be a prod dependency (#1619)
philipithomas Mar 28, 2018
16eea6d
Number support for version color formatter (#1615)
PyvesB Mar 29, 2018
1dff491
Added number support to version text formatter (#1620)
PyvesB Mar 29, 2018
ac7c418
Extract examples from new-style services (#1582)
paulmelnikow Mar 30, 2018
66c5d91
[CircleCI] Extended existing try-catch block (#1614)
PyvesB Mar 30, 2018
0d5b48b
"commits to be deployed" replaced "last deployed" (#1605)
platan Mar 30, 2018
57008d2
Test path escaping - mocha windows fix (#1627)
RedSparr0w Apr 1, 2018
c5884b1
Handled capitalization with empty keys (#1625)
PyvesB Apr 1, 2018
dd35739
[CodeClimate] Added missing try-catch block (#1613)
PyvesB Apr 1, 2018
f9b0aed
package-lock fixes for glob (#1633)
paulmelnikow Apr 2, 2018
724abd0
Update svgo to the latest version 🚀 (#1473)
greenkeeper[bot] Apr 2, 2018
416d433
[appveyor] Error handling in BaseService (#1590)
paulmelnikow Apr 2, 2018
3aa2130
[Ansible] Handle no data responses (#1629)
PyvesB Apr 2, 2018
a168072
[DotnetStatus] Service deprecation (#1630)
PyvesB Apr 2, 2018
f2efd75
Minor refactor of examples preparation (#1632)
paulmelnikow Apr 2, 2018
f98d17e
[SourceForge] Fixes, tests and cleaning up (#1626)
PyvesB Apr 2, 2018
c0bdf54
optimize cssColor check regex (#1602)
RedSparr0w Apr 4, 2018
47614e5
Add Stack Exchange logos (#1636)
rsp Apr 6, 2018
d56b696
Add [dynamic-yaml] badge (#1623)
jacobtomlinson Apr 8, 2018
e1755df
[vaadin-directory] Support `star` and `stars` endpoints (#1603)
binhbbui411 Apr 9, 2018
ac13fdb
[librariesio] Missing try/catch block and tests (#1644)
PyvesB Apr 14, 2018
d2a144e
update [pypi] to use warehouse (closes #1569) (#1648)
chris48s Apr 15, 2018
2ded83f
Documentation typos (#1647)
tbroadley Apr 15, 2018
8fda86f
set expires header corresponding to maxAge (#1651)
RedSparr0w Apr 22, 2018
da10896
Add NPM logo (#1656)
omrilotan Apr 22, 2018
f607ad7
Add [buildkite] service (#1657)
raulriera Apr 23, 2018
a24d42a
minor links fix (#1658)
andreaTP Apr 24, 2018
14bdaf3
[Codeship] fix status checking regexp & add new statuses (#1662)
zosiu Apr 26, 2018
2e87ed9
add codeship logo (#1663)
RedSparr0w Apr 28, 2018
714df8f
change CC0 example in GH service tests (#1634)
chris48s Apr 28, 2018
b126b4e
checkErrorResponse documented in service tests (#1670)
platan May 2, 2018
8fcc13d
refactor [cdnjs] integration (#1668)
chris48s May 4, 2018
45ff94d
Add [LGTM] service (#1672)
s0 May 5, 2018
0ef1c94
open badge links in new tab (#1667)
chris48s May 5, 2018
726dc9d
Add LGTM logo (#1673)
s0 May 5, 2018
3518b64
[MicroBadger] Fixed tests (#1677)
PyvesB May 7, 2018
6dab822
checkErrorResponse documented in the tutorial (#1675)
platan May 9, 2018
f43096a
replace lgtm logo with improved one (#1679)
s0 May 10, 2018
b5635bf
[gem cdnjs appveyor] refactor ruby gems service (#1680)
chris48s May 10, 2018
4f8414c
Add grade badge for [lgtm] (#1681)
s0 May 12, 2018
bf53e61
[cdnjs gem] make exception classes more consistent (#1683)
chris48s May 15, 2018
d51ae90
Bugfix: override colorB in [docker] badges (#1690)
platan May 16, 2018
c76e221
[david] add support for path (#1687)
rraziel May 17, 2018
37617c1
Add Liberapay logo (#1692)
mattbk May 18, 2018
498684c
Adapt to new JSON API of formulae.brew.sh (#1684)
koraktor May 21, 2018
c6b6183
Update pretty-bytes to the latest version 🚀 (#1676)
greenkeeper[bot] May 21, 2018
3ff98bf
update request (#1695)
chris48s May 22, 2018
5d4ab86
upgrade to Joi 13.3.0 (#1696)
chris48s May 22, 2018
960c5bf
upgrade sinon (#1697)
chris48s May 22, 2018
8ba33d4
[bower clojars] version() should throw on invalid inputs (#1705)
chris48s May 28, 2018
de4e527
service tests for [libscore], improve error handling (#1706)
chris48s May 29, 2018
7c7c9f5
Ensure both docker CMDs are invoked (#1686)
elordahl May 30, 2018
9d90bd1
[github] Commit merge status badge (#1709)
platan May 30, 2018
57a1bf2
add more rules to dangerfile (#1703)
chris48s May 30, 2018
e6559a0
fix typescript regex in [npm] tests (#1712)
chris48s Jun 2, 2018
f4ea029
service tests for Arch Linux [aur] (#1707)
chris48s Jun 2, 2018
83007a0
Update nyc to the latest version 🚀 (#1716)
greenkeeper[bot] Jun 3, 2018
707ada3
Update snap-shot-it to the latest version 🚀 (#1715)
greenkeeper[bot] Jun 3, 2018
fa52c04
allow 0 for cocoapods weekly downloads (#1713)
chris48s Jun 7, 2018
7f9102d
Add ReSharper gallery badge. (#1722)
matkoch Jun 9, 2018
b418235
Standard name in nuget v2 downloads badge (#1726)
platan Jun 10, 2018
e8980f7
fix 'not found' case in [node] badge (#1730)
chris48s Jun 10, 2018
67eb92e
fix [dub] service test (#1729)
chris48s Jun 10, 2018
124748e
Fix [codeclimate] tests (#1727)
chris48s Jun 10, 2018
1f92828
allow 0 in all [cocoapods] download tests (#1728)
chris48s Jun 13, 2018
2683f74
Required files added to now.json config (#1718)
platan Jun 15, 2018
12e0164
Probot workflow configuration with deployment status (#1724)
platan Jun 15, 2018
9612d5c
Update sinon to the latest version 🚀 (#1733)
greenkeeper[bot] Jun 16, 2018
fc3b793
extend for pr in title (#1720)
tooomm Jun 16, 2018
20b8d0c
BaseService: Query params (#1589)
paulmelnikow Jun 16, 2018
f78e6f1
[gem cdnjs appveyor clojars] refactor clojars, establish BaseJsonServ…
chris48s Jun 16, 2018
fa61247
Rewrite [npm] typedefs badge using new-style service (#1735)
paulmelnikow Jun 16, 2018
7cd3720
Update prettier to the latest version 🚀 (#1641)
greenkeeper[bot] Jun 16, 2018
4308b60
[Travis] Add travis-ci.com support (#1711)
Jun 17, 2018
028d8d7
Fix sinon deprecation warning (#1737)
paulmelnikow Jun 17, 2018
ca58d84
Add [dependabot] SemVer compatibility badge (#1734)
greysteil Jun 17, 2018
def1bc3
fix [sonar] legacy/unsupported service tests (#1741)
chris48s Jun 18, 2018
ec6d903
Test in now-released Node 10 instead of Node 9 (#1738)
paulmelnikow Jun 19, 2018
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
Prev Previous commit
Next Next commit
[Travis] Add travis-ci.com support (#1711)
  • Loading branch information
Ivan de la Beldad Fernandez authored and PyvesB committed Jun 17, 2018
commit 4308b60c8f37a9385e29636a911e7c920b03816a
14 changes: 12 additions & 2 deletions lib/all-badge-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,25 @@ const allBadgeExamples = [
},
examples: [
{
title: 'Travis',
title: 'Travis (.org)',
previewUri: '/travis/rust-lang/rust.svg',
exampleUri: '/travis/USER/REPO.svg'
},
{
title: 'Travis branch',
title: 'Travis (.org) branch',
previewUri: '/travis/rust-lang/rust/master.svg',
exampleUri: '/travis/USER/REPO/BRANCH.svg'
},
{
title: 'Travis (.com)',
previewUri: '/travis/com/ivandelabeldad/rackian-gateway.svg',
exampleUri: '/travis/com/USER/REPO.svg'
},
{
title: 'Travis (.com) branch',
previewUri: '/travis/com/ivandelabeldad/rackian-gateway/master.svg',
exampleUri: '/travis/com/USER/REPO/BRANCH.svg'
},
{
title: 'Wercker',
previewUri: '/wercker/ci/wercker/docs.svg'
Expand Down
28 changes: 14 additions & 14 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ cache(function(data, match, sendBadge, request) {
const format = match[3];
const options = {
method: 'GET',
uri: 'https://api.travis-ci.org/repos/' + userRepo + '/branches/' + version,
uri: `https://api.travis-ci.org/repos/${userRepo}/branches/${version}`,
};
const badgeData = getBadgeData('PHP', data);
getPhpReleases(githubAuth.request, (err, phpReleases) => {
Expand All @@ -339,7 +339,7 @@ cache(function(data, match, sendBadge, request) {
}
request(options, (err, res, buffer) => {
if (err !== null) {
log.error('Travis CI error: ' + err.stack);
log.error(`Travis CI error: ${err.stack}`);
if (res) {
log.error('' + res);
}
Expand Down Expand Up @@ -384,31 +384,32 @@ cache(function(data, match, sendBadge, request) {
});
}));

// Travis integration
camp.route(/^\/travis(-ci)?\/([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
// Travis integration (.org and .com)
camp.route(/^\/travis(-ci)?\/(?:(com)\/)?([^/]+\/[^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[2]; // eg, espadrine/sc
var branch = match[3];
var format = match[4];
var options = {
const travisDomain = match[2] || 'org'; // (com | org) org by default
const userRepo = match[3]; // eg, espadrine/sc
const branch = match[4];
const format = match[5];
const options = {
method: 'HEAD',
uri: 'https://api.travis-ci.org/' + userRepo + '.svg',
uri: `https://api.travis-ci.${travisDomain}/${userRepo}.svg`,
};
if (branch != null) {
options.uri += '?branch=' + branch;
options.uri += `?branch=${branch}`;
}
var badgeData = getBadgeData('build', data);
const badgeData = getBadgeData('build', data);
request(options, function(err, res) {
if (err != null) {
log.error('Travis error: ' + err.stack);
log.error(`Travis error: ${err.stack}`);
if (res) { log.error(''+res); }
}
if (checkErrorResponse(badgeData, err, res)) {
sendBadge(format, badgeData);
return;
}
try {
var state = res.headers['content-disposition']
const state = res.headers['content-disposition']
.match(/filename="(.+)\.svg"/)[1];
badgeData.text[1] = state;
if (state === 'passing') {
Expand All @@ -419,7 +420,6 @@ cache(function(data, match, sendBadge, request) {
badgeData.text[1] = state;
}
sendBadge(format, badgeData);

} catch(e) {
badgeData.text[1] = 'invalid';
sendBadge(format, badgeData);
Expand Down
32 changes: 32 additions & 0 deletions services/travis/travis.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@ t.create('connection error')
.networkOff()
.expectJSON({ name: 'build', value: 'inaccessible' });

// Travis (.com) CI

t.create('build status on default branch')
.get('/com/ivandelabeldad/rackian-gateway.json')
.expectJSONTypes(Joi.object().keys({
name: 'build',
value: Joi.equal('failing', 'passing', 'unknown')
}));

t.create('build status on named branch')
.get('/com/ivandelabeldad/rackian-gateway.json')
.expectJSONTypes(Joi.object().keys({
name: 'build',
value: Joi.equal('failing', 'passing', 'unknown')
}));

t.create('unknown repo')
.get('/com/this-repo/does-not-exist.json')
.expectJSON({ name: 'build', value: 'unknown' });

t.create('missing content-disposition header')
.get('/com/foo/bar.json')
.intercept(nock => nock('https://api.travis-ci.com')
.head('/foo/bar.svg')
.reply(200))
.expectJSON({ name: 'build', value: 'invalid' });

t.create('connection error')
.get('/com/foo/bar.json')
.networkOff()
.expectJSON({ name: 'build', value: 'inaccessible' });

// PHP version from .travis.yml

t.create('gets the package version of symfony')
Expand Down