tb/config-sample/config | 51 +++++++++ tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_gerrit | 1 tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_tb | 1 tb/config-sample/profiles/tb99/branches/master/config_gerrit | 3 tb/config-sample/profiles/tb99/branches/master/config_tb | 4 tb/config-sample/profiles/tb99/config | 11 ++ tb/tb | 18 ++- tb/tb_internals.sh | 55 ++++++++-- 8 files changed, 131 insertions(+), 13 deletions(-)
New commits: commit d4d06af9207ad6c323d72ef20892597fb168d14f Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 20:09:51 2013 -0600 tb: add config template diff --git a/tb/config-sample/config b/tb/config-sample/config new file mode 100644 index 0000000..0bdd69d --- /dev/null +++ b/tb/config-sample/config @@ -0,0 +1,51 @@ + +# name of your tinderbox +# see see http://wiki/documentfoundation.org/Development/Tinderbox +# for naming convention +# Note: @99 below is the tinderbox id. in oder to do gerrit +# build you _must_ obtain a BuilbBot user assocaited with that id +# see your friendly gerrit admin. +TB_NAME="Linux_x86_64@99-Template-Description" + +# this is the time the tb will go to sleep in case there is nothing to build (in seconds) +TB_POOL_DELAY=120 + +# this is the time tb will go to sleep after each build attempt (in seconds) +TB_POST_BUILD_DELAY=15 + +# location where tb will put the metadata used to follow the state of a 'branche' +# this contain work file that folow the last checkout point, +# the last success point etc... +# these are small files, with overall low activity, so there is no particular requirement +# but they need to persist, so do not put them in /tmp or any other +# place that won't survive a reboot +TB_METADATA_DIR=~/.tb/meta + +# default email mode when doing a tb build +# while debugggin your set-up you probably want =owner or =none here +TB_SEND_MAIL=all + +# default profile +# tb always run based on a given 'profile' +# this is specified onthe command line by -p <profile> +# this provide a default value in case the information +# is absenct from the command line +# on an establish tinderbox, it would be expected than +# running just 'tb' without argument would run the predefined setup +# a convinient name for the default profile is tb<id> where id is +# the id assigned to your box +TB_DEFAULT_PROFILE=tb99 + +# if you are doing tb build, we need a SMTP server +# to send email to the tinderbox server, to post +# the build result +# and we need a user/passwd. +# if your smtp does not need credentials +# then you can omit both user and passwrd +TB_SMTP_HOST=smtp.gamil.com +TB_SMTP_USER=john.doe +TB_SMTP_PASSWORD=password + +# if you are building on a recent Mac (with llvm-based compiler) and you want to +# use ccache, you need to put the export below, or it won't build. +# export CCACHE_CPP2=yes diff --git a/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_gerrit b/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_gerrit new file mode 100644 index 0000000..8c6b4f8 --- /dev/null +++ b/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_gerrit @@ -0,0 +1 @@ +--disable-dependency-tracking diff --git a/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_tb b/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_tb new file mode 100644 index 0000000..51c8615 --- /dev/null +++ b/tb/config-sample/profiles/tb99/branches/master/autogen.lastrun_tb @@ -0,0 +1 @@ +--disable-ccache diff --git a/tb/config-sample/profiles/tb99/branches/master/config_gerrit b/tb/config-sample/profiles/tb99/branches/master/config_gerrit new file mode 100644 index 0000000..ccda286 --- /dev/null +++ b/tb/config-sample/profiles/tb99/branches/master/config_gerrit @@ -0,0 +1,3 @@ + +# +TB_GIT_DIR=~/lo/core_gerrit diff --git a/tb/config-sample/profiles/tb99/branches/master/config_tb b/tb/config-sample/profiles/tb99/branches/master/config_tb new file mode 100644 index 0000000..306d2b8 --- /dev/null +++ b/tb/config-sample/profiles/tb99/branches/master/config_tb @@ -0,0 +1,4 @@ + +TB_TINDERBOX_BRANCH=MASTER +TB_GIT_DIR=~/lo/master_tb +TB_INCREMENTAL=1 diff --git a/tb/config-sample/profiles/tb99/config b/tb/config-sample/profiles/tb99/config new file mode 100644 index 0000000..57ecc8c --- /dev/null +++ b/tb/config-sample/profiles/tb99/config @@ -0,0 +1,11 @@ +# Profile Level configuration +# +# Gerrit host +# for gerrit related operation. +# It is easier to just define an alias +# in ~/.ssh +# Here we define d gerrit_tb99 as an alias +# for [email protected] on the right port +# with the right identity. +TB_GERRIT_HOST=gerrit_tb99 + commit 1e2a9d118a035762c32d5546a651a83f154e9663 Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 20:09:22 2013 -0600 tb: add a way to explicitly restrict a mode for a given branch diff --git a/tb/tb b/tb/tb index 97afd79..84e0d32 100755 --- a/tb/tb +++ b/tb/tb @@ -142,6 +142,8 @@ TB_BRANCH_LOCAL_REFSPEC=<ref> Name of the branche in the local repo Default to the name of the branch in the configuration This is a B-level only paramter This is a tb-mode only paramter. This is ingored in gerrit mode +TB_BRANCH_MODE=(gerrit|tb|both) Restrict the branch to gerrit build or tb build or both (default) + This is a B-level only parameter TB_BRANCH_REMOTE_REFSPEC=<ref> Name of the branch on the remote repo. Default to the name of the branch in the configuration This is a B-level only paramter diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh index 07cf6fd..2e5090e 100644 --- a/tb/tb_internals.sh +++ b/tb/tb_internals.sh @@ -208,6 +208,13 @@ check_branch_profile_gerrit() source_branch_level_config "${b?}" "gerrit" + # if we intented that branch to be tb only let's bail-out early + if [ "$TB_BRANCH_MODE" = "tb" ] ; then + exit -1; + fi + + check_branch_profile_common + # if CCACHE_DIR is set it has been set by the branch's profile # if TB_CCACHE_SIZE is set make sure the cache is as big as specified # note: no need to restore the old CCACHE value @@ -237,6 +244,13 @@ check_branch_profile_tb() source_branch_level_config "${b?}" "tb" + # if we intented that branch to be gerrit only let's bail-out early + if [ "$TB_BRANCH_MODE" = "gerrit" ] ; then + exit -1; + fi + + check_branch_profile_common + if [ -z "${TB_TINDERBOX_BRANCH}" ] ; then TB_TINDERBOX_BRANCH=$(determine_default_tinderbox_branch "${b?}") # FIXME: determine if we can derive that value commit 8f68409eecb64ae6eadf8ae796336e303849aba1 Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 20:08:42 2013 -0600 tb: source per branch phases.sh if exist diff --git a/tb/tb b/tb/tb index b8fe624..97afd79 100755 --- a/tb/tb +++ b/tb/tb @@ -159,7 +159,7 @@ TB_DEFAULT_PROFILE=<profile_name> Default profile name. This is a G level only parameter This provide a default value in case -p <prifle> is not present on the command line, but is required. -TB_GERRIT_HOST<host> Gerrit host to contact in gerrit mode. +TB_GERRIT_HOST=<host> Gerrit host to contact in gerrit mode. This parameter is mandatory to use a gerrit mode. This is G or P-level parameter only TB_GIT_DIR=<path> Location of the libreoffice core git repo to use for a build. @@ -205,7 +205,7 @@ TB_SMTP_PASSWORD=<password> Password associated with TB_SMTP_USER. This paramter is mandatory if TB_SMTP_USER is specified TB_SMTP_USER=<username> Username to login to the smtp server. If your smtp server does not require authotification, you can omit this. -TB_TINDERBOX_BRANCH=<name> Name associated witha branch on the tibderbox server. +TB_TINDERBOX_BRANCH=<name> Name associated with a branch on the tinderbox server. The tinderbox server need to have a branch name assocaited with any build repport. the server only recognize a preset list of such name and they do not necessarely match you local branch name. diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh index b857d45..07cf6fd 100644 --- a/tb/tb_internals.sh +++ b/tb/tb_internals.sh @@ -73,6 +73,9 @@ # /profiles/<profile_name>/branches/<branch_name>/config_gerrit # /profiles/<profile_name>/branches/<branch_name>/config_tb # /profiles/<profile_name>/branches/<branch_name>/false_negatives +# /profiles/<profile_name>/branches/<branch_name>/phase.sh +# /profiles/<profile_name>/branches/<branch_name>/phase_gerrit.sh +# /profiles/<profile_name>/branches/<branch_name>/phase_tb.sh # /profiles/<profile_name>/config # /profiles/<profile_name>/false_negatives # /profiles/<profile_name>/phases.sh @@ -1540,6 +1543,12 @@ source_branch_level_config() if [ -z "${TB_TINDERBOX_BRANCH}" ] ; then TB_TINDERBOX_BRANCH=$(determine_default_tinderbox_branch "${b?}") fi + if [ -f "${tb_PROFILE_DIR?}/branches/${b?}/phase.sh" ] ; then + source "${tb_PROFILE_DIR?}/branches/${B?}/phase.sh" + fi + if [ -f "${tb_PROFILE_DIR?}/branches/${b?}/phase_${t?}.sh" ] ; then + source "${tb_PROFILE_DIR?}/branches/${b?}/phase_${t?}.sh" + fi } # commit a829ae6e24f132e6e05d5a3230509bca8fc75180 Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 20:08:08 2013 -0600 TB_ID is not used anymore diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh index da8dd71..b857d45 100644 --- a/tb/tb_internals.sh +++ b/tb/tb_internals.sh @@ -1485,10 +1485,6 @@ setup_profile_defaults() mkdir -p "${TB_METADATA_DIR?}" || die "Creating ${TB_METADATA_DIR?}" fi - if [ -z "$TB_ID" ] ; then - die "Error: TB_ID is required to be configured" - fi - if [ -z "${TB_OWNER}" ] ; then die "Error: TB_OWNER is required to be configured" fi commit 1947d510b7f3d49ae5f961ca3af3695d935727b0 Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 19:23:33 2013 -0600 tb: added support for external trigger files diff --git a/tb/tb b/tb/tb index 3665faa..b8fe624 100755 --- a/tb/tb +++ b/tb/tb @@ -205,11 +205,21 @@ TB_SMTP_PASSWORD=<password> Password associated with TB_SMTP_USER. This paramter is mandatory if TB_SMTP_USER is specified TB_SMTP_USER=<username> Username to login to the smtp server. If your smtp server does not require authotification, you can omit this. -TB_TINDERBOX_BRANCH=<name> Name assocaited witha branch on the tibderbox server. +TB_TINDERBOX_BRANCH=<name> Name associated witha branch on the tibderbox server. The tinderbox server need to have a branch name assocaited with any build repport. the server only recognize a preset list of such name and they do not necessarely match you local branch name. This is a tb-mode only paramter. This is ignored in gerrit mode +TB_TRIGGER_FILE=<absolute_filename> This is the location of a 'trigger' file. + If specified the existance of that file will be + tested, and a build for the assocaited branch + will not be run unless the file exist + at the end of a successfull build, the trigger + file is removed by tb. + This allow to trigger some build at periodic time with a cron + For instance you could have a cron that touch a trigger file + weekly to trigger a full localized build. + This is a tb-mode only parameter. This is ignored in gerrit mode In general, when a command line argument influence on of the paramter listed above, it can only override a G-level specification. P-level take, for the most diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh index fc8c9c7..da8dd71 100644 --- a/tb/tb_internals.sh +++ b/tb/tb_internals.sh @@ -86,6 +86,7 @@ # tb_BRANCHES : # tb_BRANCH_AUTHOR : # tb_BUILD_COMMIT : +# tb_BUILD_TRIGGERED : "1" if the build was controlled by a trigger file # tb_BUILD_TYPE : # tb_CONFIG_DIR : # tb_GERRIT_BRANCHES : @@ -345,7 +346,7 @@ check_for_commit() r=0 else [ $V ] && echo "No New commit for tb-branch ${b?}" - r=1 + r=2 fi else log_msgs "Git error while checking for commit on ${TB_GIT_REPO?} for branch ${b?}" @@ -355,6 +356,15 @@ check_for_commit() fi fi [ $V ] && echo "pulling from the repo ${TB_GIT_REPO?} for branch ${b?} -> r=${r?}" + if [ "${r?}" = "0" ] ; then + if [ -n "${TB_TRIGGER_FILE}" -a -f "${TB_TRIGGER_FILE}" ] ; then + r=1 + [ $V ] && echo "Trigger file ${TB_TRIGGER_FILE} detected for branch ${b?} -> r=${r?}" + else + r=3 + [ $V ] && echo "Trigger file ${TB_TRIGGER_FILE} missing for branch ${b?} -> r=${r?}" + fi + fi exit ${r?} } @@ -714,12 +724,14 @@ prepare_git_repo_for_tb() local refspec= local remote_refspec= + # by default the local branch name is the 'branch' name for the profile refspec="${B?}" if [ -n "${TB_BRANCH_LOCAL_REFSPEC}" ] ; then refspec="${TB_BRANCH_LOCAL_REFSPEC?}" fi - remote_refspec="${B?}" + # by default the remote branch name is identical to the local one with origin/ in front + remote_refspec="origin/${refspec?}" if [ -n "${TB_BRANCH_REMOTE_REFSPEC}" ] ; then remote_refspec="${TB_BRANCH_REMOTE_REFSPEC?}" fi @@ -1226,11 +1238,11 @@ run_one_tb() do_build ${phase_list?} - if [ "$R" = "0" ] ; then + if [ "${R?}" = "0" ] ; then report_to_tinderbox "${tb_LAST_CHECKOUT_DATE}" "success" "yes" phase_list= log_msgs "Successful tb build for sha:$(cat "${TB_METADATA_DIR?}/${P}_${B?}_current-git-head.log")" - elif [ "$R" = "2" ] ; then + elif [ "${R?}" = "2" ] ; then log_msgs "False negative build, skip reporting" # false negative does not need a full clean build, let's just redo make and after retry_count=$((retry_count - 1)) @@ -1263,7 +1275,10 @@ run_one_tb() tb_LAST_CHECKOUT_DATE= rotate_logs popd > /dev/null - exit $R + if [ "${R?}" = "0" -a "${tb_BUILD_TRIGERRED?}" = "1" ] ; then + rm -f "${TB_TRIGGER_FILE?}" + fi + exit ${R?} ) R="$?" @@ -1386,10 +1401,11 @@ select_next_tb_task() else ( check_for_commit "$b" ) r="$?" - if [ ${r?} = 0 ] ; then + if [ ${r?} = 0 -o ${r?} = 1 ] ; then B="${b?}" tb_TB_BRANCHES=$(rotate_branches ${tb_TB_BRANCHES?}) tb_BUILD_TYPE="tb" + tb_BUILD_TRIGGERED="${r?}" break fi fi commit 461dc69198299f828fbf004ef73c73baf9f0223a Author: Norbert Thiebaud <[email protected]> Date: Mon Feb 25 19:23:13 2013 -0600 tb: no argument does not means --help anymore diff --git a/tb/tb b/tb/tb index 683c062..3665faa 100755 --- a/tb/tb +++ b/tb/tb @@ -233,7 +233,7 @@ EOF # case "$1" in - ""|help|--help) + help|--help) do_help "$@" exit $? ;; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
