Unify order of more services (#3358)

Ref #3353
This commit is contained in:
Paul Melnikow
2019-04-24 15:08:26 -04:00
committed by GitHub
parent 1dd8d1329c
commit f8aeb56129
76 changed files with 1298 additions and 1308 deletions

View File

@@ -5,21 +5,6 @@ const { dockerBlue, buildDockerUrl } = require('./docker-helpers')
const { fetchBuild } = require('./docker-cloud-common-fetch')
module.exports = class DockerCloudBuild extends BaseJsonService {
static render({ state }) {
if (state === 'Success') {
return { message: 'passing', color: 'brightgreen' }
}
if (state === 'Failed') {
return { message: 'failing', color: 'red' }
}
return { message: 'building', color: dockerBlue }
}
async handle({ user, repo }) {
const data = await fetchBuild(this, { user, repo })
return this.constructor.render({ state: data.objects[0].state })
}
static get category() {
return 'build'
}
@@ -28,10 +13,6 @@ module.exports = class DockerCloudBuild extends BaseJsonService {
return buildDockerUrl('cloud/build')
}
static get defaultBadgeData() {
return { label: 'docker build' }
}
static get examples() {
return [
{
@@ -46,4 +27,23 @@ module.exports = class DockerCloudBuild extends BaseJsonService {
},
]
}
static get defaultBadgeData() {
return { label: 'docker build' }
}
static render({ state }) {
if (state === 'Success') {
return { message: 'passing', color: 'brightgreen' }
}
if (state === 'Failed') {
return { message: 'failing', color: 'red' }
}
return { message: 'building', color: dockerBlue }
}
async handle({ user, repo }) {
const data = await fetchBuild(this, { user, repo })
return this.constructor.render({ state: data.objects[0].state })
}
}