Move build badge examples into services/ (#2234)
all-badge-examples is a common cause of merge conflicts. It’s difficult to adjust the badge categorization in that file – or to understand the diff – because it requires moving a block from one point to another. It’s much easier to edit a badge’s category in one place. This starts the process of breaking up what’s left of that file, following up on the work from #1931. New-style services can only be in one category, which means legacy service examples have to be split along category lines. I split out separate legacy service classes where I could do so easily, leaving behind the ones which require more work, for one reason or another.
This commit is contained in:
@@ -5,6 +5,26 @@ const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
|
||||
const serverSecrets = require('../../lib/server-secrets')
|
||||
|
||||
module.exports = class JenkinsBuild extends LegacyService {
|
||||
static get category() {
|
||||
return 'build'
|
||||
}
|
||||
|
||||
static get url() {
|
||||
return {
|
||||
base: 'jenkins/s',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Jenkins',
|
||||
previewUrl:
|
||||
'https/jenkins.qa.ubuntu.com/view/Precise/view/All%20Precise/job/precise-desktop-amd64_default',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static registerLegacyRouteHandler({ camp, cache }) {
|
||||
camp.route(
|
||||
/^\/jenkins(?:-ci)?\/s\/(http(?:s)?)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
|
||||
|
||||
@@ -7,6 +7,25 @@ const { addv: versionText } = require('../../lib/text-formatters')
|
||||
const { version: versionColor } = require('../../lib/color-formatters')
|
||||
|
||||
module.exports = class JenkinsPlugin extends LegacyService {
|
||||
static get category() {
|
||||
return 'version'
|
||||
}
|
||||
|
||||
static get url() {
|
||||
return {
|
||||
base: 'jenkins/plugin/v',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Jenkins Plugins',
|
||||
previewUrl: 'blueocean',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static registerLegacyRouteHandler({ camp, cache }) {
|
||||
camp.route(
|
||||
/^\/jenkins\/plugin\/v\/(.*)\.(svg|png|gif|jpg|json)$/,
|
||||
|
||||
@@ -5,6 +5,26 @@ const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
|
||||
const serverSecrets = require('../../lib/server-secrets')
|
||||
|
||||
module.exports = class JenkinsTests extends LegacyService {
|
||||
static get category() {
|
||||
return 'build'
|
||||
}
|
||||
|
||||
static get url() {
|
||||
return {
|
||||
base: 'jenkins/t',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Jenkins tests',
|
||||
previewUrl:
|
||||
'https/jenkins.qa.ubuntu.com/view/Precise/view/All%20Precise/job/precise-desktop-amd64_default',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static registerLegacyRouteHandler({ camp, cache }) {
|
||||
camp.route(
|
||||
/^\/jenkins(?:-ci)?\/t\/(http(?:s)?)\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
|
||||
|
||||
Reference in New Issue
Block a user