Index: bin/autobuild ================================================================== --- bin/autobuild +++ bin/autobuild @@ -38,10 +38,11 @@ ## 2.d. Sane umask umask 022 # 3. Update the Fossil repository +fossil config -R "${repository}" pull all >/dev/null 2>/dev/null || : fossil sync -R "${repository}" >/dev/null 2>/dev/null || : # 4. Get a list of branches branches=( $(fossil branch -R "${repository}" list) ) @@ -48,12 +49,14 @@ # 5. Get Fossil CI configuration from the trunk branch ## 5.a. Set default config excludedBranches=() includedBranches=('') buildCommands=('./autogen.sh || :' ./configure make) +initCommands=() +postCommands=() +branchPostCommands=() testCommands=() -releaseCommands=() builderID='' projectName="$(fossil info -R "${repository}" | awk '/^project-name:/{ sub(/^project-name: */, ""); gsub(/ /, ""); print; }')" tagSuffix='' tagPrefix='' @@ -70,10 +73,11 @@ if [ -f ~/.fossil-ci/"${projectName}"/config ]; then . ~/.fossil-ci/"${projectName}"/config fi ## 5.d. Post-process config +### 5.d.i. Add builderID as a tag suffix if none was given if [ -z "${tagSuffix}" ]; then if [ -n "${builderID}" ]; then tagSuffix="-${builderID}" fi fi @@ -180,9 +184,20 @@ ### 7.i. Upload the logs somewhere if requested #### XXX:TODO ### 7.j. Upload build artifacts somewhere if requested #### XXX:TODO + + ### 7.k. Get a list of tags + tags=( $(fossil tag -R "${repository}" list "${branch}") ) + + # 8. Perform post-build work (e.g., for release engineering) + ( + cd "${branchdir}" || exit 1 + for cmd in "${branchPostCommands[@]}"; do + ( eval "set -x; ${cmd}" ) || exit 1 + done + ) > "${builddir}/post.log" 2>&1 || : done -# 8. Clean up any branches that no longer exist +# 9. Clean up any branches that no longer exist ## XXX:TODO