@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user