Bug 1137820 part 3: Move phone builder scripts to gecko tree.

This avoids we have to generate a new image each time the build scripts
change.
This commit is contained in:
Wander Lairson Costa 2015-03-12 07:13:54 -03:00
parent c1cc3fcb96
commit 34272909d1
4 changed files with 39 additions and 26 deletions

View File

@ -9,5 +9,5 @@ ADD system-setup.sh /tmp/system-setup.sh
RUN /tmp/system-setup.sh
# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]
ENTRYPOINT ["validate_task.py"]

View File

@ -7,6 +7,7 @@ import json
import urllib2
import sys
import re
import subprocess
repo_matcher = re.compile(r'[a-z]+://(hg|git)\.mozilla\.org')
@ -49,11 +50,17 @@ def main():
taskid = os.getenv('TASK_ID')
# If the task id is None, we assume we are running docker locally
if taskid is None:
sys.exit(0)
if taskid is not None:
task = get_task(taskid)
ret = check_task(task)
if ret != 0:
sys.exit(ret)
task = get_task(taskid)
sys.exit(check_task(task))
if len(sys.argv) > 1:
try:
subprocess.call(sys.argv[1:], shell=True)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)
if __name__ == '__main__':
main()

View File

@ -1,6 +1,13 @@
#! /bin/bash -vex
# Ensure all the scripts in this dir are on the path....
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PATH=$DIRNAME:$PATH
WORKSPACE=$1
### Check that require variables are defined
test -d $WORKSPACE
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
@ -9,10 +16,7 @@ test $MOZHARNESS_REV # mozharness revision
test $TARGET
test $VARIANT
if ! validate_task.py; then
echo "Not a valid task" >&2
exit 1
fi
. ../builder/setup-ccache.sh
# First check if the mozharness directory is available. This is intended to be
# used locally in development to test mozharness changes:
@ -23,15 +27,13 @@ if [ ! -d mozharness ]; then
tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV
fi
OBJDIR="$HOME/object-folder"
if [ ! -d $OBJDIR ]; then
mkdir -p $OBJDIR
fi
# Figure out where the remote manifest is so we can use caches for it.
MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)
tc-vcs repo-checkout $OBJDIR/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
# Ensure symlink has been created to gecko...
rm -f $WORKSPACE/B2G/gecko
ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
debug_flag=""
if [ 0$B2G_DEBUG -ne 0 ]; then
@ -42,7 +44,7 @@ backup_file=$(aws --output=text s3 ls s3://b2g-phone-backups/$TARGET/ | tail -1
if echo $backup_file | grep '\.tar\.bz2'; then
aws s3 cp s3://b2g-phone-backups/$TARGET/$backup_file .
tar -xjf $backup_file -C $OBJDIR/B2G
tar -xjf $backup_file -C $WORKSPACE/B2G
rm -f $backup_file
fi
@ -51,7 +53,7 @@ fi
"$debug_flag" \
--disable-mock \
--variant=$VARIANT \
--work-dir=$OBJDIR/B2G \
--work-dir=$WORKSPACE/B2G \
--gaia-languages-file locales/languages_all.json \
--log-level=debug \
--target=$TARGET \
@ -61,13 +63,15 @@ fi
--repo=$GECKO_HEAD_REPOSITORY
# Don't cache backups
rm -rf $OBJDIR/B2G/backup-*
rm -rf $WORKSPACE/B2G/backup-*
# Move files into artifact locations!
mkdir -p artifacts
mv $OBJDIR/B2G/upload/sources.xml artifacts/sources.xml
mv $OBJDIR/B2G/upload/b2g-*.crashreporter-symbols.zip artifacts/b2g-crashreporter-symbols.zip
mv $OBJDIR/B2G/upload/b2g-*.android-arm.tar.gz artifacts/b2g-android-arm.tar.gz
mv $OBJDIR/B2G/upload/${TARGET}.zip artifacts/${TARGET}.zip
mv $OBJDIR/B2G/upload/gaia.zip artifacts/gaia.zip
mv $WORKSPACE/B2G/upload/sources.xml artifacts/sources.xml
mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz artifacts/b2g-android-arm.tar.gz
mv $WORKSPACE/B2G/upload/${TARGET}.zip artifacts/${TARGET}.zip
mv $WORKSPACE/B2G/upload/gaia.zip artifacts/gaia.zip
ccache -s

View File

@ -13,8 +13,10 @@ task:
maxRunTime: 14400
command:
- with_workspace
- build-phone.sh
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
buildbot_step 'Build' ./build-phone.sh $HOME/workspace
extra:
# Rather then enforcing particular conventions we require that all build