Skip to content

Commit

Permalink
site build settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonsnir committed May 21, 2024
1 parent ebcb683 commit aa4e3c5
Show file tree
Hide file tree
Showing 15 changed files with 2,157 additions and 42 deletions.
5 changes: 4 additions & 1 deletion UPDATING_OPENAPI_JSON.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ This project uses a modified `openapi.json`. Please maintain these instructions
1. Remove all required properties from the `Repo` object (manual builds).
1. Remove the `domain` property from the `required` array of the `DnsZone` object.
1. Remove the `values`, `scopes` and `is_secret` parameters from the `updateEnvVar` operation.
1. Add a request body schema to the `updateEnvVar` operation, by copying it from an earlier version of the `openapi.json`.
1. Add a request body schema to the `updateEnvVar` operation, by copying it from an earlier version of the `openapi.json`.
1. Add a `package_path` property of type string to the `Repo` object.
1. Duplicate the `Site` object into `PartialSite` and remove the `required` properties.
1. Change `updateSite` operation to use the `PartialSite` object as the request body schema (NOTE: not the response body schema).
22 changes: 22 additions & 0 deletions examples/site_settings/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
terraform {
required_providers {
netlify = {
source = "registry.terraform.io/netlify/netlify"
}
}
required_version = ">= 1.6.0"
}

# `token` comes from NETLIFY_API_TOKEN, but can be specified with a Terraform variable
provider "netlify" {}

data "netlify_site" "platform_test" {
account_slug = "ramon-test-1"
name = "platform-test-1"
}

resource "netlify_site_build_settings" "platform_test" {
site_id = data.netlify_site.platform_test.id
build_command = "npm run build"
publish_directory = "dist"
}
1 change: 1 addition & 0 deletions internal/netlifyapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ model_organization_account.go
model_outgoing_hook.go
model_outgoing_hook_type.go
model_outgoing_hook_type_fields_inner.go
model_partial_site.go
model_payment_method.go
model_payment_method_data.go
model_plugin.go
Expand Down
194 changes: 179 additions & 15 deletions internal/netlifyapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4088,7 +4088,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
$ref: '#/components/schemas/PartialSite'
description: ""
required: true
responses:
Expand Down Expand Up @@ -9667,29 +9667,30 @@ components:
Repo:
description: Repo model definition
example:
repo_url: repo_url
repo_type: repo_type
stop_builds: true
skip_automatic_builds: true
deploy_key_id: deploy_key_id
created_at: 2000-01-23T04:56:07.000+00:00
installation_id: 0
dir: dir
env: "{}"
repo_branch: repo_branch
base_rel_dir: true
private_logs: true
allowed_branches:
- allowed_branches
- allowed_branches
functions_dir: functions_dir
repo_path: repo_path
untrusted_flow: untrusted_flow
skip_prs: true
updated_at: 2000-01-23T04:56:07.000+00:00
provider: provider
public_repo: true
repo_owner_type: repo_owner_type
repo_url: repo_url
stop_builds: true
package_path: package_path
skip_automatic_builds: true
deploy_key_id: deploy_key_id
env: "{}"
repo_path: repo_path
untrusted_flow: untrusted_flow
cmd: cmd
base: base
configuration_file_path: configuration_file_path
Expand Down Expand Up @@ -9719,6 +9720,8 @@ components:
type: string
installation_id:
type: integer
package_path:
type: string
private_logs:
type: boolean
provider:
Expand Down Expand Up @@ -10063,29 +10066,30 @@ components:
capabilities: "{}"
admin_url: admin_url
build_settings:
repo_url: repo_url
repo_type: repo_type
stop_builds: true
skip_automatic_builds: true
deploy_key_id: deploy_key_id
created_at: 2000-01-23T04:56:07.000+00:00
installation_id: 0
dir: dir
env: "{}"
repo_branch: repo_branch
base_rel_dir: true
private_logs: true
allowed_branches:
- allowed_branches
- allowed_branches
functions_dir: functions_dir
repo_path: repo_path
untrusted_flow: untrusted_flow
skip_prs: true
updated_at: 2000-01-23T04:56:07.000+00:00
provider: provider
public_repo: true
repo_owner_type: repo_owner_type
repo_url: repo_url
stop_builds: true
package_path: package_path
skip_automatic_builds: true
deploy_key_id: deploy_key_id
env: "{}"
repo_path: repo_path
untrusted_flow: untrusted_flow
cmd: cmd
base: base
configuration_file_path: configuration_file_path
Expand Down Expand Up @@ -10230,6 +10234,166 @@ components:
- state
- updated_at
- url
PartialSite:
description: Site model definition
example:
sso_login: true
id_domain: id_domain
deploy_url: deploy_url
deploy_hook: deploy_hook
created_at: 2000-01-23T04:56:07.000+00:00
sso_login_context: sso_login_context
domain_aliases:
- domain_aliases
- domain_aliases
password: password
updated_at: 2000-01-23T04:56:07.000+00:00
password_hash: password_hash
account_name: account_name
deploy_retention_in_days: 6.027456183070403
id: id
state: state
plan: plan
default_domain: default_domain
custom_domain: custom_domain
deploy_preview_custom_domain: deploy_preview_custom_domain
managed_dns: true
force_ssl: true
notification_email: notification_email
capabilities: "{}"
admin_url: admin_url
build_settings:
repo_type: repo_type
created_at: 2000-01-23T04:56:07.000+00:00
installation_id: 0
dir: dir
repo_branch: repo_branch
base_rel_dir: true
private_logs: true
allowed_branches:
- allowed_branches
- allowed_branches
functions_dir: functions_dir
skip_prs: true
updated_at: 2000-01-23T04:56:07.000+00:00
provider: provider
public_repo: true
repo_owner_type: repo_owner_type
repo_url: repo_url
stop_builds: true
package_path: package_path
skip_automatic_builds: true
deploy_key_id: deploy_key_id
env: "{}"
repo_path: repo_path
untrusted_flow: untrusted_flow
cmd: cmd
base: base
configuration_file_path: configuration_file_path
password_context: password_context
url: url
labels:
- account_id: account_id
color: color
name: name
description: description
id: id
- account_id: account_id
color: color
name: name
description: description
id: id
account_slug: account_slug
account_id: account_id
ssl_url: ssl_url
name: name
processing_settings:
html:
pretty_urls: true
ignore_html_forms: true
build_image: build_image
branch_deploy_custom_domain: branch_deploy_custom_domain
screenshot_url: screenshot_url
build_timelimit: 0.8008281904610115
properties:
id:
type: string
plan:
type: string
name:
type: string
default_domain:
type: string
custom_domain:
type: string
branch_deploy_custom_domain:
type: string
deploy_preview_custom_domain:
type: string
domain_aliases:
items:
type: string
type: array
password:
type: string
password_context:
type: string
password_hash:
type: string
sso_login:
type: boolean
sso_login_context:
type: string
notification_email:
type: string
url:
type: string
admin_url:
type: string
deploy_url:
type: string
state:
type: string
screenshot_url:
type: string
created_at:
format: date-time
type: string
updated_at:
format: date-time
type: string
ssl_url:
type: string
force_ssl:
type: boolean
build_settings:
$ref: '#/components/schemas/Repo'
processing_settings:
$ref: '#/components/schemas/Site_processing_settings'
deploy_hook:
type: string
managed_dns:
type: boolean
account_id:
type: string
account_slug:
type: string
account_name:
type: string
capabilities:
type: object
id_domain:
type: string
build_image:
type: string
build_timelimit:
type: number
deploy_retention_in_days:
type: number
labels:
items:
$ref: '#/components/schemas/SiteLabel'
type: array
SitesSummary:
description: SitesSummary model definition
properties:
Expand Down
12 changes: 6 additions & 6 deletions internal/netlifyapi/api_sites.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aa4e3c5

Please sign in to comment.