feat: add JFrog access token output to module output (#101)
This commit is contained in:
committed by
GitHub
parent
8e3f48ce5c
commit
98bb94c5f0
@@ -59,3 +59,19 @@ jf pip install requests
|
|||||||
```shell
|
```shell
|
||||||
pip install requests
|
pip install requests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using the access token in other terraform resources
|
||||||
|
|
||||||
|
JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
|
||||||
|
provider "docker" {
|
||||||
|
...
|
||||||
|
registry_auth {
|
||||||
|
address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY"
|
||||||
|
username = module.jfrog.username
|
||||||
|
password = module.jfrog.access_token
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -15,3 +15,5 @@ describe("jfrog-oauth", async () => {
|
|||||||
package_managers: "{}",
|
package_managers: "{}",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//TODO add more tests
|
||||||
|
|||||||
@@ -75,3 +75,14 @@ resource "coder_script" "jfrog" {
|
|||||||
})
|
})
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "access_token" {
|
||||||
|
description = "value of the JFrog access token"
|
||||||
|
value = data.coder_external_auth.jfrog.access_token
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
|
||||||
|
output "username" {
|
||||||
|
description = "value of the JFrog username"
|
||||||
|
value = local.username
|
||||||
|
}
|
||||||
|
|||||||
@@ -68,3 +68,19 @@ npm install prettier
|
|||||||
go get github.com/golang/example/hello
|
go get github.com/golang/example/hello
|
||||||
pip install requests
|
pip install requests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using the access token in other terraform resources
|
||||||
|
|
||||||
|
JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
|
||||||
|
provider "docker" {
|
||||||
|
...
|
||||||
|
registry_auth {
|
||||||
|
address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY"
|
||||||
|
username = module.jfrog.username
|
||||||
|
password = module.jfrog.access_token
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -108,3 +108,14 @@ resource "coder_script" "jfrog" {
|
|||||||
})
|
})
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "access_token" {
|
||||||
|
description = "value of the JFrog access token"
|
||||||
|
value = artifactory_scoped_token.me.access_token
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
|
||||||
|
output "username" {
|
||||||
|
description = "value of the JFrog username"
|
||||||
|
value = local.username
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user