[英]Downloading build files from Jenkins
我在URL中有Jenkins的版本列表
http://<hostname>/ci/view/XX-CI/job/XX-2%20UI%20Demo/ws/build/dist/
Jenkins需要登錄,並使用Google帳戶進行身份驗證。
我正在嘗試使用請求使用簡單的python腳本在構建位置中查找最新文件並將其下載。
為了查找最新文件,我編寫了一個簡單的python腳本,如下所示。 我的想法是獲取HTML響應並解析html響應以獲取最新的構建文件名並下載相同的文件名。
#!/usr/bin/python
import requests
resp = requests.get('http://<hostname>/ci/view/XX-CI/job/XX-2%20UI%20Demo/ws/build/dist/', auth=('username', 'pass'))
print rep.text
我得到如下輸出
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<title>Sign in - Google Accounts</title>
<meta http-equiv="refresh" content="1; url=https://www.google.com/accounts/AccountChooser?hd=accedo.tv&
這意味着我在腳本中傳遞的身份驗證詳細信息不成功。
Google帳戶無法通過這種方式進行身份驗證嗎? 有沒有更好的方法?
您是否嘗試過使用API令牌 ?
通過此解決方案,您可以使用以下URL:
http://username:api-token@<hostname>/ci/view/XX-CI/job/XX-2%20UI%20Demo/ws/build/dist/
它應該做的工作:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.