Skip to content

Commit 8add161

Browse files
matifaligithub-actions[bot]DevelopmentCats
authored
fix(jfrog): replace deprecated --repo-resolve flag for Maven (#535)
Fixes deprecated Maven config flags in jfrog-oauth and jfrog-token modules closes #534 Done using GitHub Copilot. --------- Co-authored-by: GitHub Actions Bot <github-actions[bot]@users.noreply.github.com> Co-authored-by: DevelopmentCats <[email protected]>
1 parent ddf86e7 commit 8add161

File tree

6 files changed

+35
-15
lines changed

6 files changed

+35
-15
lines changed

registry/coder/modules/jfrog-oauth/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Install the JF CLI and authenticate package managers with Artifactory using OAut
1616
module "jfrog" {
1717
count = data.coder_workspace.me.start_count
1818
source = "registry.coder.com/coder/jfrog-oauth/coder"
19-
version = "1.2.0"
19+
version = "1.2.1"
2020
agent_id = coder_agent.example.id
2121
jfrog_url = "https://example.jfrog.io"
2222
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
@@ -47,7 +47,7 @@ Configure the Python pip package manager to fetch packages from Artifactory whil
4747
module "jfrog" {
4848
count = data.coder_workspace.me.start_count
4949
source = "registry.coder.com/coder/jfrog-oauth/coder"
50-
version = "1.2.0"
50+
version = "1.2.1"
5151
agent_id = coder_agent.example.id
5252
jfrog_url = "https://example.jfrog.io"
5353
username_field = "email"
@@ -76,7 +76,7 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
7676
module "jfrog" {
7777
count = data.coder_workspace.me.start_count
7878
source = "registry.coder.com/coder/jfrog-oauth/coder"
79-
version = "1.2.0"
79+
version = "1.2.1"
8080
agent_id = coder_agent.example.id
8181
jfrog_url = "https://example.jfrog.io"
8282
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"

registry/coder/modules/jfrog-oauth/main.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ EOF`;
159159

160160
const coderScript = findResourceInstance(state, "coder_script");
161161

162-
expect(coderScript.script).toContain(
163-
'jf mvnc --global --repo-resolve "central"',
164-
);
162+
expect(coderScript.script).toContain("jf mvnc --global");
163+
expect(coderScript.script).toContain('--server-id-resolve="0"');
164+
expect(coderScript.script).toContain('--repo-resolve-releases "central"');
165+
expect(coderScript.script).toContain('--repo-resolve-snapshots "central"');
166+
expect(coderScript.script).toContain('--server-id-deploy="0"');
167+
expect(coderScript.script).toContain('--repo-deploy-releases "central"');
168+
expect(coderScript.script).toContain('--repo-deploy-snapshots "central"');
165169

166170
expect(coderScript.script).toContain("<servers>");
167171
expect(coderScript.script).toContain("<id>central</id>");

registry/coder/modules/jfrog-oauth/run.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ if [ -z "${HAS_MAVEN}" ]; then
9999
not_configured maven
100100
else
101101
echo "☕ Configuring maven..."
102-
jf mvnc --global --repo-resolve "${REPOSITORY_MAVEN}"
102+
jf mvnc --global \
103+
--server-id-resolve="${JFROG_SERVER_ID}" \
104+
--repo-resolve-releases "${REPOSITORY_MAVEN}" \
105+
--repo-resolve-snapshots "${REPOSITORY_MAVEN}" \
106+
--server-id-deploy="${JFROG_SERVER_ID}" \
107+
--repo-deploy-releases "${REPOSITORY_MAVEN}" \
108+
--repo-deploy-snapshots "${REPOSITORY_MAVEN}"
103109
# Create Maven config directory if it doesn't exist
104110
mkdir -p ~/.m2
105111
cat << EOF > ~/.m2/settings.xml

registry/coder/modules/jfrog-token/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Install the JF CLI and authenticate package managers with Artifactory using Arti
1313
```tf
1414
module "jfrog" {
1515
source = "registry.coder.com/coder/jfrog-token/coder"
16-
version = "1.2.0"
16+
version = "1.2.1"
1717
agent_id = coder_agent.example.id
1818
jfrog_url = "https://XXXX.jfrog.io"
1919
artifactory_access_token = var.artifactory_access_token
@@ -42,7 +42,7 @@ For detailed instructions, please see this [guide](https://coder.com/docs/v2/lat
4242
```tf
4343
module "jfrog" {
4444
source = "registry.coder.com/coder/jfrog-token/coder"
45-
version = "1.2.0"
45+
version = "1.2.1"
4646
agent_id = coder_agent.example.id
4747
jfrog_url = "https://YYYY.jfrog.io"
4848
artifactory_access_token = var.artifactory_access_token # An admin access token
@@ -81,7 +81,7 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
8181
```tf
8282
module "jfrog" {
8383
source = "registry.coder.com/coder/jfrog-token/coder"
84-
version = "1.2.0"
84+
version = "1.2.1"
8585
agent_id = coder_agent.example.id
8686
jfrog_url = "https://XXXX.jfrog.io"
8787
artifactory_access_token = var.artifactory_access_token
@@ -101,7 +101,7 @@ data "coder_workspace" "me" {}
101101
102102
module "jfrog" {
103103
source = "registry.coder.com/coder/jfrog-token/coder"
104-
version = "1.2.0"
104+
version = "1.2.1"
105105
agent_id = coder_agent.example.id
106106
jfrog_url = "https://XXXX.jfrog.io"
107107
artifactory_access_token = var.artifactory_access_token

registry/coder/modules/jfrog-token/main.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,13 @@ EOF`;
197197

198198
const coderScript = findResourceInstance(state, "coder_script");
199199

200-
expect(coderScript.script).toContain(
201-
'jf mvnc --global --repo-resolve "central"',
202-
);
200+
expect(coderScript.script).toContain("jf mvnc --global");
201+
expect(coderScript.script).toContain('--server-id-resolve="0"');
202+
expect(coderScript.script).toContain('--repo-resolve-releases "central"');
203+
expect(coderScript.script).toContain('--repo-resolve-snapshots "central"');
204+
expect(coderScript.script).toContain('--server-id-deploy="0"');
205+
expect(coderScript.script).toContain('--repo-deploy-releases "central"');
206+
expect(coderScript.script).toContain('--repo-deploy-snapshots "central"');
203207

204208
expect(coderScript.script).toContain("<servers>");
205209
expect(coderScript.script).toContain("<id>central</id>");

registry/coder/modules/jfrog-token/run.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ if [ -z "${HAS_MAVEN}" ]; then
9898
not_configured maven
9999
else
100100
echo "☕ Configuring maven..."
101-
jf mvnc --global --repo-resolve "${REPOSITORY_MAVEN}"
101+
jf mvnc --global \
102+
--server-id-resolve="${JFROG_SERVER_ID}" \
103+
--repo-resolve-releases "${REPOSITORY_MAVEN}" \
104+
--repo-resolve-snapshots "${REPOSITORY_MAVEN}" \
105+
--server-id-deploy="${JFROG_SERVER_ID}" \
106+
--repo-deploy-releases "${REPOSITORY_MAVEN}" \
107+
--repo-deploy-snapshots "${REPOSITORY_MAVEN}"
102108
# Create Maven config directory if it doesn't exist
103109
mkdir -p ~/.m2
104110
cat << EOF > ~/.m2/settings.xml

0 commit comments

Comments
 (0)