DeepSpeech/taskcluster.disabled.yml

103 строки
3.9 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

version: 1
policy:
pullRequests: collaborators_quiet
2017-04-05 11:34:16 +03:00
tasks:
$let:
metadata:
task_id: {$eval: as_slugid("decision_task")}
2017-04-05 11:34:16 +03:00
github:
$if: 'tasks_for == "github-pull-request"'
then:
action: "pull_request.${event.action}"
login: ${event.pull_request.user.login}
ref: ${event.pull_request.head.ref}
2020-12-19 12:23:32 +03:00
branch: ${event.pull_request.head.ref}
tag: ""
sha: ${event.pull_request.head.sha}
clone_url: ${event.pull_request.head.repo.clone_url}
else:
action:
$if: 'event.ref[:10] == "refs/tags/"'
then: "tag"
else: "push"
login: ${event.pusher.name}
2020-12-19 02:49:33 +03:00
ref: ${event.ref}
2020-12-19 12:23:32 +03:00
branch:
$if: 'event.ref[:11] == "refs/heads/"'
then: ${event.ref[11:]}
else: ""
tag:
$if: 'event.ref[:10] == "refs/tags/"'
then: ${event.ref[10:]}
2020-12-19 12:23:32 +03:00
else: ""
sha: ${event.after}
clone_url: ${event.repository.clone_url}
in:
$let:
decision_task:
taskId: ${metadata.task_id}
created: {$fromNow: ''}
deadline: {$fromNow: '60 minutes'}
provisionerId: "proj-deepspeech"
workerType: "ci-decision-task"
scopes: [
"queue:create-task:highest:proj-deepspeech/*",
"queue:route:index.project.deepspeech.*",
"index:insert-task:project.deepspeech.*",
"queue:scheduler-id:taskcluster-github",
"generic-worker:cache:deepspeech-macos-pyenv",
"docker-worker:capability:device:kvm"
]
payload:
maxRunTime: 600
2021-01-23 21:08:22 +03:00
image: "ubuntu:18.04"
features:
taskclusterProxy: true
env:
TASK_ID: ${metadata.task_id}
GITHUB_HEAD_USER_LOGIN: ${metadata.github.login}
GITHUB_HEAD_USER_EMAIL: ${metadata.github.login}@users.noreply.github.com
GITHUB_EVENT: ${metadata.github.action}
GITHUB_HEAD_REPO_URL: ${metadata.github.clone_url}
2020-12-19 12:23:32 +03:00
GITHUB_HEAD_BRANCH: ${metadata.github.branch}
GITHUB_HEAD_TAG: ${metadata.github.tag}
GITHUB_HEAD_REF: ${metadata.github.ref}
GITHUB_HEAD_SHA: ${metadata.github.sha}
command:
- "/bin/bash"
- "--login"
- "-cxe"
- >
2021-01-23 21:08:22 +03:00
echo "deb http://archive.ubuntu.com/ubuntu/ bionic-updates main" > /etc/apt/sources.list.d/bionic-updates.list &&
apt-get -qq update && apt-get -qq -y install git python3-pip curl sudo &&
adduser --system --home /home/build-user build-user &&
cd /home/build-user/ &&
echo -e "#!/bin/bash\nset -xe\nenv && id && mkdir ~/DeepSpeech/ && git clone --quiet ${metadata.github.clone_url} ~/DeepSpeech/ds/ && cd ~/DeepSpeech/ds && git checkout --quiet ${metadata.github.ref}" > /tmp/clone.sh && chmod +x /tmp/clone.sh &&
sudo -H -u build-user /bin/bash /tmp/clone.sh &&
sudo -H -u build-user --preserve-env /bin/bash /home/build-user/DeepSpeech/ds/taskcluster/tc-schedule.sh
artifacts:
"public":
type: "directory"
path: "/tmp/artifacts/"
expires: {$fromNow: '7 days'}
metadata:
name: "DeepSpeech decision task"
description: "DeepSpeech decision task"
owner: "${metadata.github.login}@users.noreply.github.com"
source: "${metadata.github.clone_url}"
in:
$flattenDeep:
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then: {$eval: decision_task}
- $if: 'tasks_for == "github-push" && event.ref == "refs/heads/master"'
then: {$eval: decision_task}
- $if: 'tasks_for == "github-push" && event.ref[:10] == "refs/tags/"'
then: {$eval: decision_task}