Skip to content

Commit 973f0d7

Browse files
committed
site build settings
1 parent ebcb683 commit 973f0d7

File tree

17 files changed

+2193
-42
lines changed

17 files changed

+2193
-42
lines changed

UPDATING_OPENAPI_JSON.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ This project uses a modified `openapi.json`. Please maintain these instructions
1010
1. Remove all required properties from the `Repo` object (manual builds).
1111
1. Remove the `domain` property from the `required` array of the `DnsZone` object.
1212
1. Remove the `values`, `scopes` and `is_secret` parameters from the `updateEnvVar` operation.
13-
1. Add a request body schema to the `updateEnvVar` operation, by copying it from an earlier version of the `openapi.json`.
13+
1. Add a request body schema to the `updateEnvVar` operation, by copying it from an earlier version of the `openapi.json`.
14+
1. Add a `package_path` property of type string to the `Repo` object.
15+
1. Duplicate the `Site` object into `PartialSite` and remove the `required` properties.
16+
1. Change `updateSite` operation to use the `PartialSite` object as the request body schema (NOTE: not the response body schema).

docs/data-sources/site.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ description: |-
2424

2525
- `custom_domain` (String)
2626
- `domain_aliases` (List of String)
27+
- `git_deploy_key` (String)
2728
- `id` (String) The ID of this resource.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "netlify_site_build_settings Resource - netlify"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# netlify_site_build_settings (Resource)
10+
11+
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `build_command` (String)
21+
- `publish_directory` (String)
22+
- `site_id` (String)
23+
24+
### Optional
25+
26+
- `base_directory` (String)
27+
- `build_image` (String)
28+
- `functions_directory` (String)
29+
- `package_directory` (String)
30+
- `pretty_urls` (Boolean)
31+
- `stop_builds` (Boolean)
32+
33+
### Read-Only
34+
35+
- `last_updated` (String)

examples/site_settings/main.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
terraform {
2+
required_providers {
3+
netlify = {
4+
source = "registry.terraform.io/netlify/netlify"
5+
}
6+
}
7+
required_version = ">= 1.6.0"
8+
}
9+
10+
# `token` comes from NETLIFY_API_TOKEN, but can be specified with a Terraform variable
11+
provider "netlify" {}
12+
13+
data "netlify_site" "platform_test" {
14+
account_slug = "ramon-test-1"
15+
name = "platform-test-1"
16+
}
17+
18+
resource "netlify_site_build_settings" "platform_test" {
19+
site_id = data.netlify_site.platform_test.id
20+
build_command = "npm run build"
21+
publish_directory = "dist"
22+
}

internal/netlifyapi/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ model_organization_account.go
164164
model_outgoing_hook.go
165165
model_outgoing_hook_type.go
166166
model_outgoing_hook_type_fields_inner.go
167+
model_partial_site.go
167168
model_payment_method.go
168169
model_payment_method_data.go
169170
model_plugin.go

internal/netlifyapi/api/openapi.yaml

Lines changed: 179 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,7 @@ paths:
40884088
content:
40894089
application/json:
40904090
schema:
4091-
$ref: '#/components/schemas/Site'
4091+
$ref: '#/components/schemas/PartialSite'
40924092
description: ""
40934093
required: true
40944094
responses:
@@ -9667,29 +9667,30 @@ components:
96679667
Repo:
96689668
description: Repo model definition
96699669
example:
9670-
repo_url: repo_url
96719670
repo_type: repo_type
9672-
stop_builds: true
9673-
skip_automatic_builds: true
9674-
deploy_key_id: deploy_key_id
96759671
created_at: 2000-01-23T04:56:07.000+00:00
96769672
installation_id: 0
96779673
dir: dir
9678-
env: "{}"
96799674
repo_branch: repo_branch
96809675
base_rel_dir: true
96819676
private_logs: true
96829677
allowed_branches:
96839678
- allowed_branches
96849679
- allowed_branches
96859680
functions_dir: functions_dir
9686-
repo_path: repo_path
9687-
untrusted_flow: untrusted_flow
96889681
skip_prs: true
96899682
updated_at: 2000-01-23T04:56:07.000+00:00
96909683
provider: provider
96919684
public_repo: true
96929685
repo_owner_type: repo_owner_type
9686+
repo_url: repo_url
9687+
stop_builds: true
9688+
package_path: package_path
9689+
skip_automatic_builds: true
9690+
deploy_key_id: deploy_key_id
9691+
env: "{}"
9692+
repo_path: repo_path
9693+
untrusted_flow: untrusted_flow
96939694
cmd: cmd
96949695
base: base
96959696
configuration_file_path: configuration_file_path
@@ -9719,6 +9720,8 @@ components:
97199720
type: string
97209721
installation_id:
97219722
type: integer
9723+
package_path:
9724+
type: string
97229725
private_logs:
97239726
type: boolean
97249727
provider:
@@ -10063,29 +10066,30 @@ components:
1006310066
capabilities: "{}"
1006410067
admin_url: admin_url
1006510068
build_settings:
10066-
repo_url: repo_url
1006710069
repo_type: repo_type
10068-
stop_builds: true
10069-
skip_automatic_builds: true
10070-
deploy_key_id: deploy_key_id
1007110070
created_at: 2000-01-23T04:56:07.000+00:00
1007210071
installation_id: 0
1007310072
dir: dir
10074-
env: "{}"
1007510073
repo_branch: repo_branch
1007610074
base_rel_dir: true
1007710075
private_logs: true
1007810076
allowed_branches:
1007910077
- allowed_branches
1008010078
- allowed_branches
1008110079
functions_dir: functions_dir
10082-
repo_path: repo_path
10083-
untrusted_flow: untrusted_flow
1008410080
skip_prs: true
1008510081
updated_at: 2000-01-23T04:56:07.000+00:00
1008610082
provider: provider
1008710083
public_repo: true
1008810084
repo_owner_type: repo_owner_type
10085+
repo_url: repo_url
10086+
stop_builds: true
10087+
package_path: package_path
10088+
skip_automatic_builds: true
10089+
deploy_key_id: deploy_key_id
10090+
env: "{}"
10091+
repo_path: repo_path
10092+
untrusted_flow: untrusted_flow
1008910093
cmd: cmd
1009010094
base: base
1009110095
configuration_file_path: configuration_file_path
@@ -10230,6 +10234,166 @@ components:
1023010234
- state
1023110235
- updated_at
1023210236
- url
10237+
PartialSite:
10238+
description: Site model definition
10239+
example:
10240+
sso_login: true
10241+
id_domain: id_domain
10242+
deploy_url: deploy_url
10243+
deploy_hook: deploy_hook
10244+
created_at: 2000-01-23T04:56:07.000+00:00
10245+
sso_login_context: sso_login_context
10246+
domain_aliases:
10247+
- domain_aliases
10248+
- domain_aliases
10249+
password: password
10250+
updated_at: 2000-01-23T04:56:07.000+00:00
10251+
password_hash: password_hash
10252+
account_name: account_name
10253+
deploy_retention_in_days: 6.027456183070403
10254+
id: id
10255+
state: state
10256+
plan: plan
10257+
default_domain: default_domain
10258+
custom_domain: custom_domain
10259+
deploy_preview_custom_domain: deploy_preview_custom_domain
10260+
managed_dns: true
10261+
force_ssl: true
10262+
notification_email: notification_email
10263+
capabilities: "{}"
10264+
admin_url: admin_url
10265+
build_settings:
10266+
repo_type: repo_type
10267+
created_at: 2000-01-23T04:56:07.000+00:00
10268+
installation_id: 0
10269+
dir: dir
10270+
repo_branch: repo_branch
10271+
base_rel_dir: true
10272+
private_logs: true
10273+
allowed_branches:
10274+
- allowed_branches
10275+
- allowed_branches
10276+
functions_dir: functions_dir
10277+
skip_prs: true
10278+
updated_at: 2000-01-23T04:56:07.000+00:00
10279+
provider: provider
10280+
public_repo: true
10281+
repo_owner_type: repo_owner_type
10282+
repo_url: repo_url
10283+
stop_builds: true
10284+
package_path: package_path
10285+
skip_automatic_builds: true
10286+
deploy_key_id: deploy_key_id
10287+
env: "{}"
10288+
repo_path: repo_path
10289+
untrusted_flow: untrusted_flow
10290+
cmd: cmd
10291+
base: base
10292+
configuration_file_path: configuration_file_path
10293+
password_context: password_context
10294+
url: url
10295+
labels:
10296+
- account_id: account_id
10297+
color: color
10298+
name: name
10299+
description: description
10300+
id: id
10301+
- account_id: account_id
10302+
color: color
10303+
name: name
10304+
description: description
10305+
id: id
10306+
account_slug: account_slug
10307+
account_id: account_id
10308+
ssl_url: ssl_url
10309+
name: name
10310+
processing_settings:
10311+
html:
10312+
pretty_urls: true
10313+
ignore_html_forms: true
10314+
build_image: build_image
10315+
branch_deploy_custom_domain: branch_deploy_custom_domain
10316+
screenshot_url: screenshot_url
10317+
build_timelimit: 0.8008281904610115
10318+
properties:
10319+
id:
10320+
type: string
10321+
plan:
10322+
type: string
10323+
name:
10324+
type: string
10325+
default_domain:
10326+
type: string
10327+
custom_domain:
10328+
type: string
10329+
branch_deploy_custom_domain:
10330+
type: string
10331+
deploy_preview_custom_domain:
10332+
type: string
10333+
domain_aliases:
10334+
items:
10335+
type: string
10336+
type: array
10337+
password:
10338+
type: string
10339+
password_context:
10340+
type: string
10341+
password_hash:
10342+
type: string
10343+
sso_login:
10344+
type: boolean
10345+
sso_login_context:
10346+
type: string
10347+
notification_email:
10348+
type: string
10349+
url:
10350+
type: string
10351+
admin_url:
10352+
type: string
10353+
deploy_url:
10354+
type: string
10355+
state:
10356+
type: string
10357+
screenshot_url:
10358+
type: string
10359+
created_at:
10360+
format: date-time
10361+
type: string
10362+
updated_at:
10363+
format: date-time
10364+
type: string
10365+
ssl_url:
10366+
type: string
10367+
force_ssl:
10368+
type: boolean
10369+
build_settings:
10370+
$ref: '#/components/schemas/Repo'
10371+
processing_settings:
10372+
$ref: '#/components/schemas/Site_processing_settings'
10373+
deploy_hook:
10374+
type: string
10375+
managed_dns:
10376+
type: boolean
10377+
account_id:
10378+
type: string
10379+
account_slug:
10380+
type: string
10381+
account_name:
10382+
type: string
10383+
capabilities:
10384+
type: object
10385+
id_domain:
10386+
type: string
10387+
build_image:
10388+
type: string
10389+
build_timelimit:
10390+
type: number
10391+
deploy_retention_in_days:
10392+
type: number
10393+
labels:
10394+
items:
10395+
$ref: '#/components/schemas/SiteLabel'
10396+
type: array
1023310397
SitesSummary:
1023410398
description: SitesSummary model definition
1023510399
properties:

internal/netlifyapi/api_sites.go

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

0 commit comments

Comments
 (0)