Index

Table of contents

Artifactory

get local file from repo
wget --user=[user] --password=[api_key] https://example.com/artifactory/libs-snapshot-local/[pkg]/[version]/[artifact]-[version].jar
wget --user=[user] --password=[api_key] https://example.com/artifactory/libs-release-local/[pkg]/[version]/[artifact]-[version].jar
store file in repo locally
curl -u [user]:[api_key] -X PUT "https://example.com/artifactory/libs-snapshot-local/[pkg]/[version]/[artifact]-[version].jar" -T [file]
curl -u [user]:[api_key] -X PUT "https://example.com/artifactory/libs-release-local/[pkg]/[version]/[artifact]-[version].jar" -T [file]

AQL

run an aql query on artifactory
curl -u "$user:$key" --data "@query.aql" http://example.com/artifactory/api/search/aql -H "Content-Type: text/plain"
example: query.aql
items.find({
    "repo": "myproject",
    "path": {"$match": "path/with/wildcard????/**"},
    "$or": [
        {"name": {"$match": "*.zip"}},
        {"name": {"$match": "*.jar"}}
    ]
})
.include("name", "repo", "path", "created")
.sort({"$desc": ["created"]})
.limit(1)
documentation
https://www.jfrog.com/confluence/display/JFROG/Artifactory+Query+Language