Skip to content

Commit a9ec5d2

Browse files
committed
Complete site's build settings.
The build settings is basically a repository into object underneath. This changes the definition to reuse the RepoInfo struct. `repo_branch` is used a read/write attribute to set the production branch for a site. Signed-off-by: David Calavera <[email protected]>
1 parent b941e7b commit a9ec5d2

File tree

5 files changed

+150
-110
lines changed

5 files changed

+150
-110
lines changed

go/models/repo_info.go

Lines changed: 121 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/models/site.go

Lines changed: 1 addition & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/models/site_setup.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,25 +1406,14 @@ definitions:
14061406
pretty_urls:
14071407
type: boolean
14081408
build_settings:
1409-
type: object
1410-
properties:
1411-
branch:
1412-
type: string
1413-
dir:
1414-
type: string
1415-
cmd:
1416-
type: string
1417-
allowed_branches:
1418-
type: array
1419-
items:
1420-
type: string
1409+
$ref: "#/definitions/repoInfo"
14211410
siteSetup:
14221411
allOf:
14231412
- $ref: "#/definitions/site"
14241413
- properties:
14251414
repo:
1426-
$ref: "#/definitions/repoSetup"
1427-
repoSetup:
1415+
$ref: "#/definitions/repoInfo"
1416+
repoInfo:
14281417
type: object
14291418
properties:
14301419
id:
@@ -1435,7 +1424,7 @@ definitions:
14351424
type: string
14361425
repo:
14371426
type: string
1438-
branch:
1427+
repo_branch:
14391428
type: string
14401429
dir:
14411430
type: string
@@ -1449,6 +1438,12 @@ definitions:
14491438
type: boolean
14501439
private_logs:
14511440
type: boolean
1441+
repo_url:
1442+
type: string
1443+
env:
1444+
type: object
1445+
additionalProperties:
1446+
type: string
14521447
submission:
14531448
type: object
14541449
properties:

ui/swagger.json

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,7 +2752,7 @@
27522752
}
27532753
}
27542754
},
2755-
"repoSetup": {
2755+
"repoInfo": {
27562756
"type": "object",
27572757
"properties": {
27582758
"allowed_branches": {
@@ -2761,9 +2761,6 @@
27612761
"type": "string"
27622762
}
27632763
},
2764-
"branch": {
2765-
"type": "string"
2766-
},
27672764
"cmd": {
27682765
"type": "string"
27692766
},
@@ -2773,6 +2770,12 @@
27732770
"dir": {
27742771
"type": "string"
27752772
},
2773+
"env": {
2774+
"type": "object",
2775+
"additionalProperties": {
2776+
"type": "string"
2777+
}
2778+
},
27762779
"id": {
27772780
"type": "integer"
27782781
},
@@ -2787,6 +2790,12 @@
27872790
},
27882791
"repo": {
27892792
"type": "string"
2793+
},
2794+
"repo_branch": {
2795+
"type": "string"
2796+
},
2797+
"repo_url": {
2798+
"type": "string"
27902799
}
27912800
}
27922801
},
@@ -2803,24 +2812,7 @@
28032812
"type": "string"
28042813
},
28052814
"build_settings": {
2806-
"type": "object",
2807-
"properties": {
2808-
"allowed_branches": {
2809-
"type": "array",
2810-
"items": {
2811-
"type": "string"
2812-
}
2813-
},
2814-
"branch": {
2815-
"type": "string"
2816-
},
2817-
"cmd": {
2818-
"type": "string"
2819-
},
2820-
"dir": {
2821-
"type": "string"
2822-
}
2823-
}
2815+
"$ref": "#/definitions/repoInfo"
28242816
},
28252817
"capabilities": {
28262818
"type": "object",
@@ -2939,7 +2931,7 @@
29392931
{
29402932
"properties": {
29412933
"repo": {
2942-
"$ref": "#/definitions/repoSetup"
2934+
"$ref": "#/definitions/repoInfo"
29432935
}
29442936
}
29452937
}

0 commit comments

Comments
 (0)