This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ variable "jfrog_url" {
1919 }
2020}
2121
22+ variable "jfrog_server_id" {
23+ type = string
24+ description = " The server ID of the JFrog instance for JFrog CLI configuration"
25+ default = " 0"
26+ }
27+
2228variable "username_field" {
2329 type = string
2430 description = " The field to use for the artifactory username. i.e. Coder username or email."
@@ -79,6 +85,7 @@ resource "coder_script" "jfrog" {
7985 script = templatefile (" ${ path . module } /run.sh" , {
8086 JFROG_URL : var.jfrog_url,
8187 JFROG_HOST : local.jfrog_host,
88+ JFROG_SERVER_ID : var.jfrog_server_id,
8289 ARTIFACTORY_USERNAME : local.username,
8390 ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
8491 ARTIFACTORY_ACCESS_TOKEN : data.coder_external_auth.jfrog.access_token,
Original file line number Diff line number Diff line change 1515# flows.
1616export CI=true
1717# Authenticate JFrog CLI with Artifactory.
18- echo " ${ARTIFACTORY_ACCESS_TOKEN} " | jf c add --access-token-stdin --url " ${JFROG_URL} " --overwrite 0
18+ echo " ${ARTIFACTORY_ACCESS_TOKEN} " | jf c add --access-token-stdin --url " ${JFROG_URL} " --overwrite " ${JFROG_SERVER_ID} "
1919# Set the configured server as the default.
20- jf c use 0
20+ jf c use " ${JFROG_SERVER_ID} "
2121
2222# Configure npm to use the Artifactory "npm" repository.
2323if [ -z " ${REPOSITORY_NPM} " ]; then
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ variable "jfrog_url" {
2323 }
2424}
2525
26+ variable "jfrog_server_id" {
27+ type = string
28+ description = " The server ID of the JFrog instance for JFrog CLI configuration"
29+ default = " 0"
30+ }
31+
2632variable "artifactory_access_token" {
2733 type = string
2834 description = " The admin-level access token to use for JFrog."
@@ -112,6 +118,7 @@ resource "coder_script" "jfrog" {
112118 script = templatefile (" ${ path . module } /run.sh" , {
113119 JFROG_URL : var.jfrog_url,
114120 JFROG_HOST : local.jfrog_host,
121+ JFROG_SERVER_ID : var.jfrog_server_id,
115122 ARTIFACTORY_USERNAME : local.username,
116123 ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
117124 ARTIFACTORY_ACCESS_TOKEN : artifactory_scoped_token.me.access_token,
Original file line number Diff line number Diff line change 1515# flows.
1616export CI=true
1717# Authenticate JFrog CLI with Artifactory.
18- echo " ${ARTIFACTORY_ACCESS_TOKEN} " | jf c add --access-token-stdin --url " ${JFROG_URL} " --overwrite 0
18+ echo " ${ARTIFACTORY_ACCESS_TOKEN} " | jf c add --access-token-stdin --url " ${JFROG_URL} " --overwrite " ${JFROG_SERVER_ID} "
1919# Set the configured server as the default.
20- jf c use 0
20+ jf c use " ${JFROG_SERVER_ID} "
2121
2222# Configure npm to use the Artifactory "npm" repository.
2323if [ -z " ${REPOSITORY_NPM} " ]; then
You can’t perform that action at this time.
0 commit comments