标签: artifactory

将多个 Gradle 工件从 Jenkins 上传到 Artifactory

我的环境使用 Gradle 构建,Jenkins 用于 CI,Artifactory 用于存储库。我为 Jenkins 使用 Artifactory 插件。

Jenkins 成功构建了我的主 jar 文件并将其上传到 Artifactory。构建脚本有第二个目标,用于在 build/distributions 下创建分发 zip 文件。Jenkins 成功创建了 zip 文件,但我不知道如何告诉它也将该工件上传到 Artifactory。

这是我应该能够在 Jenkins Artifactory 插件配置中指定的东西,还是我应该在 Gradle 构建脚本中定义的东西?感谢您的指点。

artifactory gradle jenkins

2
推荐指数
1
解决办法
4131
查看次数

Artifactory REST API:如何生成构建信息 json

我正在尝试在构建作业中生成一个 JSON 构建信息文件以上传到 Artifactory 并在两个工具之间创建可追溯性。但是,常规的 Jenkins JSON API 文件的设计不正确,因此我需要在运行作业时生成一个新文件。问题很简单,我该怎么做?是否有一些特定的插件(工具)我需要添加到 Jenkins,或者可能只是一组简单的命令就可以完成这项工作?

提前致谢!

json artifactory jenkins

2
推荐指数
1
解决办法
3787
查看次数

如何使用Jenkins中的filespecs动态创建文件夹并在Jfrog artifactory中上传工件?

我在jenkins中有一个构建工作,它从github为任何分支构建项目.将在构建作业工作区中创建包,版本为xxxx-yyyyy-2.15.0-SNAPSHOT.zip.

我的下一个神器推送作业有filespec写如下:

{ 
 "files": [
       {
           "pattern": "/var/lib/jenkins/workspace/Jobname/target/*/xxxx-yyyyy*.zip",
           "target": "libs-snapshot-local/xxxx-yyyyy/",
           "recursive": "false"
       }
    ]
}
Run Code Online (Sandbox Code Playgroud)

上面的filespec识别模式并上传zip libs-snapshot-local/xxxx-yyyyy/.但我需要上传文件,其中包含使用zip文件中提供的版本名称创建的文件夹xxxx-yyyyy-2.15.0-SNAPSHOT.zip.

任何人都可以帮助我动态创建具有版本名称的文件夹吗?关于如何在filespec中指定目标路径的任何想法?

artifactory jenkins jenkins-plugins devops

2
推荐指数
1
解决办法
3380
查看次数

我可以在 Artifactory 中增加下载超时吗?

我收到这样的错误:

2018-01-16 09:56:17,354 [http-nio-8081-exec-8] [ERROR] (o.a.r.RemoteRepoBase:772) - IO error while trying to download resource 'pp-libs:ru/programpark/vector/10/vector-10.zip': org.apache.http.conn.ConnectTimeoutException: Connect to 192.168.3.20:8111 [/192.168.3.20] failed: connect timed out

在 Artifactory 日志中。

该文件有半 GB 长,远程仓库的通道不是很宽。
远程仓库本身就是一个人工制品。
我不确定是谁关闭了连接。

artifactory

2
推荐指数
1
解决办法
3200
查看次数

JFrog Artifactory API 使用属性部署工件

阅读本 API 指南。我的 Artifactory 版本是 4.12.2。 https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ItemProperties

它说要像这样部署工件。

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txt
Run Code Online (Sandbox Code Playgroud)

这工作正常,但我也想在上传的同时向 file.txt 添加属性。我确实看到了一个单独的 API 来设置属性。

PUT /api/storage/libs-release-local/ch/qos/logback/logback-classic/0.9.9?properties=os=win,linux;qa=done&recursive=1
Run Code Online (Sandbox Code Playgroud)

那个有效。我想也许这样做会奏效。

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt?properties=os=win,linux;qa=done&recursive=1" -T Desktop/myNewFile.txt
Run Code Online (Sandbox Code Playgroud)

它没有用。是否可以上传工件并同时设置属性,还是必须是两个不同的 API 调用?

我确实使用 jfrog cli,但我需要一个 API 解决方案。

artifactory

2
推荐指数
1
解决办法
1643
查看次数

从 Jenkins 将 Debian 部署到 Artifactory 存储库

如何将 Debian 软件包从 Jenkins 部署到 Artifactory Debian 存储库?
我在 Jenkins Freestyle 作业中使用了一个命令:

curl -uUSER:PASS -XPUT "https://ARTIFACTORY_URL/REPO/pool/package.deb;deb.distribution=xenial;deb.component=main;deb.architecture=amd64" -T ./package.deb
Run Code Online (Sandbox Code Playgroud)

但在这种情况下,Artifactory 和 Jenkins 之间不会创建任何引用。意思是,我们无法将 Jenkins 构建与 Artifact 联系起来。
接下来,我们尝试使用管道并在创建 Debian 软件包后从 Freestyle 调用它。但同样,没有关于使用 DSL 上传 Debian 软件包的wiki/support
并且似乎FileSpec不支持 Debian 软件包。

如何传递架构/分布/组件?

有没有人有将 Debian 软件包部署到 Artifactory 的经验?听起来很简单,但我还是遗漏了一些东西。

debian artifactory jenkins-pipeline jfrog-cli

2
推荐指数
1
解决办法
1072
查看次数

在带有 Gradle 的 setting.xml 中使用 Maven 凭据

我有一些 Gradle 项目,但我想避免在build.gradle文件中显式加载凭据。我想避免的一个例子是:

        maven {
            credentials {
                username "$maven_user"
                password "$maven_password"
            }
            url 'https://my-maven-repo'
        }
Run Code Online (Sandbox Code Playgroud)

我想,以避免有用户名和密码字段gradle.build,即使这些值可以从本地主机例如,从装载~/.gradle/gradle.properties
我想实现的是加载从证书~/.m2/settings.xml和唯一指定Maven仓库网址gradle.build
有可能这样做吗?我做了几次尝试,但看起来 Gradle 忽略了settings.xml

continuous-integration dependencies artifactory gradle maven

2
推荐指数
1
解决办法
3810
查看次数

Artifcatory rest API 列出所有存储库

我正在寻找一个可以列出所有 repo-keys的人工 REST API 。如果它可以提供更多信息,那就太好了。

我查找了 Artifactory REST API 文档,但找不到。

我错过了什么吗?还有其他选择吗?

artifactory artifactory-query-lang

2
推荐指数
1
解决办法
1445
查看次数

如何将 Gradle 插件发布到 Artifactory?

我正在使用这个示例 Gradle 插件项目:https : //github.com/AlainODea/gradle-com.example.hello-plugin

当我运行./gradlew publishToMavenLocal 时,它会在 M2_HOME 中创建这些文件:

  1. com/hello/com.example.hello.gradle.plugin/maven-metadata-local.xml
  2. com/hello/com.example.hello.gradle.plugin/0.1-SNAPSHOT/com.example.hello.gradle.plugin-0.1-SNAPSHOT.pom
  3. com/hello/com.example.hello.gradle.plugin/0.1-SNAPSHOT/maven-metadata-local.xml
  4. com/hello/gradle-com.example.hello-plugin/maven-metadata-local.xml
  5. com/hello/gradle-com.example.hello-plugin/0.1-SNAPSHOT/gradle-com.example.hello-plugin-0.1-SNAPSHOT.jar
  6. com/hello/gradle-com.example.hello-plugin/0.1-SNAPSHOT/gradle-com.example.hello-plugin-0.1-SNAPSHOT.pom
  7. com/hello/gradle-com.example.hello-plugin/0.1-SNAPSHOT/maven-metadata-local.xml

当我运行./gradlew artifactoryPublish 时,它会记录:

Deploying artifact: https://artifactory.example.com/artifactory/libs-release-local-maven/com/example/hello/gradle-com.example.hello-plugin/0.1-SNAPSHOT/gradle-com.example.hello-plugin-0.1-SNAPSHOT.jar
Deploying artifact: https://artifactory.example.com/artifactory/libs-release-local-maven/com/example/hello/gradle-com.example.hello-plugin/0.1-SNAPSHOT/gradle-com.example.hello-plugin-0.1-SNAPSHOT.pom
Deploying build descriptor to: https://artifactory.example.com/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under https://artifactory.example.com/artifactory/webapp/builds/gradle-com.example.hello-plugin/1234567890123
Run Code Online (Sandbox Code Playgroud)

尝试从另一个 build.gradle 加载插件:

plugins {
    id 'java'
    id 'com.example.hello' version '0.1-SNAPSHOT'
}
Run Code Online (Sandbox Code Playgroud)

使用 settings.gradle:

pluginManagement {
    repositories {
        maven {
            url 'https://artifactory.example.com/artifactory/libs-release-local-maven/'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

导致此错误:

Plugin [id: 'com.example', version: '0.1-SNAPSHOT'] was not found in …
Run Code Online (Sandbox Code Playgroud)

artifactory gradle kotlin gradle-plugin

2
推荐指数
1
解决办法
3715
查看次数

'artifactory' 不受支持的 docker v2 存储库请求意味着什么

我的 docker 客户端/服务器版本是:

$ docker version
Client:
Version:           18.09.0
API version:       1.39
Go version:        go1.10.4
Git commit:        4d60db4
Built:             Wed Nov  7 00:49:01 2018
OS/Arch:           linux/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
Version:          18.09.0
API version:      1.39 (minimum version 1.12)
Go version:       go1.10.4
Git commit:       4d60db4
Built:            Wed Nov  7 00:16:44 2018
OS/Arch:          linux/amd64
Experimental:     false
Run Code Online (Sandbox Code Playgroud)

想使用 artifactory 来托管 docker。跑步时

docker login 
Run Code Online (Sandbox Code Playgroud)

得到:

“artifactory”的不支持的 docker v2 存储库请求

这个错误是什么意思?

人工抱怨的 V2 部分是什么?

artifactory docker

2
推荐指数
1
解决办法
4984
查看次数