如何通过终端从Jfrog Artifactory下载文物?

发布于 2025-01-25 16:42:04 字数 98 浏览 1 评论 0原文

我正在研究Jenkinsfile,对于该项目,我需要获得一些文物,有人可以帮助我使用正确的命令吗?

我当时正在考虑卷发,但后来询问我输入用户名和密码,请遵循404错误。

I am working on Jenkinsfile and for the project I need to get some Artifactory, can anyone help me with the correct command?

I was thinking about curl but then it is asking me for username and password, follow by a 404 error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

默嘫て 2025-02-01 16:42:04

在JenkinsFile的舞台中,使用withCredentials指令中的下载命令。

withCredentials([usernamePassword(credentialsId: 'artifactoryCredentials', passwordVariable: 'ART_PASSWORD', usernameVariable: 'ART_USERNAME')]) {
    sh 'curl -u ${ART_USERNAME}:${ART_PASSWORD} https://artifactory.example.com/artifactory/foo/com/projectA/wrapper/app-1.0.jar'
}

如果您使用wget来下载软件包,请在sh块中使用以下内容。

wget --user ${ART_USERNAME} --password ${ART_PASSWORD} https://artifactory.example.com/artifactory/foo/com/projectA/wrapper/app-1.0.jar

请在右边的prectentialsid上与管理员一起检查以在詹金斯管道内使用。

有关处理凭据的更多信息,请参阅 jenkinsfile文档

In the stage in your Jenkinsfile, use your download command within a withCredentials directive.

withCredentials([usernamePassword(credentialsId: 'artifactoryCredentials', passwordVariable: 'ART_PASSWORD', usernameVariable: 'ART_USERNAME')]) {
    sh 'curl -u ${ART_USERNAME}:${ART_PASSWORD} https://artifactory.example.com/artifactory/foo/com/projectA/wrapper/app-1.0.jar'
}

If you're using wget to download your packages, use the below within sh block.

wget --user ${ART_USERNAME} --password ${ART_PASSWORD} https://artifactory.example.com/artifactory/foo/com/projectA/wrapper/app-1.0.jar

Please check with the Admin on the right credentialsId to use within your Jenkins pipeline.

For more info on handling credentials refer Jenkinsfile documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文