-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add management of source control by @grahamhar (#18)
Signed-off-by: grahamhar <[email protected]>
- Loading branch information
Showing
6 changed files
with
507 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sonatypeiq_source_control Resource - terraform-provider-sonatypeiq" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# sonatypeiq_source_control (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
# Create and manage the source control for source control of organizations and applications | ||
# Set source control for an application | ||
data "sonatypeiq_application" "application" { | ||
public_id = "sandbox-application" | ||
} | ||
resource "sonatypeiq_source_control" "application" { | ||
owner_type = "application" | ||
owner_id = data.sonatypeiq_application.application.id | ||
base_branch = "main" | ||
remediation_pull_requests_enabled = true | ||
pull_request_commenting_enabled = true | ||
source_control_evaluation_enabled = false | ||
repository_url = "https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq.git" | ||
} | ||
# Set source control for an organization | ||
data "sonatypeiq_organization" "sandbox" { | ||
name = "Sandbox Organization" | ||
} | ||
resource "sonatypeiq_source_control" "organization" { | ||
owner_type = "organization" | ||
owner_id = data.sonatypeiq_organization.sandbox.id | ||
remediation_pull_requests_enabled = true | ||
pull_request_commenting_enabled = true | ||
source_control_evaluation_enabled = true | ||
base_branch = "my-cool-branch" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `owner_id` (String) Must be a valid organization or application ID, for the root organization use `ROOT_ORGANIZATION_ID` | ||
- `owner_type` (String) The type of the owner, must be one of 'organization' or 'application'. | ||
|
||
### Optional | ||
|
||
- `base_branch` (String) The default branch to use. | ||
- `pull_request_commenting_enabled` (Boolean) Set to true to enable the Pull Request Commenting feature. | ||
- `remediation_pull_requests_enabled` (Boolean) Set to true to enable the Automated Pull Requests feature. | ||
- `repository_url` (String) The SCM provider URL for the repository, only valid for `owner_type` of `application` | ||
- `scm_provider` (String) The type of SCM Provider, must be one of 'azure, bitbucket, github or gitlab'. This is required when the organization is set to `ROOT_ORGANIZATION_ID` | ||
- `source_control_evaluation_enabled` (Boolean) Set to true to enable Nexus IQ triggered source control evaluations. | ||
- `token` (String) The token for use with the SCM Provider 'scm_provider' | ||
- `user_name` (String) The user name to use when setting `scm_provider` to `bitbucket`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Create and manage the source control for source control of organizations and applications | ||
|
||
# Set source control for an application | ||
data "sonatypeiq_application" "application" { | ||
public_id = "sandbox-application" | ||
} | ||
|
||
resource "sonatypeiq_source_control" "application" { | ||
owner_type = "application" | ||
owner_id = data.sonatypeiq_application.application.id | ||
base_branch = "main" | ||
remediation_pull_requests_enabled = true | ||
pull_request_commenting_enabled = true | ||
source_control_evaluation_enabled = false | ||
repository_url = "https://github.com/sonatype-nexus-community/terraform-provider-sonatypeiq.git" | ||
} | ||
|
||
# Set source control for an organization | ||
data "sonatypeiq_organization" "sandbox" { | ||
name = "Sandbox Organization" | ||
} | ||
|
||
resource "sonatypeiq_source_control" "organization" { | ||
owner_type = "organization" | ||
owner_id = data.sonatypeiq_organization.sandbox.id | ||
remediation_pull_requests_enabled = true | ||
pull_request_commenting_enabled = true | ||
source_control_evaluation_enabled = true | ||
base_branch = "my-cool-branch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.