<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10744">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Various updates to buildAsterisk.sh<br><br>* Added ---no-configure, --no-menuselect, --no-make and --no-alembic<br> options that prevent those actions from being performed. Useful<br> for testing and re-running portions of the build after fixing<br> earlier failures.<br><br>* Added "set -e" to abort the script on command failure.<br> Not sure why this wasn't there in the first place.<br><br>* Fixed a few echos that were redirecting to stderr when they shouldn't<br> have been.<br><br>* Catch more alembic failures by actually trying to generate the SQL.<br><br>Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb<br>---<br>M tests/CI/buildAsterisk.sh<br>1 file changed, 92 insertions(+), 70 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/10744/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/buildAsterisk.sh b/tests/CI/buildAsterisk.sh</span><br><span>index b974629..8654624 100755</span><br><span>--- a/tests/CI/buildAsterisk.sh</span><br><span>+++ b/tests/CI/buildAsterisk.sh</span><br><span>@@ -4,8 +4,14 @@</span><br><span> COVERAGE=0</span><br><span> REF_DEBUG=0</span><br><span> DISABLE_BINARY_MODULES=0</span><br><span style="color: hsl(120, 100%, 40%);">+NO_CONFIGURE=0</span><br><span style="color: hsl(120, 100%, 40%);">+NO_MENUSELECT=0</span><br><span style="color: hsl(120, 100%, 40%);">+NO_MAKE=0</span><br><span style="color: hsl(120, 100%, 40%);">+NO_ALEMBIC=0</span><br><span> source $CIDIR/ci.functions</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+set -e</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if [ -z $BRANCH_NAME ]; then</span><br><span> BRANCH_NAME=$(git config -f .gitreview --get gerrit.defaultbranch)</span><br><span> fi</span><br><span>@@ -32,6 +38,14 @@</span><br><span> done</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+run_alembic() {</span><br><span style="color: hsl(120, 100%, 40%);">+ pushd contrib/ast-db-manage >/dev/null</span><br><span style="color: hsl(120, 100%, 40%);">+ runner alembic $@</span><br><span style="color: hsl(120, 100%, 40%);">+ RC=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ popd > /dev/null</span><br><span style="color: hsl(120, 100%, 40%);">+ return $RC</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> [ x"$OUTPUT_DIR" != x ] && mkdir -p "$OUTPUT_DIR" 2> /dev/null</span><br><span> </span><br><span> if [ -z $TESTED_ONLY ]; then</span><br><span>@@ -89,50 +103,57 @@</span><br><span> </span><br><span> export WGET_EXTRA_ARGS="--quiet"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-runner ./configure ${common_config_args} > ${OUTPUT_DIR:+${OUTPUT_DIR}/}configure.txt</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-runner ${MAKE} menuselect.makeopts</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-runner menuselect/menuselect `gen_mods enable DONT_OPTIMIZE BETTER_BACKTRACES MALLOC_DEBUG DO_CRASH TEST_FRAMEWORK` menuselect.makeopts</span><br><span style="color: hsl(0, 100%, 40%);">-runner menuselect/menuselect `gen_mods disable COMPILE_DOUBLE BUILD_NATIVE` menuselect.makeopts</span><br><span style="color: hsl(0, 100%, 40%);">-if [ $REF_DEBUG -eq 1 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- runner menuselect/menuselect --enable REF_DEBUG menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $NO_CONFIGURE -eq 0 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ runner ./configure ${common_config_args} > ${OUTPUT_DIR:+${OUTPUT_DIR}/}configure.txt</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-cat_enables="MENUSELECT_BRIDGES MENUSELECT_CEL MENUSELECT_CDR"</span><br><span style="color: hsl(0, 100%, 40%);">-cat_enables+=" MENUSELECT_CHANNELS MENUSELECT_CODECS MENUSELECT_FORMATS MENUSELECT_FUNCS"</span><br><span style="color: hsl(0, 100%, 40%);">-cat_enables+=" MENUSELECT_PBX MENUSELECT_RES MENUSELECT_UTILS MENUSELECT_TESTS"</span><br><span style="color: hsl(0, 100%, 40%);">-runner menuselect/menuselect `gen_cats enable $cat_enables` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $NO_MENUSELECT -eq 0 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ runner ${MAKE} menuselect.makeopts</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-mod_disables="res_digium_phone chan_vpb"</span><br><span style="color: hsl(0, 100%, 40%);">-if [ $TESTED_ONLY -eq 1 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- # These modules are not tested at all. They are loaded but nothing is ever done</span><br><span style="color: hsl(0, 100%, 40%);">- # with them, no testsuite tests depend on them.</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" app_adsiprog app_alarmreceiver app_celgenuserevent app_db app_dictate"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" app_dumpchan app_externalivr app_festival app_getcpeid app_ices app_image"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" app_jack app_milliwatt app_minivm app_morsecode app_mp3 app_nbscat app_privacy"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" app_readexten app_sms app_speech_utils app_test app_url app_waitforring"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" app_waitforsilence app_waituntil app_zapateller"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" cdr_adaptive_odbc cdr_custom cdr_manager cdr_odbc cdr_pgsql cdr_radius"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" cdr_syslog cdr_tds"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" cel_odbc cel_pgsql cel_radius cel_sqlite3_custom cel_tds"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" chan_alsa chan_console chan_mgcp chan_motif chan_oss chan_rtp chan_skinny chan_unistim"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" func_frame_trace func_pitchshift func_speex func_volume func_dialgroup"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" func_periodic_hook func_sprintf func_enum func_extstate func_sysinfo func_iconv"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" func_callcompletion func_version func_rand func_sha1 func_module func_md5"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" pbx_dundi pbx_loopback"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" res_ael_share res_calendar res_config_ldap res_config_pgsql res_corosync"</span><br><span style="color: hsl(0, 100%, 40%);">- mod_disables+=" res_http_post res_pktccops res_rtp_multicast res_snmp res_xmpp"</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect `gen_mods enable DONT_OPTIMIZE BETTER_BACKTRACES MALLOC_DEBUG DO_CRASH TEST_FRAMEWORK` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect `gen_mods disable COMPILE_DOUBLE BUILD_NATIVE` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ $REF_DEBUG -eq 1 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect --enable REF_DEBUG menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<<<<<<< HEAD</span><br><span style="color: hsl(120, 100%, 40%);">+ cat_enables="MENUSELECT_BRIDGES MENUSELECT_CEL MENUSELECT_CDR"</span><br><span style="color: hsl(120, 100%, 40%);">+ cat_enables+=" MENUSELECT_CHANNELS MENUSELECT_CODECS MENUSELECT_FORMATS MENUSELECT_FUNCS"</span><br><span style="color: hsl(120, 100%, 40%);">+ cat_enables+=" MENUSELECT_PBX MENUSELECT_RES MENUSELECT_UTILS MENUSELECT_TESTS"</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect `gen_cats enable $cat_enables` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables="res_digium_phone chan_vpb"</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ $TESTED_ONLY -eq 1 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ # These modules are not tested at all. They are loaded but nothing is ever done</span><br><span style="color: hsl(120, 100%, 40%);">+ # with them, no testsuite tests depend on them.</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" app_adsiprog app_alarmreceiver app_celgenuserevent app_db app_dictate"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" app_dumpchan app_externalivr app_festival app_getcpeid app_ices app_image"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" app_jack app_milliwatt app_minivm app_morsecode app_mp3 app_nbscat app_privacy"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" app_readexten app_sms app_speech_utils app_test app_url app_waitforring"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" app_waitforsilence app_waituntil app_zapateller"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" cdr_adaptive_odbc cdr_custom cdr_manager cdr_odbc cdr_pgsql cdr_radius"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" cdr_syslog cdr_tds"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" cel_odbc cel_pgsql cel_radius cel_sqlite3_custom cel_tds"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" chan_alsa chan_console chan_mgcp chan_motif chan_oss chan_rtp chan_skinny chan_unistim"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" func_frame_trace func_pitchshift func_speex func_volume func_dialgroup"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" func_periodic_hook func_sprintf func_enum func_extstate func_sysinfo func_iconv"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" func_callcompletion func_version func_rand func_sha1 func_module func_md5"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" pbx_dundi pbx_loopback"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" res_ael_share res_calendar res_config_ldap res_config_pgsql res_corosync"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_disables+=" res_http_post res_pktccops res_rtp_multicast res_snmp res_xmpp"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect `gen_mods disable $mod_disables` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_enables="app_voicemail app_directory FILE_STORAGE"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_enables+=" res_mwi_external res_ari_mailboxes res_mwi_external_ami res_stasis_mailbox"</span><br><span style="color: hsl(120, 100%, 40%);">+ mod_enables+=" CORE-SOUNDS-EN-GSM MOH-OPSOUND-GSM EXTRA-SOUNDS-EN-GSM"</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect `gen_mods enable $mod_enables` menuselect.makeopts</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-runner menuselect/menuselect `gen_mods disable $mod_disables` menuselect.makeopts</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-mod_enables="app_voicemail app_directory FILE_STORAGE"</span><br><span style="color: hsl(0, 100%, 40%);">-mod_enables+=" res_mwi_external res_ari_mailboxes res_mwi_external_ami res_stasis_mailbox"</span><br><span style="color: hsl(0, 100%, 40%);">-mod_enables+=" CORE-SOUNDS-EN-GSM MOH-OPSOUND-GSM EXTRA-SOUNDS-EN-GSM"</span><br><span style="color: hsl(0, 100%, 40%);">-runner menuselect/menuselect `gen_mods enable $mod_enables` menuselect.makeopts</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-runner ${MAKE} -j8 || runner ${MAKE} -j1 NOISY_BUILD=yes</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $NO_MAKE -eq 0 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ runner ${MAKE} -j8 || runner ${MAKE} -j1 NOISY_BUILD=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> </span><br><span> runner rm -f ${LCOV_DIR}/*.info</span><br><span> if [ $COVERAGE -eq 1 ] ; then</span><br><span>@@ -149,43 +170,44 @@</span><br><span> --output-file ${LCOV_DIR}/initial.info</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-ALEMBIC=$(which alembic 2>/dev/null || : )</span><br><span style="color: hsl(0, 100%, 40%);">-if [ x"$ALEMBIC" = x ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo "Alembic not installed"</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $NO_ALEMBIC -eq 0 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ ALEMBIC=$(which alembic 2>/dev/null || : )</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ x"$ALEMBIC" = x ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo "Alembic not installed"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-cd contrib/ast-db-manage</span><br><span style="color: hsl(0, 100%, 40%);">-find -name *.pyc -delete</span><br><span style="color: hsl(0, 100%, 40%);">-out=$(alembic -c config.ini.sample branches)</span><br><span style="color: hsl(0, 100%, 40%);">-if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic branches were found for config"</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo $out</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic for 'config' OK"</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(120, 100%, 40%);">+ find contrib/ast-db-manage -name *.pyc -delete</span><br><span style="color: hsl(120, 100%, 40%);">+ out=$(run_alembic -c config.ini.sample branches)</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo "Alembic branches were found for config"</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo $out</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ run_alembic -c config.ini.sample upgrade head --sql > "${OUTPUT_DIR:+${OUTPUT_DIR}/}alembic-config.sql" || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Alembic for 'config' OK"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-out=$(alembic -c cdr.ini.sample branches)</span><br><span style="color: hsl(0, 100%, 40%);">-if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic branches were found for cdr"</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo $out</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic for 'cdr' OK"</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(120, 100%, 40%);">+ out=$(run_alembic -c cdr.ini.sample branches)</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo "Alembic branches were found for cdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo $out</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ run_alembic -c cdr.ini.sample upgrade head --sql > "${OUTPUT_DIR:+${OUTPUT_DIR}/}alembic-cdr.sql" || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Alembic for 'cdr' OK"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-out=$(alembic -c voicemail.ini.sample branches)</span><br><span style="color: hsl(0, 100%, 40%);">-if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic branches were found for voicemail"</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo $out</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- >&2 echo "Alembic for 'voicemail' OK"</span><br><span style="color: hsl(120, 100%, 40%);">+ out=$(run_alembic -c voicemail.ini.sample branches)</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "x$out" != "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo "Alembic branches were found for voicemail"</span><br><span style="color: hsl(120, 100%, 40%);">+ >&2 echo $out</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ run_alembic -c voicemail.ini.sample upgrade head --sql > "${OUTPUT_DIR:+${OUTPUT_DIR}/}alembic-voicemail.sql" || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Alembic for 'voicemail' OK"</span><br><span> fi</span><br><span> </span><br><span> if [ -f "doc/core-en_US.xml" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- ${MAKE} validate-docs || ${MAKE} NOISY_BUILD=yes validate-docs</span><br><span style="color: hsl(120, 100%, 40%);">+ runner ${MAKE} validate-docs || ${MAKE} NOISY_BUILD=yes validate-docs</span><br><span> fi</span><br><span> </span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10744">change 10744</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10744"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb </div>
<div style="display:none"> Gerrit-Change-Number: 10744 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>