зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1109346: Use tc-vcs for cloning repos. r=lightsofapollo
--HG-- rename : testing/docker/phone-builder/tests/invalid_repo.yml => testing/docker/phone-builder/tests/invalid_head_repo.yml extra : rebase_source : c94926e0159ebd3d4f86f0496d74262d68d32024 extra : source : b71cb513b0304ba272c04003c3d4deada9fee157 extra : histedit_source : 0ebef5f218febcbd2e813e4fdd1849e55c13604a
This commit is contained in:
Родитель
3bd6cddfa6
Коммит
24e80daf54
|
@ -1 +1 @@
|
|||
0.0.28
|
||||
0.0.29
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
### Check that require variables are defined
|
||||
test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
|
||||
test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
|
||||
test $GECKO_HEAD_REV # Should be an hg revision to pull down
|
||||
test $TARGET
|
||||
|
||||
|
@ -11,7 +12,7 @@ test $TARGET
|
|||
# $ docker -v your_mozharness:/home/worker/mozharness ...
|
||||
#
|
||||
if [ ! -d mozharness ]; then
|
||||
hg clone https://hg.mozilla.org/build/mozharness mozharness
|
||||
tc-vcs clone https://hg.mozilla.org/build/mozharness mozharness
|
||||
fi
|
||||
|
||||
OBJDIR="$HOME/object-folder"
|
||||
|
@ -21,7 +22,7 @@ if [ ! -d $OBJDIR ]; then
|
|||
fi
|
||||
|
||||
if [ ! -d $OBJDIR/B2G ]; then
|
||||
git clone https://git.mozilla.org/b2g/B2G.git $OBJDIR/B2G
|
||||
tc-vcs clone https://git.mozilla.org/b2g/B2G.git $OBJDIR/B2G
|
||||
fi
|
||||
|
||||
debug_flag=""
|
||||
|
@ -38,6 +39,7 @@ fi
|
|||
--target=$TARGET \
|
||||
--b2g-config-dir=$TARGET \
|
||||
--checkout-revision=$GECKO_HEAD_REV \
|
||||
--base-repo=$GECKO_BASE_REPOSITORY \
|
||||
--repo=$GECKO_HEAD_REPOSITORY
|
||||
|
||||
# Move files into artifact locations!
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM quay.io/mozilla/builder:0.0.24
|
||||
FROM quay.io/mozilla/builder:0.0.29
|
||||
MAINTAINER Wander Lairson Costa <wcosta@mozilla.com>
|
||||
|
||||
# Add utilities and configuration
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.2
|
||||
0.0.3
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
### Check that require variables are defined
|
||||
test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
|
||||
test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
|
||||
test $GECKO_HEAD_REV # Should be an hg revision to pull down
|
||||
test $TARGET
|
||||
|
||||
|
@ -16,7 +17,7 @@ fi
|
|||
# $ docker -v your_mozharness:/home/worker/mozharness ...
|
||||
#
|
||||
if [ ! -d mozharness ]; then
|
||||
git clone https://github.com/walac/build-mozharness.git mozharness
|
||||
tc-vcs clone https://hg.mozilla.org/build/mozharness mozharness
|
||||
fi
|
||||
|
||||
OBJDIR="$HOME/object-folder"
|
||||
|
@ -26,7 +27,7 @@ if [ ! -d $OBJDIR ]; then
|
|||
fi
|
||||
|
||||
if [ ! -d $OBJDIR/B2G ]; then
|
||||
git clone https://git.mozilla.org/b2g/B2G.git $OBJDIR/B2G
|
||||
tc-vcs clone https://git.mozilla.org/b2g/B2G.git $OBJDIR/B2G
|
||||
fi
|
||||
|
||||
debug_flag=""
|
||||
|
@ -51,6 +52,7 @@ fi
|
|||
--target=$TARGET \
|
||||
--b2g-config-dir=$TARGET \
|
||||
--checkout-revision=$GECKO_HEAD_REV \
|
||||
--base-repo=$GECKO_BASE_REPOSITORY \
|
||||
--repo=$GECKO_HEAD_REPOSITORY
|
||||
|
||||
# Don't cache backups
|
||||
|
|
|
@ -8,20 +8,31 @@ import urllib2
|
|||
import sys
|
||||
import re
|
||||
|
||||
repo_matcher = re.compile(r'[a-z]+://(hg|git)\.mozilla\.org')
|
||||
|
||||
def get_task(taskid):
|
||||
return json.load(urllib2.urlopen('https://queue.taskcluster.net/v1/task/' + taskid))
|
||||
|
||||
def check_task(task):
|
||||
payload = task['payload']
|
||||
|
||||
if 'REPOSITORY' not in payload['env']:
|
||||
print('Task has no gecko repository', file=sys.stderr)
|
||||
if 'GECKO_HEAD_REPOSITORY' not in payload['env']:
|
||||
print('Task has no head gecko repository', file=sys.stderr)
|
||||
return -1
|
||||
|
||||
repo = payload['env']['REPOSITORY']
|
||||
repo = payload['env']['GECKO_HEAD_REPOSITORY']
|
||||
# if it is not a mozilla repository, fail
|
||||
if not re.match(r'[a-z]+://hg\.mozilla\.org', repo):
|
||||
print('Invalid repository', repo, file=sys.stderr)
|
||||
if not repo_matcher.match(repo):
|
||||
print('Invalid head repository', repo, file=sys.stderr)
|
||||
return -1
|
||||
|
||||
if 'GECKO_BASE_REPOSITORY' not in payload['env']:
|
||||
print('Task has no base gecko repository', file=sys.stderr)
|
||||
return -1
|
||||
|
||||
repo = payload['env']['GECKO_BASE_REPOSITORY']
|
||||
if not repo_matcher.match(repo):
|
||||
print('Invalid base repository', repo, file=sys.stderr)
|
||||
return -1
|
||||
|
||||
if 'artifacts' in payload:
|
||||
|
|
|
@ -22,7 +22,8 @@ task:
|
|||
B2G_DEBUG: '1'
|
||||
# revision/project params defined originally here https://github.com/taskcluster/taskcluster-try/blob/master/try/instantiate.js
|
||||
REVISION: 'tip'
|
||||
REPOSITORY: 'git@github.com:mozilla/gecko-dev.git'
|
||||
GECKO_HEAD_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
GECKO_BASE_REPOSITORY: 'git@github.com:mozilla/gecko-dev.git'
|
||||
|
||||
image: 'quay.io/mozilla/phone-builder:0.0.1'
|
||||
maxRunTime: 14400
|
|
@ -0,0 +1,50 @@
|
|||
taskId: 1
|
||||
task:
|
||||
metadata:
|
||||
source: http://todo.com/soon
|
||||
owner: user@domain.com
|
||||
name: B2G Emulator
|
||||
description: B2G Emulator
|
||||
|
||||
workerType: b2gbuild
|
||||
provisionerId: aws-provisioner
|
||||
|
||||
scopes:
|
||||
- 'docker-worker:cache:build-emulator-objects'
|
||||
- 'docker-worker:image:quay.io/mozilla/phone-builder:0.0.1'
|
||||
|
||||
payload:
|
||||
cache:
|
||||
build-emulator-objects: '/home/worker/object-folder-flame-kk-1'
|
||||
|
||||
env:
|
||||
TARGET: 'flame-kk'
|
||||
B2G_DEBUG: '1'
|
||||
# revision/project params defined originally here https://github.com/taskcluster/taskcluster-try/blob/master/try/instantiate.js
|
||||
REVISION: 'tip'
|
||||
GECKO_HEAD_REPOSITORY: 'git@github.com:mozilla/gecko-dev.git'
|
||||
GECKO_BASE_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
|
||||
image: 'quay.io/mozilla/phone-builder:0.0.1'
|
||||
maxRunTime: 14400
|
||||
|
||||
command:
|
||||
- build-phone.sh
|
||||
|
||||
artifacts:
|
||||
'private/build':
|
||||
type: directory
|
||||
path: '/home/worker/artifacts/'
|
||||
|
||||
extra:
|
||||
# Rather then enforcing particular conventions we require that all build
|
||||
# tasks provide the "build" extra field to specify where the build and tests
|
||||
# files are located.
|
||||
locations:
|
||||
build: 'private/build/emulator.tar.gz'
|
||||
tests: 'private/build/b2g-tests.zip'
|
||||
symbols: 'private/build/b2g-crashreporter-symbols.zip'
|
||||
sources: 'private/build/sources.xml'
|
||||
|
||||
treeherder:
|
||||
symbol: B
|
|
@ -22,7 +22,8 @@ task:
|
|||
B2G_DEBUG: '1'
|
||||
# revision/project params defined originally here https://github.com/taskcluster/taskcluster-try/blob/master/try/instantiate.js
|
||||
REVISION: 'tip'
|
||||
REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
GECKO_HEAD_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
GECKO_BASE_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
|
||||
image: 'quay.io/mozilla/phone-builder:0.0.1'
|
||||
maxRunTime: 14400
|
||||
|
|
|
@ -15,8 +15,12 @@ class TaskValidationTest(unittest.TestCase):
|
|||
task = load_task('valid.yml')
|
||||
self.assertEquals(check_task(task), 0)
|
||||
|
||||
def test_invalid_repo(self):
|
||||
task = load_task('invalid_repo.yml')
|
||||
def test_invalid_base_repo(self):
|
||||
task = load_task('invalid_base_repo.yml')
|
||||
self.assertEquals(check_task(task), -1)
|
||||
|
||||
def test_invalid_head_repo(self):
|
||||
task = load_task('invalid_head_repo.yml')
|
||||
self.assertEquals(check_task(task), -1)
|
||||
|
||||
def test_public_artifact(self):
|
||||
|
|
|
@ -22,7 +22,8 @@ task:
|
|||
B2G_DEBUG: '1'
|
||||
# revision/project params defined originally here https://github.com/taskcluster/taskcluster-try/blob/master/try/instantiate.js
|
||||
REVISION: 'tip'
|
||||
REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
GECKO_HEAD_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
GECKO_BASE_REPOSITORY: 'http://hg.mozilla.org/mozilla-central'
|
||||
|
||||
image: '{{#docker_image}}phone-builder{{/docker_image}}'
|
||||
maxRunTime: 14400
|
||||
|
|
Загрузка…
Ссылка в новой задаче