Skip to content

Commit 6e44ba5

Browse files
committed
auth-key sensitive+pipeline update + terr0.13
1 parent 267bd94 commit 6e44ba5

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

README.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,32 @@ go build -o terraform-provider-codefresh
2222

2323
Compile or take from the [Releases](https://github.com/codefresh-contrib/terraform-provider-codefresh/releases) `terraform-provider-codefresh` binary and place it locally according the Terraform plugins [documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins).
2424

25-
For Linux OS it can be:
26-
25+
### for terraform 0.12:
2726
- _~/.terraform.d/plugins/linux\_amd64_
2827
- _./terraform.d/plugins/linux\_amd64_. The relative path in your Terraform project.
2928

29+
### for terraform 0.13 follow [required providers](https://www.terraform.io/docs/configuration/provider-requirements.html):
30+
```bash
31+
# OS is linux|windows|darwin, ARCH is amd64|arm|x86
32+
PLUGIN_DIR=~/.terraform.d/plugins/codefresh.io/app/codefresh/0.1.0/<OS_ARCH>
33+
mkdir -p ${PLUGIN_DIR}
34+
cp terraform-provider-codefresh ${PLUGIN_DIR}/
35+
```
36+
37+
add [required_providers block](https://www.terraform.io/docs/configuration/provider-requirements.html#requiring-providers)
38+
```terraform
39+
terraform {
40+
41+
required_providers {
42+
codefresh = {
43+
versions = ["0.1.0"]
44+
source = "codefresh.io/app/codefresh"
45+
}
46+
}
47+
}
48+
```
49+
50+
3051
## [Documentations](./docs)
3152

3253
## [Examples](./examples)

codefresh/resource_api_key.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func resourceApiKey() *schema.Resource {
3232
"token": {
3333
Type: schema.TypeString,
3434
Computed: true,
35+
Sensitive: true,
3536
},
3637
"scopes": {
3738
Type: schema.TypeSet,

codefresh/resource_pipeline.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ func resourcePipeline() *schema.Resource {
2727
},
2828
"project_id": {
2929
Type: schema.TypeString,
30-
Optional: true,
30+
Computed: true,
31+
3132
},
3233
"revision": {
3334
Type: schema.TypeInt,
34-
Optional: true,
35+
Computed: true,
3536
},
3637
"tags": {
3738
Type: schema.TypeSet,

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8j
252252
github.com/hashicorp/terraform-plugin-sdk v1.7.0 h1:B//oq0ZORG+EkVrIJy0uPGSonvmXqxSzXe8+GhknoW0=
253253
github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY=
254254
github.com/hashicorp/terraform-plugin-sdk v1.15.0 h1:bmYnTT7MqNXlUHDc7pT8E6uKT2g/upjlRLypJFK1OQU=
255+
github.com/hashicorp/terraform-plugin-sdk v1.16.0 h1:NrkXMRjHErUPPTHQkZ6JIn6bByiJzGnlJzH1rVdNEuE=
255256
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.0-rc.2 h1:HHppQ5ly03DFdZpuxiO2qHEbZ8uJHcZiRp37O9OfnCc=
256257
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.0-rc.2.0.20200717132200-7435e2abc9d1 h1:h8TtYDlIACXQ6LNJesvSHuxskaPUAX/nltvqp0Kp1vk=
257258
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.0-rc.2.0.20200717132200-7435e2abc9d1/go.mod h1:aWg/hVISyjdpUOt89SSrplxffuq8HPEnIWGyKDpDzCo=
259+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.4 h1:GYkUL3zjrZgig9Gm+/61+YglzESJxXRDMp7qhJsh4j0=
258260
github.com/hashicorp/terraform-plugin-test v1.2.0 h1:AWFdqyfnOj04sxTdaAF57QqvW7XXrT8PseUHkbKsE8I=
259261
github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs=
260262
github.com/hashicorp/terraform-plugin-test v1.4.4 h1:5Pvg9nESNFDnf6bafUYX5Qk15WaZtv0alxwOKiZo7vQ=

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ import (
1111

1212
func main() {
1313
debugMode := (os.Getenv("CODEFRESH_PLUGIN_DEBUG") != "")
14+
// for terraform 0.13: export CODEFRESH_PLUGIN_ADDR="codefresh.io/app/codefresh"
15+
providerAddr := os.Getenv("CODEFRESH_PLUGIN_ADDR")
16+
if providerAddr == "" {
17+
providerAddr = "registry.terraform.io/-/codefresh"
18+
}
1419
if debugMode {
15-
err := plugin.Debug(context.Background(), "registry.terraform.io/-/codefresh",
20+
err := plugin.Debug(context.Background(), providerAddr,
1621
&plugin.ServeOpts{
1722
ProviderFunc: codefresh.Provider,
1823
})

0 commit comments

Comments
 (0)