зеркало из https://github.com/mozilla/bugbug.git
Use taskboot to deploy to PyPI (#923)
This commit is contained in:
Родитель
6426361dbf
Коммит
69b9c34289
|
@ -25,6 +25,8 @@ tasks:
|
|||
$if: 'tasks_for == "github-pull-request"'
|
||||
then: ${event.pull_request.head.repo.html_url}
|
||||
else: ${event.repository.html_url}
|
||||
|
||||
taskboot_image: "mozilla/taskboot:0.1.10"
|
||||
in:
|
||||
$if: 'tasks_for in ["github-pull-request", "github-push"]'
|
||||
then:
|
||||
|
@ -173,7 +175,7 @@ tasks:
|
|||
capabilities:
|
||||
privileged: true
|
||||
maxRunTime: 10800
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
env:
|
||||
REGISTRY: registry.hub.docker.com
|
||||
VERSION:
|
||||
|
@ -222,16 +224,14 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: python
|
||||
image: "${taskboot_image}"
|
||||
command:
|
||||
- "/bin/bash"
|
||||
- "-lcx"
|
||||
- "git clone --quiet ${repository} &&
|
||||
cd bugbug &&
|
||||
git -c advice.detachedHead=false checkout ${head_rev} &&
|
||||
python setup.py sdist bdist_wheel &&
|
||||
pip install --quiet twine &&
|
||||
python infra/pypi.py"
|
||||
- taskboot
|
||||
- deploy-pypi
|
||||
env:
|
||||
TASKCLUSTER_SECRET: project/relman/bugbug/deploy
|
||||
GIT_REPOSITORY: "${repository}"
|
||||
GIT_REVISION: "${head_rev}"
|
||||
metadata:
|
||||
name: bugbug PyPI release
|
||||
description: bugbug PyPI release
|
||||
|
@ -258,7 +258,7 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
env:
|
||||
TASKCLUSTER_SECRET: project/relman/bugbug/deploy
|
||||
command:
|
||||
|
@ -289,7 +289,7 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
env:
|
||||
VERSION: {$eval: 'head_branch[10:]'}
|
||||
command:
|
||||
|
@ -324,7 +324,7 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-lcxe"
|
||||
|
@ -358,7 +358,7 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-lcxe"
|
||||
|
@ -390,7 +390,7 @@ tasks:
|
|||
taskclusterProxy:
|
||||
true
|
||||
maxRunTime: 3600
|
||||
image: mozilla/taskboot:0.1.9
|
||||
image: "${taskboot_image}"
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-lcxe"
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import requests
|
||||
|
||||
r = requests.get(
|
||||
f'{os.environ["TASKCLUSTER_PROXY_URL"]}/secrets/v1/secret/project/relman/bugbug/deploy'
|
||||
)
|
||||
r.raise_for_status()
|
||||
data = r.json()
|
||||
|
||||
os.environ["TWINE_USERNAME"] = data["secret"]["pypi"]["username"]
|
||||
os.environ["TWINE_PASSWORD"] = data["secret"]["pypi"]["password"]
|
||||
|
||||
subprocess.run(["twine", "upload", "dist/*"], check=True)
|
Загрузка…
Ссылка в новой задаче