repackage.sh (2693B)
1 #! /bin/bash -vex 2 3 set -x -e 4 5 echo "running as" $(id) 6 7 #### 8 # Taskcluster friendly wrapper for performing fx desktop builds via mozharness. 9 #### 10 11 # Inputs, with defaults 12 13 : MOZHARNESS_SCRIPT ${MOZHARNESS_SCRIPT} 14 : MOZHARNESS_CONFIG ${MOZHARNESS_CONFIG} 15 : MOZHARNESS_CONFIG_PATHS ${MOZHARNESS_CONFIG_PATHS} 16 : MOZHARNESS_ACTIONS ${MOZHARNESS_ACTIONS} 17 : MOZHARNESS_OPTIONS ${MOZHARNESS_OPTIONS} 18 19 : TOOLTOOL_CACHE ${TOOLTOOL_CACHE:=/builds/worker/tooltool-cache} 20 21 : MOZ_SCM_LEVEL ${MOZ_SCM_LEVEL:=1} 22 23 : WORKSPACE ${WORKSPACE:=/builds/worker/workspace} 24 : MOZ_OBJDIR ${MOZ_OBJDIR:=$WORKSPACE/obj-build} 25 26 set -v 27 28 fail() { 29 echo # make sure error message is on a new line 30 echo "[build-linux.sh:error]" "${@}" 31 exit 1 32 } 33 34 export MOZ_CRASHREPORTER_NO_REPORT=1 35 export TINDERBOX_OUTPUT=1 36 37 # use "simple" package names so that they can be hard-coded in the task's 38 # extras.locations 39 export MOZ_SIMPLE_PACKAGE_NAME=target 40 41 # test required parameters are supplied 42 if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi 43 if [[ -z "${MOZHARNESS_CONFIG}" && -z "${EXTRA_MOZHARNESS_CONFIG}" ]]; then fail "MOZHARNESS_CONFIG or EXTRA_MOZHARNESS_CONFIG is not set"; fi 44 45 # set up mozharness configuration, via command line, env, etc. 46 47 debug_flag="" 48 if [ 0$DEBUG -ne 0 ]; then 49 debug_flag='--debug' 50 fi 51 52 # $TOOLTOOL_CACHE bypasses mozharness completely and is read by tooltool_wrapper.sh to set the 53 # cache. However, only some mozharness scripts use tooltool_wrapper.sh, so this may not be 54 # entirely effective. 55 export TOOLTOOL_CACHE 56 57 export MOZ_OBJDIR 58 59 config_path_cmds="" 60 for path in ${MOZHARNESS_CONFIG_PATHS}; do 61 config_path_cmds="${config_path_cmds} --extra-config-path ${GECKO_PATH}/${path}" 62 done 63 64 # support multiple, space delimited, config files 65 config_cmds="" 66 for cfg in $MOZHARNESS_CONFIG; do 67 config_cmds="${config_cmds} --config ${cfg}" 68 done 69 70 # if MOZHARNESS_ACTIONS is given, only run those actions (completely overriding default_actions 71 # in the mozharness configuration) 72 if [ -n "$MOZHARNESS_ACTIONS" ]; then 73 actions="" 74 for action in $MOZHARNESS_ACTIONS; do 75 actions="$actions --$action" 76 done 77 fi 78 79 # if MOZHARNESS_OPTIONS is given, append them to mozharness command line run 80 if [ -n "$MOZHARNESS_OPTIONS" ]; then 81 options="" 82 for option in $MOZHARNESS_OPTIONS; do 83 options="$options --$option" 84 done 85 fi 86 87 cd /builds/worker 88 89 $GECKO_PATH/mach python $GECKO_PATH/testing/${MOZHARNESS_SCRIPT} \ 90 ${config_path_cmds} \ 91 ${config_cmds} \ 92 $actions \ 93 $options \ 94 --log-level=debug \ 95 --work-dir=$WORKSPACE \