pull/115/head
Muhammad Atif Ali 2 years ago
parent cb49f8ddf1
commit 85e92970ec

@ -79,6 +79,7 @@ module "jfrog" {
} }
} }
``` ```
### Using the access token in other terraform resources ### 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). 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).

@ -95,35 +95,35 @@ output "username" {
} }
resource "coder_env" "jfrog_ide_url" { resource "coder_env" "jfrog_ide_url" {
count = var.configure_code_server ? 1 : 0 count = var.configure_code_server ? 1 : 0
agent_id = var.agent_id agent_id = var.agent_id
name = "JFROG_IDE_URL" name = "JFROG_IDE_URL"
value = var.jfrog_url value = var.jfrog_url
} }
resource "coder_env" "jfrog_ide_username" { resource "coder_env" "jfrog_ide_username" {
count = var.configure_code_server ? 1 : 0 count = var.configure_code_server ? 1 : 0
agent_id = var.agent_id agent_id = var.agent_id
name = "JFROG_IDE_USERNAME" name = "JFROG_IDE_USERNAME"
value = local.username value = local.username
} }
resource "coder_env" "jfrog_ide_password" { resource "coder_env" "jfrog_ide_password" {
count = var.configure_code_server ? 1 : 0 count = var.configure_code_server ? 1 : 0
agent_id = var.agent_id agent_id = var.agent_id
name = "JFROG_IDE_PASSWORD" name = "JFROG_IDE_PASSWORD"
value = data.coder_external_auth.jfrog.access_token value = data.coder_external_auth.jfrog.access_token
} }
resource "coder_env" "jfrog_ide_access_token" { resource "coder_env" "jfrog_ide_access_token" {
count = var.configure_code_server ? 1 : 0 count = var.configure_code_server ? 1 : 0
agent_id = var.agent_id agent_id = var.agent_id
name = "JFROG_IDE_ACCESS_TOKEN" name = "JFROG_IDE_ACCESS_TOKEN"
value = data.coder_external_auth.jfrog.access_token value = data.coder_external_auth.jfrog.access_token
} }
resource "coder_env" "jfrog_ide_store_connection" { resource "coder_env" "jfrog_ide_store_connection" {
count = var.configure_code_server ? 1 : 0 count = var.configure_code_server ? 1 : 0
agent_id = var.agent_id agent_id = var.agent_id
name = "JFROG_IDE_STORE_CONNECTION" name = "JFROG_IDE_STORE_CONNECTION"
value = true value = true

@ -73,4 +73,4 @@ if [ "${CONFIGURE_CODE_SERVER}" == "true" ]; then
fi fi
else else
echo "🤔 CONFIGURE_CODE_SERVER is not set to true, skipping JFrog extension installation." echo "🤔 CONFIGURE_CODE_SERVER is not set to true, skipping JFrog extension installation."
fi fi

@ -14,15 +14,15 @@ Install the JF CLI and authenticate package managers with Artifactory using Arti
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "https://registry.coder.com/modules/jfrog-token"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io" jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token artifactory_access_token = var.artifactory_access_token
package_managers = { package_managers = {
"npm": "npm", "npm": "npm",
"go": "go", "go": "go",
"pypi": "pypi" "pypi": "pypi"
} }
} }
``` ```
@ -30,8 +30,8 @@ Get a JFrog access token from your Artifactory instance. The token must be an [a
```hcl ```hcl
variable "artifactory_access_token" { variable "artifactory_access_token" {
type = string type = string
sensitive = true sensitive = true
} }
``` ```
@ -43,15 +43,15 @@ variable "artifactory_access_token" {
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "https://registry.coder.com/modules/jfrog-token"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://YYYY.jfrog.io" jfrog_url = "https://YYYY.jfrog.io"
artifactory_access_token = var.artifactory_access_token # An admin access token artifactory_access_token = var.artifactory_access_token # An admin access token
package_managers = { package_managers = {
"npm": "npm-local", "npm": "npm-local",
"go": "go-local", "go": "go-local",
"pypi": "pypi-local" "pypi": "pypi-local"
} }
} }
``` ```
@ -69,6 +69,25 @@ go get github.com/golang/example/hello
pip install requests pip install requests
``` ```
### Configure code-server with JFrog extension
The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extension) for VS Code allows you to interact with Artifactory from within the IDE.
```hcl
module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token"
agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token
configure_code_server = true
package_managers = {
"npm": "npm",Add JFrog extension configuration for code-server
"go": "go",
"pypi": "pypi"
}
}
```
### Using the access token in other terraform resources ### 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). 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).

Loading…
Cancel
Save