Skip to content

Commit

Permalink
Merge branch 'stunnel-build-centos' into stunnel-5.56-msspi
Browse files Browse the repository at this point in the history
  • Loading branch information
fullincome committed Dec 17, 2019
2 parents b155437 + 3e3225c commit 6ce25bb
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 12 deletions.
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: enabled


dist: trusty
dist: xenial

branches:
only:
Expand All @@ -15,6 +15,9 @@ os:
compiler:
- gcc

services:
- docker

before install:
- sudo apt-get -qq update

Expand All @@ -25,6 +28,7 @@ env:
- ARCH='armv7' ARCH_DIST='linux-armhf' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
- ARCH='aarch64' ARCH_DIST='linux-arm64' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
- ARCH='amd64' ARCH_DIST='linux-amd64' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
- ARCH='amd64' ARCH_DIST='linux-amd64' BUILD_OS='centos' MSSPI='yes' CONFIGURE_OPTIONS='--with-threads=pthread --enable-msspi' CSPMODE='kc1'
- ARCH='amd64' CONFIGURE_OPTIONS='--with-threads=pthread'
- ARCH='amd64' CONFIGURE_OPTIONS='--with-threads=fork'
- ARCH='amd64' CONFIGURE_OPTIONS='--with-threads=ucontext'
Expand All @@ -42,15 +46,24 @@ addons:

install:
- if [ "$MSSPI" = "yes" ]; then
if [ "$BUILD_OS" = "centos" ]; then
wget https://[email protected]/support/stunnel/dist/csp50/${ARCH_DIST}.tgz &&
tar -xvf ${ARCH_DIST}.tgz;
else
wget https://[email protected]/support/stunnel/dist/csp50/${ARCH_DIST}_deb.tgz &&
tar -xvf ${ARCH_DIST}_deb.tgz;
fi
fi
before_script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install openssl autoconf-archive expect; fi; true

script:
- if [ "$ARCH" = "amd64" ]; then
bash -ex ./build_amd64.sh;
if [ "$BUILD_OS" = "centos" ]; then
bash -ex ./build_amd64_centos.sh;
else
bash -ex ./build_amd64.sh;
fi
elif [ "$ARCH" = "armv7" ]; then
bash -ex ./build_armv7.sh;
elif [ "$ARCH" = "aarch64" ]; then
Expand All @@ -64,7 +77,7 @@ deploy:
secure: NdsZjaeC2SU8Eo9uL4gwxhCSIfYbDNxBxLi6jJsm/u55Ouqg4Iz0DOYx0l+C0yemBhSX8lnShhjRPKRbEMLRNDvBi/f55CCHOMhk0KlQt/fvkBAsPf/bHLle0KEszj33rfklF1uc1/R2PJn8iwkuVTslVmLCKOB+1E5KWRgWgQvjsEWl26KBH32RM6sqi9jXeKPgdNLxZYon//fhktEKhBsp8mtc6qigvUEhzwuHAREwdyCy6A46dNNfzxg3I01TpooOSCZsdkRg9vvOT0H7agF3Dj6RocozuzIj2NoIka5e4rKPW/EYqd0yLM77f+pgs10I30SNbQSqJcYSIfHfJNiup+q2rnGgQQHOowg7Gqj//ffVEwyhCM4F90QlTCcjNECmaRfhIjQk5ICeakNlWojSBDcA0yEmnTu7BKTsZJOnjLFH8r6DrJmSta2ZNMdacgEaG+al3CoW57GOp6Nukbo1PGBYfZ3L/2QvguklKQGL/rAoVbR+PujjLyqfNwpt8ije9N7SvqporVeAOmpMGrNDQ94Ss3cXMhaJUJxfdg5lMsBm2qUytn5jeO4BTtBgyiyK/LyWMJg3NkUx1egVJbkoOwHSRT0VH7y8uYzvxYtYtTikBdmgfd25wZ+dQTANWbiFtkQs/DZqCnJ2nFTDNfTKyhtmSJZJXM6/Xerxt3c=
skip_cleanup: true
file:
- "src/${TRAVIS_TAG}_${ARCH_DIST}_deb.tar.gz"
- "src/${TRAVIS_TAG}_${ARCH_DIST}${BUILD_OS:+[_$BUILD_OS]}.tar.gz"
on:
tags: true
condition: $MSSPI = "yes"
7 changes: 2 additions & 5 deletions build_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

echo "export CPRO_SUFFIX=amd64" > envvars.sh
chmod a+x envvars.sh
. ./envvars.sh

if [ "$MSSPI" = "yes" ]; then
cd ./linux-amd64_deb
Expand All @@ -11,12 +12,8 @@ if [ "$MSSPI" = "yes" ]; then
cd ../../.. ;
fi

. ./envvars.sh

autoreconf -fvi && touch src/dhparam.c

./configure $CONFIGURE_OPTIONS || exit 1

make || exit 1

if [ -z "$MSSPI" ]; then
Expand All @@ -27,7 +24,7 @@ else
cd tests
sudo perl test-stunnel-msspi.pl || exit 1
cd ../src
tar -cvzf ${TRAVIS_TAG}_linux-amd64_deb.tar.gz stunnel-msspi
tar -cvzf ${TRAVIS_TAG}_linux-amd64.tar.gz stunnel-msspi
cd ..;
fi
fi
57 changes: 57 additions & 0 deletions build_amd64_centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#! /bin/bash

DOCKER_REPO="fullincomedock/centos:centos6"
DOCKER_VOLUME="/travis/stunnel"

# Msspi and not-msspi build and test on centos6 in docker.
if [ "$1" = "in_docker" ]; then

. /root/.bashrc
. ./envvars.sh

if [ "$MSSPI" = "yes" ]; then
cd ./linux-amd64
./install.sh $CSPMODE || exit 1
cd ../src/msspi/build_linux
make || exit 1
cd ../../.. ;
fi

autoreconf -fvi && touch src/dhparam.c
LIBS=-lm ./configure $CONFIGURE_OPTIONS || exit 1
make || exit 1

if [ -z "$MSSPI" ]; then
make test || ( for FILE in tests/logs/*.log; do echo "*** $FILE ***"; cat "$FILE"; done; false );
else
if [ "$MSSPI" = "yes" ]; then
mv ./src/stunnel ./src/stunnel-msspi
cd tests
sudo perl test-stunnel-msspi.pl || exit 1
cd ../src
tar -cvzf ${TRAVIS_TAG}_linux-amd64${BUILD_OS:+[_$BUILD_OS]}.tar.gz stunnel-msspi
cd ..;
fi
fi

else
echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
sudo service docker restart
sleep 5

echo "export BUILD_OS='${BUILD_OS}'" > envvars.sh
echo "export CONFIGURE_OPTIONS='${CONFIGURE_OPTIONS}'" >> envvars.sh
echo "export CSPMODE='${CSPMODE}'" >> envvars.sh
echo "export MSSPI='${MSSPI}'" >> envvars.sh
echo "export CPRO_SUFFIX='amd64'" >> envvars.sh
chmod a+x envvars.sh

sudo docker pull ${DOCKER_REPO}
sudo docker run \
--rm=true \
--user=root \
-v `pwd`:${DOCKER_VOLUME}:rw \
-w ${DOCKER_VOLUME} \
${DOCKER_REPO} \
/bin/bash -c "bash -xe ${DOCKER_VOLUME}/build_amd64_centos.sh in_docker" || exit 1
fi
4 changes: 2 additions & 2 deletions build_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ else
cd tests
perl test-stunnel-msspi.pl || exit 1
cd ../src
tar -cvzf ${TRAVIS_TAG}_linux-arm64_deb.tar.gz stunnel-msspi
tar -cvzf ${TRAVIS_TAG}_linux-arm64.tar.gz stunnel-msspi
cd ..;
fi
fi

exit 0
fi

mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-arm64_deb.tar.gz ./src/
mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-arm64.tar.gz ./src/
4 changes: 2 additions & 2 deletions build_armv7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ else
cd tests
perl test-stunnel-msspi.pl || exit 1
cd ../src
tar -cvzf ${TRAVIS_TAG}_linux-armhf_deb.tar.gz stunnel-msspi
tar -cvzf ${TRAVIS_TAG}_linux-armhf.tar.gz stunnel-msspi
cd ..;
fi
fi

exit 0
fi

mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-armhf_deb.tar.gz ./src/
mv ${CHROOT_DIR}${TRAVIS_BUILD_DIR}/src/${TRAVIS_TAG}_linux-armhf.tar.gz ./src/

0 comments on commit 6ce25bb

Please sign in to comment.