这就是我所拥有的:
\n\n#!/usr/bin/env groovy\n\npipeline {\n agent none\n stages {\n stage(\'Checkout SCM\') {\n agent { label \'win\' && \'apple\' && \'rhel\' }\n steps {\n echo "Cloning Repository"\n checkout([$class: \'GitSCM\',\n branches: [[name: "*/develop"]],\n doGenerateSubmoduleConfigurations: false,\n extensions: [[$class: \'WipeWorkspace\']],\n submoduleCfg: [],\n userRemoteConfigs: [[credentialsId: \'UNAME\', url: \'URL\']],\n browser: [$class: \'BitbucketWeb\', repoUrl: \'URL\'],\n ])}}\n\n stage(\'Building Win64, Linux764, MacOS\') {\n agent { label \'win&&rhel&&apple\' }\n steps {\n script {\n echo \'************************\'\n echo \'*****BUILDING JOBS******\'\n echo \'************************\'\n sh \'python build.py\'\n sh \'cd ion-js && npm run prepublishOnly\'\n …Run Code Online (Sandbox Code Playgroud) 我正在运行以下 curl 命令:
results=$(curl -USERNAME:PASSWORD "URL/search/dates?dateFields=created&from=${Three_Months_Ago}&today&repos=generic-sgca")
echo "$results"
Run Code Online (Sandbox Code Playgroud)
我得到这个回报:
"results" : [ {
"uri" : "URL/api/storage/generic-sgca/Lastest_Deploy.tar",
"created" : "2017-09-14T11:59:14.483-06:00"
}, {
"uri" : "URL/api/storage/generic-sgca/Installer-Deploy-0.0.5/SignalStudioPro-Alpha-1-linux-x64-installer.run",
"created" : "2017-09-14T20:11:37.733-06:00"
}
Run Code Online (Sandbox Code Playgroud)
它似乎实际上并未将 curl 结果存储为数组。我希望能够将每个“uri”存储为变量并使用“-X DELETE”命令删除每个文件。我怎样才能自己获得“uri”行,删除“created”选项。
编辑:
我使用了以下命令:
results=$(curl -username:password "URL/api/search/dates?dateFields=created&from=${Three_Months_Ago}&today&repos=generic-sgca" | jq -r '.results[].uri')
echo "$results"
Run Code Online (Sandbox Code Playgroud)
我得到了这个回报:
URL/api/storage/generic-sgca/Lastest_Deploy.tar
URL/api/storage/generic-sgca/Installer-Deploy-0.0.5/SignalStudioPro-Alpha-1-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-0.0.5/SignalStudioPro-Alpha-1-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-0.0.99/SignalStudioPro-Alpha-1-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-0.0.99/SignalStudioPro-Alpha-1-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-0.2.0/SignalStudioPro-Alpha-2-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-0.2.0/SignalStudioPro-Alpha-2-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-100.0.0/SignalStudioPro-Alpha-2-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-100.0.0/SignalStudioPro-Alpha-2-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-101.0.0/SignalStudioPro-Alpha-2-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-101.0.0/SignalStudioPro-Alpha-2-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-99.9.9/SignalStudioPro-Alpha-2-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-99.9.9/SignalStudioPro-Alpha-2-windows-installer.exe
URL/api/storage/generic-sgca/Installer-Deploy-99.9.91/SignalStudioPro-Alpha-2-linux-x64-installer.run
URL/api/storage/generic-sgca/Installer-Deploy-99.9.91/SignalStudioPro-Alpha-2-windows-installer.exe
Run Code Online (Sandbox Code Playgroud)
现在我想运行 curl -X DELETE 命令来从我的 Artifactory 页面中删除每个 url。命令将是:
curl username:password -X DELETE "URL FROM ABOVE"
Run Code Online (Sandbox Code Playgroud)
但我无法弄清楚如何将每一行存储为一个单独的变量,以便我可以删除每一行。
我的团队有很多节点连接到我们的 Jenkins 实例。目前50多。当查看 Jenkins UI 时,它会在主屏幕左侧的“BUILD EXECUTOR STATUS”下创建每个节点的长垂直列表。
有没有办法将这些节点分组在一起以使该列表不那么荒谬?
我正在讨论的列表在这里:
https://i.stack.imgur.com/idjtB.png
我想制作自定义下拉文件夹,如 WINDOWS、APPLE、LINUX,并将所有相关节点都放在这些列表中,而不是在一个长列表中显示所有内容。
这可能吗?或者制作自定义视图仍然是我唯一的选择?