Skip to content

Commit

Permalink
WIP migrate docker from examples to openApi
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Sep 10, 2023
1 parent 015b5b0 commit 388988f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
27 changes: 17 additions & 10 deletions services/docker/docker-cloud-automated.service.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { BaseJsonService } from '../index.js'
import { BaseJsonService, pathParams } from '../index.js'
import { dockerBlue, buildDockerUrl } from './docker-helpers.js'
import { fetchBuild } from './docker-cloud-common-fetch.js'

export default class DockerCloudAutomatedBuild extends BaseJsonService {
static category = 'build'
static route = buildDockerUrl('cloud/automated')
static examples = [
{
title: 'Docker Cloud Automated build',
documentation: '<p>For the new Docker Hub (https://cloud.docker.com)</p>',
namedParams: {
user: 'jrottenberg',
repo: 'ffmpeg',
static openApi = {
'/docker/cloud/automated/{user}/{repo}': {
get: {
summary: 'Docker Cloud Automated build',
description: '<p>For the new Docker Hub (https://cloud.docker.com)</p>',
parameters: pathParams(
{
name: 'user',
example: 'jrottenberg',
},
{
name: 'repo',
example: 'ffmpeg',
},
),
},
staticPreview: this.render({ buildSettings: ['test'] }),
},
]
}

static _cacheLength = 14400

Expand Down
27 changes: 17 additions & 10 deletions services/docker/docker-cloud-build.service.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { BaseJsonService, NotFound } from '../index.js'
import { BaseJsonService, NotFound, pathParams } from '../index.js'
import { dockerBlue, buildDockerUrl } from './docker-helpers.js'
import { fetchBuild } from './docker-cloud-common-fetch.js'

export default class DockerCloudBuild extends BaseJsonService {
static category = 'build'
static route = buildDockerUrl('cloud/build')
static examples = [
{
title: 'Docker Cloud Build Status',
documentation: '<p>For the new Docker Hub (https://cloud.docker.com)</p>',
namedParams: {
user: 'jrottenberg',
repo: 'ffmpeg',
static openApi = {
'/docker/cloud/build/{user}/{repo}': {
get: {
summary: 'Docker Cloud Build Status',
description: '<p>For the new Docker Hub (https://cloud.docker.com)</p>',
parameters: pathParams(
{
name: 'user',
example: 'jrottenberg',
},
{
name: 'repo',
example: 'ffmpeg',
},
),
},
staticPreview: this.render({ state: 'Success' }),
},
]
}

static defaultBadgeData = { label: 'docker build' }

Expand Down

0 comments on commit 388988f

Please sign in to comment.