概述
1. 获取files list
curl -u ${JFROG_USER}:${JFROG_PWD} -X POST ${ARTIFACTORY_URL}/api/search/aql -H 'Content-Type: text/plain' -d
"items.find({
"type" : "file",
"repo" : {"$eq" : "${atf_repo}"},
"path":{"$match":"${atf_path}*"}
}).include("name","repo","path","actual_md5","type")" | tee "${tmp_file}"
2.获取多少天创建的files list
curl -u ${JFROG_USER}:${JFROG_PWD} -X POST ${ARTIFACTORY_URL}/api/search/aql -H 'Content-Type: text/plain' -d
"items.find({
"type" : "file",
"repo" : {"$eq" : "${repo}"},
"$or": [
{
"$and": [
{
"created": { "$before":"${retention_days}d" }
}
]
}
]
}).include("name","repo","path","actual_md5","type")"
| jq '.results'
| jq '.[] |
"(.repo)/(.path)/(.name)"'
| sed 's/"//g'
| sed "s#^#${ARTIFACTORY_URL}/#g"
3. 下载文件
curl -u ${JFROG_USER}:${JFROG_PWD} -O ${ARTIFACTORY_URL}/temp/1.txt
4.上传文件
curl -X PUT -u ${JFROG_USER}:${JFROG_PWD} -T 1.txt "${ARTIFACTORY_URL}/temp/1.txt"
# deploy files with property
curl -X PUT -u ${JFROG_USER}:${JFROG_PWD} -T 1.sh "${ARTIFACTORY_URL}/temp/1.sh;retention.days=20;build_os=ubuntu-18.04;"
5. copy 文件
curl -X POST -u ${JFROG_USER}:${JFROG_PWD} ${ARTIFACTORY_URL}/api/copy/temp/1.txt?to=temp/2.txt
6. 删除文件
curl -X DELETE -u ${JFROG_USER}:${JFROG_PWD} ${ARTIFACTORY_URL}/temp/1.txt
最后
以上就是年轻帽子为你收集整理的artifactory api 在shell中的调用的全部内容,希望文章能够帮你解决artifactory api 在shell中的调用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复