terraform-provider-codefresh icon indicating copy to clipboard operation
terraform-provider-codefresh copied to clipboard

[Feature]: Support for repo contexts (ex gitlab )

Open brunotorrente opened this issue 2 years ago • 0 comments

What would you like to be added?

Support for repo contexts (gitlab example)

Using the API it is possible to consult repos registered in codefresh, but the terraform provider does not support this context

API https://g.codefresh.io/api/contexts/gitlab

API response for git contexts

{
        "apiVersion": "v1",
        "kind": "context",
	"owner": "account",
	"metadata": {
		"default": true,
		"system": false,
		"name": "gitlab"
	},
	"spec": {
		"type": "git.gitlab",
		"data": {
			"sharingPolicy": "AllUsersInAccount",
			"auth": {
				"type": "basic",
				"password": "*****",
				"apiURL": "https://teste.com/api/v4/"
			},
			"behindFirewall": false,
			"sshClone": false,
			"secretStoreReferences": []
		}
	}
}

Would it be possible to add a data and resource to manage git repos in codefresh?

Exemple

resource "codefresh_context" "repos" {
    name = "gitlab"
    spec {
        git{ 
            gitlab {
                data = {
                   "auth_type = "basic"
                   "password" = "xxxxxx",
                   "apiURL" = "https://teste.com/api/v4/"
                   }
            }
    }
}

https://g.codefresh.io/api/#operation/repos-git-get-repo

brunotorrente avatar Oct 10 '23 21:10 brunotorrente