mirror of https://github.com/sipwise/libtcap.git
Change-Id: Iea8a04cc935070168ec0f63a083258ee5a2e0d07changes/36/6436/1
parent
bb75433890
commit
d7c7de0851
@ -0,0 +1,31 @@
|
||||
# DOCKER_NAME=libtcap-jessie
|
||||
FROM docker.mgm.sipwise.com/sipwise-jessie:latest
|
||||
|
||||
# Important! Update this no-op ENV variable when this Dockerfile
|
||||
# is updated with the current date. It will force refresh of all
|
||||
# of the base images and things like `apt-get update` won't be using
|
||||
# old cached versions when the Dockerfile is built.
|
||||
ENV REFRESHED_AT 2016-05-31
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install --assume-yes git abi-compliance-checker
|
||||
|
||||
RUN echo './t/testrunner' >>/root/.bash_history
|
||||
|
||||
WORKDIR /code/
|
||||
|
||||
################################################################################
|
||||
# Instructions for usage
|
||||
# ----------------------
|
||||
# When you want to build the base image from scratch (jump to the next section if you don't want to build yourself!):
|
||||
# % docker build --tag="libtcap-jessie" .
|
||||
# % docker run --rm -i -t -v $(pwd)/..:/code:rw libtcap-jessie:latest bash
|
||||
#
|
||||
# Use the existing docker image:
|
||||
# % docker pull docker.mgm.sipwise.com/libtcap-jessie
|
||||
# % docker run --rm -i -t -v $(pwd)/..:/code:rw docker.mgm.sipwise.com/libtcap-jessie:latest bash
|
||||
#
|
||||
# Inside docker (the command is in history, just press UP button):
|
||||
# ./t/testrunner
|
||||
#
|
||||
################################################################################
|
@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
RESULTS=${RESULTS:-.}
|
||||
CHECK_DIR="${RESULTS}"/check
|
||||
source_path="$(pwd)"
|
||||
|
||||
if [ $# -lt 2 ] ; then
|
||||
echo "Wrong number of parameters" >&2
|
||||
echo "Usage: $0 <old_version> <new_version> <git_source>" >&2
|
||||
echo "<git_source> defaults to \$(pwd)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
old_version="${1}"
|
||||
new_version="${2}"
|
||||
|
||||
# drop "/" from branch names
|
||||
old_version_norm="${old_version////_}"
|
||||
new_version_norm="${new_version////_}"
|
||||
|
||||
rm -rf "${CHECK_DIR}"
|
||||
|
||||
mkdir -p "${CHECK_DIR}/source.$old_version_norm" \
|
||||
"${CHECK_DIR}/source.$new_version_norm"
|
||||
cp -r "${source_path}"/.git "${CHECK_DIR}/source.$old_version_norm"
|
||||
cp -r "${source_path}"/.git "${CHECK_DIR}/source.$new_version_norm"
|
||||
|
||||
# old version
|
||||
(
|
||||
cd "${CHECK_DIR}/source.$old_version_norm"
|
||||
git checkout "$old_version" --force
|
||||
# work around for missing "lib" directory in git
|
||||
mkdir -p lib
|
||||
make
|
||||
)
|
||||
# new version
|
||||
(
|
||||
cd "${CHECK_DIR}/source.$new_version_norm"
|
||||
git checkout -- .
|
||||
# work around for missing "lib" directory in git
|
||||
mkdir -p lib
|
||||
make
|
||||
)
|
||||
# generate config files
|
||||
cat > "${CHECK_DIR}/${old_version_norm}.xml" << EOF
|
||||
<version>
|
||||
check/source.${old_version_norm}
|
||||
</version>
|
||||
|
||||
<headers>
|
||||
check/source.${old_version_norm}/include
|
||||
</headers>
|
||||
|
||||
<libs>
|
||||
check/source.${old_version_norm}/lib/
|
||||
</libs>
|
||||
|
||||
<include_paths>
|
||||
check/source.${old_version_norm}/asn1-compiled
|
||||
</include_paths>
|
||||
EOF
|
||||
|
||||
cat > "${CHECK_DIR}/${new_version_norm}.xml" << EOF
|
||||
<version>
|
||||
check/source.${new_version_norm}
|
||||
</version>
|
||||
|
||||
<headers>
|
||||
check/source.${new_version_norm}/include
|
||||
</headers>
|
||||
|
||||
<libs>
|
||||
check/source.${new_version_norm}/lib/
|
||||
</libs>
|
||||
|
||||
<include_paths>
|
||||
check/source.${new_version_norm}/asn1-compiled
|
||||
</include_paths>
|
||||
EOF
|
||||
|
||||
cd "${RESULTS}"
|
||||
|
||||
# NOTE: with >=1.99.13 we'll get -skip-internal-symbols=... + -skip-internal-types=...
|
||||
abi-compliance-checker -l tcap \
|
||||
-d1 "check/${old_version_norm}.xml" -d2 "check/${new_version_norm}.xml"
|
@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# This script is used for running the tests with proper arguments
|
||||
# from within Jenkins
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -x
|
||||
|
||||
if [ -d /results ] ; then
|
||||
# Running from Jenkins (RW)
|
||||
RESULTS="/results"
|
||||
|
||||
cd "/code"
|
||||
else
|
||||
# Running locally in Docker
|
||||
RESULTS="./results"
|
||||
mkdir -p "${RESULTS}"
|
||||
fi
|
||||
|
||||
source_path="$(pwd)"
|
||||
|
||||
# jenkins environment vars
|
||||
if [ -z "${release:-}" ] ; then
|
||||
release="none"
|
||||
fi
|
||||
if [ -z "${tag:-}" ] ; then
|
||||
tag="none"
|
||||
fi
|
||||
if [ -z "${old_version:-}" ] ; then
|
||||
old_version="latest_tag"
|
||||
fi
|
||||
if [ -z "${new_version:-}" ] ; then
|
||||
new_version="none"
|
||||
fi
|
||||
if [ -z "${branch:-}" ] ; then
|
||||
branch="none"
|
||||
fi
|
||||
|
||||
if [[ "${release}" =~ ^release-mr ]] ; then
|
||||
echo "release detected"
|
||||
short_release=${release%%-update}
|
||||
short_release=${short_release##release-}
|
||||
|
||||
if [[ "${short_release}" =~ ^mr([0-9]+)\.([0-9]+)\.([0-9]+)$ ]] ; then
|
||||
common_release="mr${BASH_REMATCH[1]}.${BASH_REMATCH[2]}\."
|
||||
new_version="${tag}"
|
||||
else
|
||||
echo "yellow zone release detected"
|
||||
common_release="${short_release}\."
|
||||
fi
|
||||
old_version=$(cd "${source_path}" ; git tag | grep -v jenkins-libtcap | \
|
||||
grep "${common_release}" | sort -r | head -1)
|
||||
|
||||
if [ -z "${old_version}" ] ; then
|
||||
echo "No tag found for ${common_release}. Using latest_tag"
|
||||
old_version="latest_tag"
|
||||
fi
|
||||
else
|
||||
if [ "${old_version}" = "latest_tag" ] ; then
|
||||
if [[ "${branch}" =~ ^mr[0-9]+\.[0-9]+$ ]] ; then
|
||||
old_version=$(cd "${source_path}" ; git tag | grep -v jenkins-libtcap | \
|
||||
grep "${branch}\." | sort -r | head -1)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$new_version" = "none" ] ; then
|
||||
echo "New version is unset, defaulting to master"
|
||||
new_version=master
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${old_version}" = "latest_tag" ] ; then
|
||||
old_version=$(cd "${source_path}" ; git tag | grep -v jenkins-libtcap |\
|
||||
sort -r | head -1)
|
||||
fi
|
||||
|
||||
RESULTS=${RESULTS} ./t/abi-check.sh "$old_version" "$new_version"
|
Loading…
Reference in new issue