Files
asterisk/tests/CI/installAsterisk.sh
George Joseph b302ee6bd5 CI: Initial commit for moving CI into source repo
Create tests/CI directory and add files used by Jenkins to
build and test Asterisk.

With this commit, Jenkins will run the Asterisk Unit Tests using
the Jenkinsfile at tests/CI/unittests.jenkinsfile.  Bash scripts
to do the actual building and testing are also in the same directory.
Output is placed in tests/CI/output so that directory has been
added to .gitignore.

Change-Id: I9448065465e6de2b878634510ace8fd1ef378608
2018-07-11 05:19:48 -06:00

23 lines
762 B
Bash
Executable File

#!/bin/bash
MAKE=`which make`
if [ x"${@}" != x ] ; then
mkdir -p "${@}"
fi
destdir=${@:+DESTDIR=${@}}
${MAKE} ${destdir} install || ${MAKE} ${destdir} NOISY_BUILD=yes install || exit 1
${MAKE} ${destdir} samples
if [ -n "${@}" ] ; then
sed -i -r -e "s@\[directories\]\(!\)@[directories]@g" $@/etc/asterisk/asterisk.conf
sed -i -r -e "s@ /(var|etc|usr)/@ ${@}/\1/@g" $@/etc/asterisk/asterisk.conf
fi
set +e
chown -R jenkins:users ${@}/var/lib/asterisk
chown -R jenkins:users ${@}/var/spool/asterisk
chown -R jenkins:users ${@}/var/log/asterisk
chown -R jenkins:users ${@}/var/run/asterisk
chown -R jenkins:users ${@}/etc/asterisk
[ ! -d ${@}/tmp/asterisk-jenkins ] && mkdir ${@}/tmp/asterisk-jenkins
chown -R jenkins:users ${@}/tmp/asterisk-jenkins
ldconfig