这是indexloc提供的服务,不要输入任何密码
Skip to content

Git source new documentation #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions client/deployment_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ type DeploymentFile struct {
Sha string `json:"sha"`
Size int `json:"size"`
}
type GitSource struct {
RepoId string `json:"repoId"`
Ref string `json:"ref"`
Type string `json:"type"`
}

// CreateDeploymentRequest defines the request the Vercel API expects in order to create a deployment.
type CreateDeploymentRequest struct {
Expand All @@ -35,6 +40,7 @@ type CreateDeploymentRequest struct {
Regions []string `json:"regions,omitempty"`
Routes []interface{} `json:"routes,omitempty"`
Target string `json:"target,omitempty"`
GitSource GitSource `json:"gitSource,omitempty"`
}

// DeploymentResponse defines the response the Vercel API returns when a deployment is created or updated.
Expand All @@ -59,15 +65,16 @@ type DeploymentResponse struct {
Build struct {
Environment []string `json:"env"`
} `json:"build"`
AliasAssigned bool `json:"aliasAssigned"`
ChecksConclusion string `json:"checksConclusion"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
ID string `json:"id"`
ProjectID string `json:"projectId"`
ReadyState string `json:"readyState"`
Target *string `json:"target"`
URL string `json:"url"`
GitSource GitSource `json:"git_source"`
AliasAssigned bool `json:"aliasAssigned"`
ChecksConclusion string `json:"checksConclusion"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
ID string `json:"id"`
ProjectID string `json:"projectId"`
ReadyState string `json:"readyState"`
Target *string `json:"target"`
URL string `json:"url"`
}

// IsComplete is used to determine whether a deployment is still processing, or whether it is fully done.
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ resource "vercel_deployment" "example" {

### Required

- **path** (String) The path to the file on your filesystem. Note that the path is relative to the root of the terraform files.
- `path` (String) The path to the file on your filesystem. Note that the path is relative to the root of the terraform files.

### Read-Only

- **file** (Map of String) A map of filename to metadata about the file. The metadata contains the file size and hash, and allows a deployment to be created if the file changes.
- **id** (String) The ID of this resource.
- `file` (Map of String) A map of filename to metadata about the file. The metadata contains the file size and hash, and allows a deployment to be created if the file changes.
- `id` (String) The ID of this resource.


36 changes: 18 additions & 18 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,42 @@ output "project_id" {

### Required

- **name** (String) The name of the project.
- `name` (String) The name of the project.

### Optional

- **team_id** (String) The team ID the project exists beneath.
- `team_id` (String) The team ID the project exists beneath.

### Read-Only

- **build_command** (String) The build command for this project. If omitted, this value will be automatically detected.
- **dev_command** (String) The dev command for this project. If omitted, this value will be automatically detected.
- **environment** (Attributes Set) A list of environment variables that should be configured for the project. (see [below for nested schema](#nestedatt--environment))
- **framework** (String) The framework that is being used for this project. If omitted, no framework is selected.
- **git_repository** (Attributes) The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed. This requires the corresponding Vercel for [Github](https://vercel.com/docs/concepts/git/vercel-for-github), [Gitlab](https://vercel.com/docs/concepts/git/vercel-for-gitlab) or [Bitbucket](https://vercel.com/docs/concepts/git/vercel-for-bitbucket) plugins to be installed. (see [below for nested schema](#nestedatt--git_repository))
- **id** (String) The ID of this resource.
- **install_command** (String) The install command for this project. If omitted, this value will be automatically detected.
- **output_directory** (String) The output directory of the project. When null is used this value will be automatically detected.
- **public_source** (Boolean) Specifies whether the source code and logs of the deployments for this project should be public or not.
- **root_directory** (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root.
- `build_command` (String) The build command for this project. If omitted, this value will be automatically detected.
- `dev_command` (String) The dev command for this project. If omitted, this value will be automatically detected.
- `environment` (Attributes Set) A list of environment variables that should be configured for the project. (see [below for nested schema](#nestedatt--environment))
- `framework` (String) The framework that is being used for this project. If omitted, no framework is selected.
- `git_repository` (Attributes) The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed. This requires the corresponding Vercel for [Github](https://vercel.com/docs/concepts/git/vercel-for-github), [Gitlab](https://vercel.com/docs/concepts/git/vercel-for-gitlab) or [Bitbucket](https://vercel.com/docs/concepts/git/vercel-for-bitbucket) plugins to be installed. (see [below for nested schema](#nestedatt--git_repository))
- `id` (String) The ID of this resource.
- `install_command` (String) The install command for this project. If omitted, this value will be automatically detected.
- `output_directory` (String) The output directory of the project. When null is used this value will be automatically detected.
- `public_source` (Boolean) Specifies whether the source code and logs of the deployments for this project should be public or not.
- `root_directory` (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root.

<a id="nestedatt--environment"></a>
### Nested Schema for `environment`

Read-Only:

- **id** (String) The ID of the environment variable
- **key** (String) The name of the environment variable.
- **target** (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`.
- **value** (String) The value of the environment variable.
- `id` (String) The ID of the environment variable
- `key` (String) The name of the environment variable.
- `target` (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`.
- `value` (String) The value of the environment variable.


<a id="nestedatt--git_repository"></a>
### Nested Schema for `git_repository`

Read-Only:

- **repo** (String) The name of the git repository. For example: `vercel/next.js`.
- **type** (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`.
- `repo` (String) The name of the git repository. For example: `vercel/next.js`.
- `type` (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`.


6 changes: 3 additions & 3 deletions docs/data-sources/project_directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ resource "vercel_deployment" "example" {

### Required

- **path** (String) The path to the directory on your filesystem. Note that the path is relative to the root of the terraform files.
- `path` (String) The path to the directory on your filesystem. Note that the path is relative to the root of the terraform files.

### Read-Only

- **files** (Map of String) A map of filename to metadata about the file. The metadata contains the file size and hash, and allows a deployment to be created if the file changes.
- **id** (String) The ID of this resource.
- `files` (Map of String) A map of filename to metadata about the file. The metadata contains the file size and hash, and allows a deployment to be created if the file changes.
- `id` (String) The ID of this resource.


6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "Vercel Provider"
page_title: "vercel Provider"
subcategory: ""
description: |-
The Vercel provider is used to interact with resources supported by Vercel.
The provider needs to be configured with the proper credentials before it can be used.
Use the navigation to the left to read about the available resources.
---

# Vercel Provider
# vercel Provider

The Vercel provider is used to interact with resources supported by Vercel.
The provider needs to be configured with the proper credentials before it can be used.
Expand Down Expand Up @@ -42,4 +42,4 @@ provider "vercel" {

### Optional

- **api_token** (String, Sensitive) The Vercel API Token to use. This can also be specified with the `VERCEL_API_TOKEN` shell environment variable. Tokens can be created from your [Vercel settings](https://vercel.com/account/tokens).
- `api_token` (String, Sensitive) The Vercel API Token to use. This can also be specified with the `VERCEL_API_TOKEN` shell environment variable. Tokens can be created from your [Vercel settings](https://vercel.com/account/tokens).
41 changes: 26 additions & 15 deletions docs/resources/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,43 @@ resource "vercel_deployment" "example" {

### Required

- **files** (Map of String) A map of files to be uploaded for the deployment. This should be provided by a `vercel_project_directory` or `vercel_file` data source.
- **project_id** (String) The project ID to add the deployment to.
- `project_id` (String) The project ID to add the deployment to.

### Optional

- **environment** (Map of String) A map of environment variable names to values. These are specific to a Deployment, and can also be configured on the `vercel_project` resource.
- **path_prefix** (String) If specified then the `path_prefix` will be stripped from the start of file paths as they are uploaded to Vercel. If this is omitted, then any leading `../`s will be stripped.
- **production** (Boolean) true if the deployment is a production deployment, meaning production aliases will be assigned.
- **project_settings** (Attributes) Project settings that will be applied to the deployment. (see [below for nested schema](#nestedatt--project_settings))
- **team_id** (String) The team ID to add the deployment to.
- `environment` (Map of String) A map of environment variable names to values. These are specific to a Deployment, and can also be configured on the `vercel_project` resource.
- `files` (Map of String) A map of files to be uploaded for the deployment. This should be provided by a `vercel_project_directory` or `vercel_file` data source.
- `git_source` (Attributes) A map with the Git repo information (see [below for nested schema](#nestedatt--git_source))
- `path_prefix` (String) If specified then the `path_prefix` will be stripped from the start of file paths as they are uploaded to Vercel. If this is omitted, then any leading `../`s will be stripped.
- `production` (Boolean) true if the deployment is a production deployment, meaning production aliases will be assigned.
- `project_settings` (Attributes) Project settings that will be applied to the deployment. (see [below for nested schema](#nestedatt--project_settings))
- `team_id` (String) The team ID to add the deployment to.

### Read-Only

- **domains** (List of String) A list of all the domains (default domains, staging domains and production domains) that were assigned upon deployment creation.
- **id** (String) The ID of this resource.
- **url** (String) A unique URL that is automatically generated for a deployment.
- `domains` (List of String) A list of all the domains (default domains, staging domains and production domains) that were assigned upon deployment creation.
- `id` (String) The ID of this resource.
- `url` (String) A unique URL that is automatically generated for a deployment.

<a id="nestedatt--git_source"></a>
### Nested Schema for `git_source`

Optional:

- `ref` (String) Branch or commit hash
- `repo_id` (String) Frontend git repo ID
- `type` (String) Type of git repo, supported values are: github


<a id="nestedatt--project_settings"></a>
### Nested Schema for `project_settings`

Optional:

- **build_command** (String) The build command for this deployment. If omitted, this value will be taken from the project or automatically detected
- **framework** (String) The framework that is being used for this deployment. If omitted, no framework is selected
- **install_command** (String) The install command for this deployment. If omitted, this value will be taken from the project or automatically detected
- **output_directory** (String) The output directory of the deployment. If omitted, this value will be taken from the project or automatically detected
- **root_directory** (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root
- `build_command` (String) The build command for this deployment. If omitted, this value will be taken from the project or automatically detected
- `framework` (String) The framework that is being used for this deployment. If omitted, no framework is selected
- `install_command` (String) The install command for this deployment. If omitted, this value will be taken from the project or automatically detected
- `output_directory` (String) The output directory of the deployment. If omitted, this value will be taken from the project or automatically detected
- `root_directory` (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root


36 changes: 18 additions & 18 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,43 +69,43 @@ resource "vercel_project" "example" {

### Required

- **name** (String) The desired name for the project.
- `name` (String) The desired name for the project.

### Optional

- **build_command** (String) The build command for this project. If omitted, this value will be automatically detected.
- **dev_command** (String) The dev command for this project. If omitted, this value will be automatically detected.
- **environment** (Attributes Set) A set of environment variables that should be configured for the project. (see [below for nested schema](#nestedatt--environment))
- **framework** (String) The framework that is being used for this project. If omitted, no framework is selected.
- **git_repository** (Attributes) The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed. This requires the corresponding Vercel for [Github](https://vercel.com/docs/concepts/git/vercel-for-github), [Gitlab](https://vercel.com/docs/concepts/git/vercel-for-gitlab) or [Bitbucket](https://vercel.com/docs/concepts/git/vercel-for-bitbucket) plugins to be installed. (see [below for nested schema](#nestedatt--git_repository))
- **install_command** (String) The install command for this project. If omitted, this value will be automatically detected.
- **output_directory** (String) The output directory of the project. When null is used this value will be automatically detected.
- **public_source** (Boolean) Specifies whether the source code and logs of the deployments for this project should be public or not.
- **root_directory** (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root.
- **team_id** (String) The team ID to add the project to.
- `build_command` (String) The build command for this project. If omitted, this value will be automatically detected.
- `dev_command` (String) The dev command for this project. If omitted, this value will be automatically detected.
- `environment` (Attributes Set) A set of environment variables that should be configured for the project. (see [below for nested schema](#nestedatt--environment))
- `framework` (String) The framework that is being used for this project. If omitted, no framework is selected.
- `git_repository` (Attributes) The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed. This requires the corresponding Vercel for [Github](https://vercel.com/docs/concepts/git/vercel-for-github), [Gitlab](https://vercel.com/docs/concepts/git/vercel-for-gitlab) or [Bitbucket](https://vercel.com/docs/concepts/git/vercel-for-bitbucket) plugins to be installed. (see [below for nested schema](#nestedatt--git_repository))
- `install_command` (String) The install command for this project. If omitted, this value will be automatically detected.
- `output_directory` (String) The output directory of the project. When null is used this value will be automatically detected.
- `public_source` (Boolean) Specifies whether the source code and logs of the deployments for this project should be public or not.
- `root_directory` (String) The name of a directory or relative path to the source code of your project. When null is used it will default to the project root.
- `team_id` (String) The team ID to add the project to.

### Read-Only

- **id** (String) The ID of this resource.
- `id` (String) The ID of this resource.

<a id="nestedatt--environment"></a>
### Nested Schema for `environment`

Optional:

- **id** (String) The ID of the environment variable
- **key** (String) The name of the environment variable.
- **target** (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`.
- **value** (String, Sensitive) The value of the environment variable.
- `id` (String) The ID of the environment variable
- `key` (String) The name of the environment variable.
- `target` (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`.
- `value` (String, Sensitive) The value of the environment variable.


<a id="nestedatt--git_repository"></a>
### Nested Schema for `git_repository`

Optional:

- **repo** (String) The name of the git repository. For example: `vercel/next.js`.
- **type** (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`.
- `repo` (String) The name of the git repository. For example: `vercel/next.js`.
- `type` (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`.

## Import

Expand Down
14 changes: 7 additions & 7 deletions docs/resources/project_domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ resource "vercel_project_domain" "example_redirect" {

### Required

- **domain** (String) The domain name to associate with the project.
- **project_id** (String) The project ID to add the deployment to.
- `domain` (String) The domain name to associate with the project.
- `project_id` (String) The project ID to add the deployment to.

### Optional

- **git_branch** (String) Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- **redirect** (String) The domain name that serves as a target destination for redirects.
- **redirect_status_code** (Number) The HTTP status code to use when serving as a redirect.
- **team_id** (String) The ID of the team the project exists under.
- `git_branch` (String) Git branch to link to the project domain. Deployments from this git branch will be assigned the domain name.
- `redirect` (String) The domain name that serves as a target destination for redirects.
- `redirect_status_code` (Number) The HTTP status code to use when serving as a redirect.
- `team_id` (String) The ID of the team the project exists under.

### Read-Only

- **id** (String) The ID of this resource.
- `id` (String) The ID of this resource.

## Import

Expand Down
Loading