terraform-provider-sonarqube
terraform-provider-sonarqube copied to clipboard
[Feature] Project badge token
It would be great if we had a data source for the badge token so we could use it to set badges automatically. related API: https://next.sonarqube.com/sonarqube/web_api/api/project_badges/token Example usage with Gitlab provider:
resource "gitlab_project" "foo" {
name = "foo-project"
}
data "sonarqube_badge_token" "sample_badge" {
project = var.project_key
}
resource "gitlab_project_badge" "example" {
project = gitlab_project.foo.id
link_url = "https://<sonar_host>/dashboard?id=${var.project_key}"
image_url = "https://<sonar_host>/api/project_badges/measure?project=${var.project_key}&metric=alert_status&token=${data.sonarqube_badge_token.sample_badge.token}"
name = "quality-gate-status"
}
Gitlab provider documentation: https://registry.terraform.io/providers/gitlabhq/gitlab/latest/docs/resources/project_badge
Are we looking to add a data source for badges? Whats the use case for this?
Are we looking to add a data source for badges? Whats the use case for this?
Sorry, I updated the description; I put an example of what we can do with the badge token. It will be helpful if we have a data source for that.