Skip to content

Commit

Permalink
Merge pull request #61 from jfrog/GH-58-update-documentation
Browse files Browse the repository at this point in the history
Add more details on repository configuration to documentation
  • Loading branch information
alexhung authored Nov 18, 2022
2 parents 2e71519 + 86293c6 commit 8626ea0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.1.10 (Nov 18, 2022). Tested on Artifactory 7.46.11 and Xray 3.60.2

IMPROVEMENTS:

* resource/project: Additional note for repository configuration. Issue: [#58](https://github.com/jfrog/terraform-provider-project/issues/58) PR: [#61](https://github.com/jfrog/terraform-provider-project/pull/61)

## 1.1.9 (Nov 18, 2022). Tested on Artifactory 7.46.11 and Xray 3.60.2

IMPROVEMENTS:
Expand Down
37 changes: 33 additions & 4 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,45 @@ page_title: "project Resource - terraform-provider-project"
subcategory: ""
description: |-
Provides an Artifactory project resource. This can be used to create and manage Artifactory project, maintain users/groups/roles/repos.
~>We strongly recommend using the "repos" attribute to manage the list of repositories. See below for more details.
Repository Configuration
After the project configuration is applied, the repository's attributes project_key and project_environments would be updated with the project's data. This will generate a state drift in the next Terraform plan/apply for the repository resource. To avoid this, apply lifecycle.ignore_changes:
```hcl
resource "artifactorylocalmavenrepository" "mymaven_releases" {
key = "my-maven-releases"
...
lifecycle {
ignore_changes = [
project_environments,
project_key
]
}
}
``
~>We strongly recommend using the repos attribute to manage the list of repositories. See below for additional details.
---

# project (Resource)

Provides an Artifactory project resource. This can be used to create and manage Artifactory project, maintain users/groups/roles/repos.

~>We strongly recommend using the "repos" attribute to manage the list of repositories. See below for more details.
## Repository Configuration

After the project configuration is applied, the repository's attributes `project_key` and `project_environments` would be updated with the project's data. This will generate a state drift in the next Terraform plan/apply for the repository resource. To avoid this, apply `lifecycle.ignore_changes`:
```hcl
resource "artifactory_local_maven_repository" "my_maven_releases" {
key = "my-maven-releases"
...
lifecycle {
ignore_changes = [
project_environments,
project_key
]
}
}
```
~>We strongly recommend using the `repos` attribute to manage the list of repositories. See below for additional details.

## Example Usage

Expand Down Expand Up @@ -139,5 +170,3 @@ Required:
Optional:

- `description` (String)


4 changes: 1 addition & 3 deletions pkg/project/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ func projectResource() *schema.Resource {
},

Schema: projectSchema,
Description: `Provides an Artifactory project resource. This can be used to create and manage Artifactory project, maintain users/groups/roles/repos.
~>We strongly recommend using the "repos" attribute to manage the list of repositories. See below for more details.`,
Description: "Provides an Artifactory project resource. This can be used to create and manage Artifactory project, maintain users/groups/roles/repos.\n\n## Repository Configuration\n\nAfter the project configuration is applied, the repository's attributes `project_key` and `project_environments` would be updated with the project's data. This will generate a state drift in the next Terraform plan/apply for the repository resource. To avoid this, apply `lifecycle.ignore_changes`:\n```hcl\nresource \"artifactory_local_maven_repository\" \"my_maven_releases\" {\n\tkey = \"my-maven-releases\"\n\t...\n\n\tlifecycle {\n\t\tignore_changes = [\n\t\t\tproject_environments,\n\t\t\tproject_key\n\t\t]\n\t}\n}\n```\n~>We strongly recommend using the `repos` attribute to manage the list of repositories. See below for additional details.",
}
}

0 comments on commit 8626ea0

Please sign in to comment.