diff --git a/README.md b/README.md index 7a368c72..45ebe14b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,12 @@ # Terraform Provider for Codefresh -This is the official Terraform Provider for Codefresh. +The official Terraform and OpenTofu Provider for [Codefresh](https://codefresh.io/). Terraform Registry: [registry.terraform.io/providers/codefresh-io/codefresh](https://registry.terraform.io/providers/codefresh-io/codefresh/latest) ## Requirements -- [Terraform](https://www.terraform.io/downloads.html) `1.x.x` - -## Download the Provider - -Download and extract terraform-provider-codefresh from [releases](https://github.com/codefresh-io/terraform-provider-codefresh/releases) +- [Terraform](https://www.terraform.io/downloads.html) `1.x.x` or [OpenTofu](https://github.com/opentofu/opentofu/releases/latest) `1.x.x`. ## Using the Provider @@ -21,12 +17,14 @@ terraform { required_providers { codefresh = { version = "x.y.z" # Optional but recommended; replace with latest semantic version - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" # registry.terraform.io/ is optional for Terraform users, but required for OpenTofu users } } } ``` +You can also download and extract the provider binary (`terraform-provider-codefresh`) from [releases](https://github.com/codefresh-io/terraform-provider-codefresh/releases). + ## Building the Provider Locally ```sh @@ -39,24 +37,13 @@ The documentation is generated using [tfplugindocs](https://github.com/hashicorp See: [CONTRIBUTING.md](./CONTRIBUTING.md#documentation) -## To configure Codefresh provider: +## Provider Configuration: -```hcl -provider "codefresh" { - api_url = "" # Default value - https://g.codefresh.io/api - token = "" # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable -} -``` +See the [Provider Documentation](https://registry.terraform.io/providers/codefresh-io/codefresh/latest/docs#schema). -Get an API key from [Codefresh](https://g.codefresh.io/user/settings) and set the following scopes: +The provider requires a Codefresh API in order to authenticate to the Codefresh API. Generate the API key [here](https://g.codefresh.io/user/settings) and set the scopes [according to the resources you wish to create](https://codefresh.io/docs/docs/integrations/codefresh-api/#access-scopes). Note that some resource require platform admin permissions and hence can only be created for on-prem installations and not our SaaS offering. -- Environments-V2 -- Pipeline -- Project -- Repos -- Step-Type -- Step-Types -- View +The key can be set as an environment variable: ```bash export CODEFRESH_API_KEY='xyz' @@ -64,12 +51,20 @@ export CODEFRESH_API_KEY='xyz' ## Testing the Provider -**NOTE:** Acceptance tests create real resources, including admin resources (accounts, users) so make sure that `CODEFRESH_API_KEY` is set to an account that you are ok with being modified. +**NOTE:** Acceptance tests create real resources, including admin resources (accounts, users) so make sure that `CODEFRESH_API_KEY` is set to a Codefresh installation and an account that you are ok with being modified. ```bash make testacc ``` +## OpenTofu Support + +This provider supports [OpenTofu](https://opentofu.org/). + +[Equivalence Testing](https://github.com/opentofu/equivalence-testing) is performed on the `examples/` directory in order to ensure that the provider behaves identically when used by either `terraform` and `tofu` binaries. + +The [OpenTofu Registry](https://registry.opentofu.org/) seems to be unpublished at time of writing. As of now, the provider is only published to the [Terraform Registry](https://registry.terraform.io/providers/codefresh-io/codefresh/latest). + ## Contributors diff --git a/tf_modules/account_token/main.tf b/examples/.modules/account_token/main.tf similarity index 100% rename from tf_modules/account_token/main.tf rename to examples/.modules/account_token/main.tf diff --git a/tf_modules/account_token/provider.tf b/examples/.modules/account_token/provider.tf similarity index 100% rename from tf_modules/account_token/provider.tf rename to examples/.modules/account_token/provider.tf diff --git a/tf_modules/account_token/vars.tf b/examples/.modules/account_token/vars.tf similarity index 100% rename from tf_modules/account_token/vars.tf rename to examples/.modules/account_token/vars.tf diff --git a/tf_modules/account_tokens/main.tf b/examples/.modules/account_tokens/main.tf similarity index 100% rename from tf_modules/account_tokens/main.tf rename to examples/.modules/account_tokens/main.tf diff --git a/tf_modules/account_tokens/provider.tf b/examples/.modules/account_tokens/provider.tf similarity index 100% rename from tf_modules/account_tokens/provider.tf rename to examples/.modules/account_tokens/provider.tf diff --git a/tf_modules/account_tokens/vars.tf b/examples/.modules/account_tokens/vars.tf similarity index 100% rename from tf_modules/account_tokens/vars.tf rename to examples/.modules/account_tokens/vars.tf diff --git a/tf_modules/accounts_users/main.tf b/examples/.modules/accounts_users/main.tf similarity index 100% rename from tf_modules/accounts_users/main.tf rename to examples/.modules/accounts_users/main.tf diff --git a/tf_modules/accounts_users/output.tf b/examples/.modules/accounts_users/output.tf similarity index 100% rename from tf_modules/accounts_users/output.tf rename to examples/.modules/accounts_users/output.tf diff --git a/tf_modules/accounts_users/provider.tf b/examples/.modules/accounts_users/provider.tf similarity index 100% rename from tf_modules/accounts_users/provider.tf rename to examples/.modules/accounts_users/provider.tf diff --git a/tf_modules/accounts_users/vars.tf b/examples/.modules/accounts_users/vars.tf similarity index 100% rename from tf_modules/accounts_users/vars.tf rename to examples/.modules/accounts_users/vars.tf diff --git a/tf_modules/teams/main.tf b/examples/.modules/teams/main.tf similarity index 100% rename from tf_modules/teams/main.tf rename to examples/.modules/teams/main.tf diff --git a/tf_modules/teams/output.tf b/examples/.modules/teams/output.tf similarity index 100% rename from tf_modules/teams/output.tf rename to examples/.modules/teams/output.tf diff --git a/tf_modules/teams/vars.tf b/examples/.modules/teams/vars.tf similarity index 100% rename from tf_modules/teams/vars.tf rename to examples/.modules/teams/vars.tf diff --git a/examples/abac_rules/main.tf b/examples/abac_rules/main.tf index f60c53b4..b33f599a 100644 --- a/examples/abac_rules/main.tf +++ b/examples/abac_rules/main.tf @@ -12,10 +12,10 @@ resource "codefresh_abac_rules" "app_rule" { actions = ["REFRESH", "SYNC", "TERMINATE_SYNC", "VIEW_POD_LOGS", "APP_ROLLBACK"] attribute { - name = "LABEL" - key = "KEY" + name = "LABEL" + key = "KEY" value = "VALUE" } - tags = ["dev", "untagged"] + tags = ["dev", "untagged"] } diff --git a/examples/abac_rules/provider.tf b/examples/abac_rules/provider.tf index 79fc432c..411f4965 100644 --- a/examples/abac_rules/provider.tf +++ b/examples/abac_rules/provider.tf @@ -1,5 +1,5 @@ provider "codefresh" { - api_url = var.api_url - api_url_v2 = var.api_url_v2 - token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable + api_url = var.api_url + api_url_v2 = var.api_url_v2 + token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable } \ No newline at end of file diff --git a/examples/abac_rules/terraform.tfvars b/examples/abac_rules/terraform.tfvars index 2999903e..d63ad4a7 100644 --- a/examples/abac_rules/terraform.tfvars +++ b/examples/abac_rules/terraform.tfvars @@ -1,3 +1,3 @@ -api_url = "https://my-codefresh.example.com/api" +api_url = "https://my-codefresh.example.com/api" api_url_v2 = "https://my-codefresh.example.com/2.0/api/graphql" -token = "" +token = "" diff --git a/examples/abac_rules/vars.tf b/examples/abac_rules/vars.tf index 578727c4..778f3aed 100644 --- a/examples/abac_rules/vars.tf +++ b/examples/abac_rules/vars.tf @@ -1,12 +1,12 @@ -variable api_url { +variable "api_url" { type = string } -variable api_url_v2 { +variable "api_url_v2" { type = string } -variable token { - type = string +variable "token" { + type = string default = "" } \ No newline at end of file diff --git a/examples/abac_rules/versions.tf b/examples/abac_rules/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/abac_rules/versions.tf +++ b/examples/abac_rules/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/account_tokens/main.tf b/examples/account_tokens/main.tf index 4fe05a59..a65de1aa 100644 --- a/examples/account_tokens/main.tf +++ b/examples/account_tokens/main.tf @@ -1,24 +1,24 @@ -variable api_url { +variable "api_url" { type = string } # -variable token { - type = string +variable "token" { + type = string default = "" } ## Set of account names -variable accounts { +variable "accounts" { type = set(string) } module "account_tokens" { - source = "../../tf_modules/account_tokens" - api_url = var.api_url - accounts = var.accounts + source = "../.modules/account_tokens" + api_url = var.api_url + accounts = var.accounts } output "account_tokens" { - value = module.account_tokens.tokens + value = module.account_tokens.tokens } \ No newline at end of file diff --git a/examples/account_tokens/terraform.tfvars b/examples/account_tokens/terraform.tfvars index 6c09f30f..a395df29 100644 --- a/examples/account_tokens/terraform.tfvars +++ b/examples/account_tokens/terraform.tfvars @@ -1,5 +1,5 @@ api_url = "https://my-codefresh-example.com/api" accounts = [ -"acc1", "acc2" + "acc1", "acc2" ] \ No newline at end of file diff --git a/examples/account_tokens/versions.tf b/examples/account_tokens/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/account_tokens/versions.tf +++ b/examples/account_tokens/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/account_user_associations/main.tf b/examples/account_user_associations/main.tf index c7c06102..87aa4ef3 100644 --- a/examples/account_user_associations/main.tf +++ b/examples/account_user_associations/main.tf @@ -1,8 +1,8 @@ resource "codefresh_account_user_association" "user" { - email = "terraform-test-user+user@codefresh.io" + email = "terraform-test-user+user@codefresh.io" } resource "codefresh_account_user_association" "admin" { - email = "terraform-test-user+admin@codefresh.io" - admin = true + email = "terraform-test-user+admin@codefresh.io" + admin = true } \ No newline at end of file diff --git a/examples/account_user_associations/versions.tf b/examples/account_user_associations/versions.tf index 588936b9..ac97ea7b 100644 --- a/examples/account_user_associations/versions.tf +++ b/examples/account_user_associations/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" } } } \ No newline at end of file diff --git a/examples/accounts_users/main.tf b/examples/accounts_users/main.tf index 574f5a8d..a1f482a9 100644 --- a/examples/accounts_users/main.tf +++ b/examples/accounts_users/main.tf @@ -1,9 +1,9 @@ module "codefresh_access_control" { - source = "../../tf_modules/accounts_users" - api_url = var.api_url + source = "../.modules/accounts_users" + api_url = var.api_url default_idps = var.default_idps - accounts = var.accounts - users = var.users + accounts = var.accounts + users = var.users default_acccount_limits = var.default_acccount_limits } \ No newline at end of file diff --git a/examples/accounts_users/terraform.tfvars b/examples/accounts_users/terraform.tfvars index abffe62f..fcc267a8 100644 --- a/examples/accounts_users/terraform.tfvars +++ b/examples/accounts_users/terraform.tfvars @@ -1,56 +1,56 @@ api_url = "https://my-codefresh.example.com/api" -token = "cfAdmin-token" +token = "cfAdmin-token" default_idps = { - local = { - display_name = "local" - sso = false - } - azure_sso = { - display_name = "azure-sso-1" - sso = true - } + local = { + display_name = "local" + sso = false + } + azure_sso = { + display_name = "azure-sso-1" + sso = true + } } accounts = { - acc1 = {} - acc2 = { - limits = { - collaborators = 50 - parallel_builds = 5 - } + acc1 = {} + acc2 = { + limits = { + collaborators = 50 + parallel_builds = 5 } + } } users = { - user1 = { - email = "user1@example.com" - personal = { - first_name = "John" - last_name = "Smith" - } - accounts = ["acc1", "acc2"] - admin_of_accounts = ["acc1"] - global_admin = true + user1 = { + email = "user1@example.com" + personal = { + first_name = "John" + last_name = "Smith" } - user2 = { - email = "live.com#user2@gmail.com" - personal = { - first_name = "Q" - last_name = "D" - } - accounts = ["acc2"] - admin_of_accounts = [] - global_admin = false + accounts = ["acc1", "acc2"] + admin_of_accounts = ["acc1"] + global_admin = true + } + user2 = { + email = "live.com#user2@gmail.com" + personal = { + first_name = "Q" + last_name = "D" } - user3 = { - email = "user3@example.com" - personal = { - first_name = "Sam" - last_name = "Johnson" - } - accounts = ["acc1", "acc2"] - admin_of_accounts = ["acc1", "acc2"] - global_admin = true + accounts = ["acc2"] + admin_of_accounts = [] + global_admin = false + } + user3 = { + email = "user3@example.com" + personal = { + first_name = "Sam" + last_name = "Johnson" } + accounts = ["acc1", "acc2"] + admin_of_accounts = ["acc1", "acc2"] + global_admin = true + } } \ No newline at end of file diff --git a/examples/accounts_users/vars.tf b/examples/accounts_users/vars.tf index 1d0b2844..c18e3d7c 100644 --- a/examples/accounts_users/vars.tf +++ b/examples/accounts_users/vars.tf @@ -1,22 +1,22 @@ -variable api_url {} +variable "api_url" {} -variable default_acccount_limits { - type = map(any) - default = { - collaborators = 100 - parallel_builds = 10 - } +variable "default_acccount_limits" { + type = map(any) + default = { + collaborators = 100 + parallel_builds = 10 + } } -variable default_idps { +variable "default_idps" { type = map(any) } -variable accounts { +variable "accounts" { type = map(any) } -variable users { +variable "users" { //type = map(any) } diff --git a/examples/accounts_users/versions.tf b/examples/accounts_users/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/accounts_users/versions.tf +++ b/examples/accounts_users/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/permissions/provider.tf b/examples/permissions/provider.tf index 42717d46..b0f062c7 100644 --- a/examples/permissions/provider.tf +++ b/examples/permissions/provider.tf @@ -1,4 +1,4 @@ provider "codefresh" { - api_url = var.api_url - token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable + api_url = var.api_url + token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable } \ No newline at end of file diff --git a/examples/permissions/vars.tf b/examples/permissions/vars.tf index 90f2b988..d0743788 100644 --- a/examples/permissions/vars.tf +++ b/examples/permissions/vars.tf @@ -1,8 +1,8 @@ -variable api_url { +variable "api_url" { type = string } -variable token { - type = string +variable "token" { + type = string default = "" } \ No newline at end of file diff --git a/examples/permissions/versions.tf b/examples/permissions/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/permissions/versions.tf +++ b/examples/permissions/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/pipelines.md b/examples/pipelines.md deleted file mode 100644 index 9ba47b43..00000000 --- a/examples/pipelines.md +++ /dev/null @@ -1,86 +0,0 @@ -# Example - -In the example the Codefresh Provider is configured to authenticate with Codefresh API, and new project and pipeline are created. -Pipeline includes link to the original __codefresh.yml__ spec and two git triggres. - -Run `terraform plan` or `terraform apply` as usual. Note this will modify the actual Codefresh configuration. - -```hcl -provider "codefresh" { - api_url = "https://my.onpremcodefresh.com/api" - token = "xxxxxxxxxxxxxxx.xxxxxxxxxxxxxx" -} - -resource "codefresh_project" "test" { - name = "myproject" - - tags = [ - "docker", - ] - - variables { - go_version = "1.13" - } -} - -resource "codefresh_pipeline" "test" { - name = "${codefresh_project.test.name}/react-sample-app" - - tags = [ - "production", - "docker", - ] - - spec { - concurrency = 1 - priority = 5 - - spec_template { - repo = "codefresh-contrib/react-sample-app" - path = "./codefresh.yml" - revision = "master" - context = "git" - } - - contexts = [ - "context1-name", - "context2-name", - ] - - trigger { - branch_regex = "/.*/gi" - context = "git" - description = "Trigger for commits" - disabled = false - events = [ - "push.heads" - ] - modified_files_glob = "" - name = "commits" - provider = "github" - repo = "codefresh-contrib/react-sample-app" - type = "git" - } - - trigger { - branch_regex = "/.*/gi" - context = "git" - description = "Trigger for tags" - disabled = false - events = [ - "push.tags" - ] - modified_files_glob = "" - name = "tags" - provider = "github" - repo = "codefresh-contrib/react-sample-app" - type = "git" - } - - variables = { - MY_PIP_VAR = "value" - ANOTHER_PIP_VAR = "another_value" - } - } -} -``` diff --git a/examples/pipelines/main.tf b/examples/pipelines/main.tf index 0141f5f7..774c2e27 100644 --- a/examples/pipelines/main.tf +++ b/examples/pipelines/main.tf @@ -1,6 +1,6 @@ provider "codefresh" { api_url = var.api_url - token = var.token + token = var.token } resource "codefresh_project" "test" { @@ -12,7 +12,7 @@ resource "codefresh_project" "test" { } resource "codefresh_pipeline" "test" { - name = "${codefresh_project.test.name}/react-sample-app" + name = "${codefresh_project.test.name}/react-sample-app" tags = [ "production", @@ -65,11 +65,11 @@ steps: ] trigger { - branch_regex = "/.*/gi" - context = "git" - description = "Trigger for commits" - disabled = false - events = [ + branch_regex = "/.*/gi" + context = "git" + description = "Trigger for commits" + disabled = false + events = [ "push.heads" ] modified_files_glob = "" @@ -80,11 +80,11 @@ steps: } trigger { - branch_regex = "/.*/gi" - context = "git" - description = "Trigger for tags" - disabled = false - events = [ + branch_regex = "/.*/gi" + context = "git" + description = "Trigger for tags" + disabled = false + events = [ "push.tags" ] modified_files_glob = "" diff --git a/examples/pipelines/terraform.tfvars b/examples/pipelines/terraform.tfvars index 2923e544..95c5dc08 100644 --- a/examples/pipelines/terraform.tfvars +++ b/examples/pipelines/terraform.tfvars @@ -1,2 +1,2 @@ api_url = "http://g.codefresh.io/api" -token = "" +token = "" diff --git a/examples/pipelines/vars.tf b/examples/pipelines/vars.tf index 90f2b988..d0743788 100644 --- a/examples/pipelines/vars.tf +++ b/examples/pipelines/vars.tf @@ -1,8 +1,8 @@ -variable api_url { +variable "api_url" { type = string } -variable token { - type = string +variable "token" { + type = string default = "" } \ No newline at end of file diff --git a/examples/pipelines/versions.tf b/examples/pipelines/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/pipelines/versions.tf +++ b/examples/pipelines/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/registries/main.tf b/examples/registries/main.tf index 33300230..346c2eee 100644 --- a/examples/registries/main.tf +++ b/examples/registries/main.tf @@ -1,14 +1,14 @@ -variable api_url { +variable "api_url" { type = string } -variable token { +variable "token" { type = string default = "" } -variable test_password { +variable "test_password" { type = string default = "" } @@ -32,7 +32,7 @@ resource "codefresh_registry" "acr" { } resource "codefresh_registry" "gcr" { - name = "gcr" + name = "gcr" # all registries SHOULD be dependent on each other to be created/updated sequentially depends_on = [codefresh_registry.acr] spec { @@ -62,9 +62,9 @@ data "codefresh_registry" "dockerhub" { # example with using data reference to existing registry, not managed by terraform resource "codefresh_registry" "dockerhub1" { - name = "dockerhub1" - primary = !data.codefresh_registry.dockerhub.primary - depends_on = [codefresh_registry.gar] + name = "dockerhub1" + primary = !data.codefresh_registry.dockerhub.primary + depends_on = [codefresh_registry.gar] spec { dockerhub { username = "test" @@ -117,9 +117,9 @@ resource "codefresh_registry" "other1" { } resource "codefresh_registry" "other2" { - name = "other2" - primary = false - depends_on = [codefresh_registry.other1, codefresh_registry.bintray] + name = "other2" + primary = false + depends_on = [codefresh_registry.other1, codefresh_registry.bintray] spec { other { domain = "other.io" diff --git a/examples/registries/terraform.tfvars b/examples/registries/terraform.tfvars index 62a16f34..d629a667 100644 --- a/examples/registries/terraform.tfvars +++ b/examples/registries/terraform.tfvars @@ -1,3 +1,3 @@ api_url = "http://example.com/api" -token = "" +token = "" diff --git a/examples/registries/versions.tf b/examples/registries/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/registries/versions.tf +++ b/examples/registries/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/storate_integration/main.tf b/examples/storage_integration/main.tf similarity index 77% rename from examples/storate_integration/main.tf rename to examples/storage_integration/main.tf index 9870a807..b1810ced 100644 --- a/examples/storate_integration/main.tf +++ b/examples/storage_integration/main.tf @@ -1,13 +1,13 @@ resource "codefresh_context" "gcs" { for_each = toset(["create"]) - name = "gcs" + name = "gcs" spec { storagegc { data { auth { type = "basic" json_config = tomap({ - "config": "cf" + "config" : "cf" }) } } @@ -17,14 +17,14 @@ resource "codefresh_context" "gcs" { resource "codefresh_context" "s3" { for_each = toset(["create"]) - name = "s3" + name = "s3" spec { storages3 { data { auth { type = "basic" json_config = tomap({ - "config": "cf" + "config" : "cf" }) } } @@ -34,14 +34,14 @@ resource "codefresh_context" "s3" { resource "codefresh_context" "azure" { for_each = toset(["create"]) - name = "azure" + name = "azure" spec { storageazuref { data { auth { - type = "basic" + type = "basic" account_name = "accName" - account_key = "accKey" + account_key = "accKey" } } } diff --git a/examples/storate_integration/provider.tf b/examples/storage_integration/provider.tf similarity index 56% rename from examples/storate_integration/provider.tf rename to examples/storage_integration/provider.tf index acdfc9a8..c680ab74 100644 --- a/examples/storate_integration/provider.tf +++ b/examples/storage_integration/provider.tf @@ -8,6 +8,6 @@ terraform { } provider "codefresh" { - api_url = var.api_url - token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable + api_url = var.api_url + token = var.token # If token isn't set the provider expects the $CODEFRESH_API_KEY env variable } \ No newline at end of file diff --git a/examples/storage_integration/vars.tf b/examples/storage_integration/vars.tf new file mode 100644 index 00000000..d0743788 --- /dev/null +++ b/examples/storage_integration/vars.tf @@ -0,0 +1,8 @@ +variable "api_url" { + type = string +} + +variable "token" { + type = string + default = "" +} \ No newline at end of file diff --git a/examples/storate_integration/versions.tf b/examples/storage_integration/versions.tf similarity index 58% rename from examples/storate_integration/versions.tf rename to examples/storage_integration/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/storate_integration/versions.tf +++ b/examples/storage_integration/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/storate_integration/vars.tf b/examples/storate_integration/vars.tf deleted file mode 100644 index 90f2b988..00000000 --- a/examples/storate_integration/vars.tf +++ /dev/null @@ -1,8 +0,0 @@ -variable api_url { - type = string -} - -variable token { - type = string - default = "" -} \ No newline at end of file diff --git a/examples/teams/main.tf b/examples/teams/main.tf index 887e1c08..87fabc9a 100644 --- a/examples/teams/main.tf +++ b/examples/teams/main.tf @@ -1,21 +1,21 @@ -variable api_url { +variable "api_url" { type = string } -variable token { - type = string +variable "token" { + type = string default = "" } provider "codefresh" { api_url = var.api_url - token = var.token + token = var.token } -variable teams { +variable "teams" { type = map(any) } module "teams" { - source = "../../tf_modules/teams" - teams = var.teams + source = "../.modules/teams" + teams = var.teams } diff --git a/examples/teams/terraform.tfvars b/examples/teams/terraform.tfvars index 126a560c..74b134e4 100644 --- a/examples/teams/terraform.tfvars +++ b/examples/teams/terraform.tfvars @@ -1,7 +1,7 @@ api_url = "https://my-codefresh.example.com/api" -token = "" +token = "" teams = { developers = ["user1", "user3"] - managers = ["user3", "user2"] + managers = ["user3", "user2"] } \ No newline at end of file diff --git a/examples/teams/versions.tf b/examples/teams/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/teams/versions.tf +++ b/examples/teams/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/examples/triggers/versions.tf b/examples/triggers/versions.tf index 9dee49eb..2f55b54c 100644 --- a/examples/triggers/versions.tf +++ b/examples/triggers/versions.tf @@ -1,7 +1,7 @@ terraform { required_providers { codefresh = { - source = "codefresh-io/codefresh" + source = "registry.terraform.io/codefresh-io/codefresh" version = "~> 0.1" } } diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh deleted file mode 100755 index dd2307ac..00000000 --- a/scripts/gofmtcheck.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Check gofmt -echo "==> Checking that code complies with gofmt requirements..." -gofmt_files=$(find . -name '*.go' | grep -v vendor | xargs gofmt -l -s) -if [[ -n ${gofmt_files} ]]; then - echo 'gofmt needs running on the following files:' - echo "${gofmt_files}" - echo "You can use the command: \`make fmt\` to reformat code." - exit 1 -fi - -exit 0 diff --git a/scripts/gogetcookie.sh b/scripts/gogetcookie.sh deleted file mode 100755 index 26c63a64..00000000 --- a/scripts/gogetcookie.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -touch ~/.gitcookies -chmod 0600 ~/.gitcookies - -git config --global http.cookiefile ~/.gitcookies - -tr , \\t <<\__END__ >>~/.gitcookies -.googlesource.com,TRUE,/,TRUE,2147483647,o,git-paul.hashicorp.com=1/z7s05EYPudQ9qoe6dMVfmAVwgZopEkZBb1a2mA5QtHE -__END__