Skip to content

docs: expand jfrog platform and example template #9073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename jfrog_host to jfrog_url
  • Loading branch information
matifali committed Aug 14, 2023
commit f4ce48555e40b8278cdeba48b51a3301f0446a05
14 changes: 7 additions & 7 deletions examples/templates/jfrog-docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ provider "docker" {
data "coder_workspace" "me" {
}

variable "jfrog_url" {
variable "jfrog_host" {
type = string
description = "The URL of the JFrog instance."
description = "JFrog instance hostname. For example, 'YYY.jfrog.io'."
}

variable "artifactory_access_token" {
Expand All @@ -50,7 +50,7 @@ variable "artifactory_access_token" {

# Configure the Artifactory provider
provider "artifactory" {
url = "https://${var.jfrog_url}/artifactory"
url = "https://${var.jfrog_host}/artifactory"
access_token = var.artifactory_access_token
}

Expand All @@ -75,26 +75,26 @@ resource "coder_agent" "main" {

jf c rm 0 || true
echo ${artifactory_scoped_token.me.access_token} | \
jf c add --access-token-stdin --url https://${var.jfrog_url} 0
jf c add --access-token-stdin --url https://${var.jfrog_host} 0

# Configure the `npm` CLI to use the Artifactory "npm" registry.
cat << EOF > ~/.npmrc
email = ${data.coder_workspace.me.owner_email}
registry = https://${var.jfrog_url}/artifactory/api/npm/${local.artifactory_registry_keys["npm"]}
registry = https://${var.jfrog_host}/artifactory/api/npm/${local.artifactory_registry_keys["npm"]}
EOF
jf rt curl /api/npm/auth >> .npmrc

# Configure the `pip` to use the Artifactory "pypi" registry.
mkdir -p ~/.pip
cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://${local.artifactory_username}:${artifactory_scoped_token.me.access_token}@${var.jfrog_url}/artifactory/api/pypi/${local.artifactory_registry_keys["python"]}/simple
index-url = https://${local.artifactory_username}:${artifactory_scoped_token.me.access_token}@${var.jfrog_host}/artifactory/api/pypi/${local.artifactory_registry_keys["python"]}/simple
EOF

EOT
# Set GOPROXY to use the Artifactory "go" registry.
env = {
GOPROXY : "https://${local.artifactory_username}:${artifactory_scoped_token.me.access_token}@${var.jfrog_url}/artifactory/api/go/${local.artifactory_registry_keys["go"]}"
GOPROXY : "https://${local.artifactory_username}:${artifactory_scoped_token.me.access_token}@${var.jfrog_host}/artifactory/api/go/${local.artifactory_registry_keys["go"]}"
}
}

Expand Down