跳转到主要内容

Taskcluster 工具

项目描述

https://travis-ci.org/askeing/taskcluster-util-python.svg

Python Taskcluster 工具。

安装

要安装 taskcluster_util,只需

$ pip install -U taskcluster_util

工具用法

临时凭证

您可以从https://auth.taskcluster.net/(使用具有LDAP账户的Persona)获取您的临时凭证。

临时凭证将在31天内有效。

或者,您可以直接运行 taskcluster_login 以获取您的凭证。(注意:它将删除您的旧凭证文件。)

tc_credentials.json

您可以将凭证放入主目录下的 tc_credentials.json 文件中。

$ <YOUR_EDITOR> ~/tc_credentials.json

文件格式将是

{
    "clientId": "<YOUR_CLIENTID>",
    "accessToken": "<YOUR_ACCESSTOKEN>",
    "certificate": <YOUR_CERTIFICATE>
}

以下是一个简单的示例

{
    "clientId": "foo-XXX",
    "accessToken": "hello-world-XXX",
    "certificate": {"version":1,"scopes":["*"],"start":1,"expiry":9,"seed":"hello","signature":"world="}
}

taskcluster_download

从命令行下载工件。

usage: taskcluster_download [-h] [--credentials CREDENTIALS]
                            (-n NAMESPACE | -t TASK_ID) [-a ARITFACT_NAME]
                            [-d DEST_DIR] [-v]

The simple download tool for Taskcluster.

optional arguments:
  -h, --help            show this help message and exit
  --credentials CREDENTIALS
                        The credential JSON file
                        (default: <YOUR_HOME>/tc_credentials.json)
  -n NAMESPACE, --namespace NAMESPACE
                        The namespace of task
  -t TASK_ID, --taskid TASK_ID
                        The taskId of task
  -v, --verbose         Turn on verbose output, with all the debug logger.

Download Artifact:
  The artifact name and dest folder

  -a ARITFACT_NAME, --artifact ARITFACT_NAME
                        The artifact name on Taskcluster
  -d DEST_DIR, --dest-dir DEST_DIR
                        The dest folder (default: current working folder)
  -u, --signed-url-only
                        Retrieve the signed url and display it.
                        No download is done.

The tc_credentials.json Template:
    {
        "clientId": "",
        "accessToken": "",
        "certificate": {
            "version":1,
            "scopes":["*"],
            "start":xxx,
            "expiry":xxx,
            "seed":"xxx",
            "signature":"xxx"
        }
    }

taskcluster_traverse

遍历命名空间并从GUI下载工件。

usage: taskcluster_traverse [-h] [--credentials CREDENTIALS] [-n NAMESPACE]
                            [-d DEST_DIR] [-v]

The simple GUI traverse and download tool for Taskcluster.

optional arguments:
  -h, --help            show this help message and exit
  --credentials CREDENTIALS
                        The credential JSON file
                        (default: <YOUR_HOME>/tc_credentials.json)
  -n NAMESPACE, --namespace NAMESPACE
                        The namespace of task
  -d DEST_DIR, --dest-dir DEST_DIR
                        The dest folder (default: current working folder)
  -v, --verbose         Turn on verbose output, with all the debug logger.

The tc_credentials.json Template:
    {
        "clientId": "",
        "accessToken": "",
        "certificate": {
            "version":1,
            "scopes":["*"],
            "start":xxx,
            "expiry":xxx,
            "seed":"xxx",
            "signature":"xxx"
        }
    }

taskcluster_login

登录Taskcluster,获取临时凭证,并保存到主目录。

usage: taskcluster_login [-h] [-a ADDRESS] [-p PORT] [--file CREDENTIALS_FILE]
                         [-v]

The simple login tool for Taskcluster.

optional arguments:
  -h, --help            show this help message and exit
  -a ADDRESS, --address ADDRESS
                        Specify the server address. (default: localhost)
  -p PORT, --port PORT  Specify the server port. (default: 0)
  --file CREDENTIALS_FILE
                        The credentials file. It will be overwritten if it
                        already exist. (default:
                        /Users/Askeing/tc_credentials.json)
  -v, --verbose         Turn on verbose output, with all the debug logger.
                        (default: False)

SSL InsecurePlatformWarning

如果在运行工具时收到以下错误消息,请安装 requests[security] 包。

InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

通过pip install安装包。请注意,它对于Python 2.7.9+不是必需的。

pip install requests[security]

如果在安装 requests[security] 时收到 Setup script exited with error: command ‘gcc’ failed with exit status 1 错误,请安装 libffi-dev。(Ubuntu)

sudo apt-get install libffi-dev

其他问题

如果您遇到与urllib3、SSL或tk相关的问题,请安装以下包。(Ubuntu)

sudo apt-get install python python-dev python-setuptools libffi-dev libssl-dev python-tk
sudo easy_install pip
sudo pip install -U pip setuptools
sudo pip install -U requests
sudo pip install -U requests[security]

版本历史

0.0.30 (2016-01-29)

错误修复

  • 修复版本类型错误… :(

0.0.28 (2016-01-29)

功能和改进

  • 减少日志信息。

0.0.27 (2016-01-05)

功能和改进

  • 将taskcluster-client.py更新到0.0.32。

错误修复

  • 修复下载的gzip编码问题。

0.0.26 (2015-12-24)

功能和改进

  • 修改taskcluster_download方法,使其更易使用。

0.0.25 (2015-11-30)

功能和改进

  • 添加taskcluster_login方法以获取凭证。

  • 获取凭证时,对用户的选择进行更严格的限制。

错误修复

  • 修复查询为空字符串时的错误(taskcluster_login)。

0.0.24 (2015-11-23)

功能和改进

  • 添加taskcluster_login方法以获取凭证。

0.0.23 (2015-11-23)

功能和改进

  • 检查凭证是否过期,并在控制台打印。

错误修复

  • 加载凭证文件错误时引发异常。

0.0.22 (2015-11-06)

错误修复

  • 下载后清理dest_dir和download_file_list的缓存。

0.0.21 (2015-11-04)

功能和改进

  • 提供一种将TaskCluster构建提供给Bitbar的方法(问题编号1189354)。

0.0.20 (2015-11-02)

功能和改进

  • 修改类以支持继承。

0.0.19 (2015-10-30)

功能和改进

  • 修改taskcluster_traverse的日志和GUI。

0.0.18 (2015-10-30)

功能和改进

  • 将tc_credentials.json移动到用户的主目录。

  • 更新README文件。

  • 更新使用说明。

  • 修改taskcluster_traverse的凭证输入GUI。

0.0.17 (2015-10-27)

功能和改进

  • 添加凭证信息。

0.0.16 (2015-10-13)

错误修复

  • 修复在没有凭证时下载公共工件的问题。

0.0.15 (2015-10-02)

功能和改进

  • 将taskcluster库升级到0.0.27,修复了bewit问题。

  • 通过签名URL下载工件,而不是API方法。

0.0.14 (2015-10-01)

错误修复

  • 修复内部服务器错误(由taskcluster v0.0.21引起)。

0.0.13 (2015-09-07)

功能和改进

  • 重构。

  • 使用prograssbar包显示下载进度。

  • 下载后添加“do_after_download”钩子点。

0.0.12 (2015-09-04)

错误修复

  • 修复一些描述错误。

0.0.11 (2015-09-04)

功能和改进

  • 添加taskcluster_traverse。

  • 修改setup.py、HISTORY和README。

  • 为TaskFinder添加更多功能。

  • 添加Makefile和travis ci设置。

  • 添加单元测试用例。

错误修复

  • 修复下载多次时删除临时文件夹的问题。

0.0.10 (2015-08-04)

功能和改进

  • 从taskcluster下载工件。

0.0.1 (2015-07-15)

  • 启动项目。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

taskcluster_util-0.0.30.tar.gz (16.5 kB 查看哈希值)

上传时间

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面