diff --git a/.travis.yml b/.travis.yml index 8aaae128..9b27ab61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: enabled -dist: trusty +dist: xenial branches: only: @@ -15,6 +15,9 @@ os: compiler: - gcc +services: + - docker + before install: - sudo apt-get -qq update @@ -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' @@ -42,15 +46,24 @@ addons: install: - if [ "$MSSPI" = "yes" ]; then + if [ "$BUILD_OS" = "centos" ]; then + wget https://$ACCOUNT@update.cryptopro.ru/support/stunnel/dist/csp50/${ARCH_DIST}.tgz && + tar -xvf ${ARCH_DIST}.tgz; + else wget https://$ACCOUNT@update.cryptopro.ru/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 @@ -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" diff --git a/build_amd64.sh b/build_amd64.sh index 18a132e3..a09a4118 100755 --- a/build_amd64.sh +++ b/build_amd64.sh @@ -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 @@ -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 @@ -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 diff --git a/build_amd64_centos.sh b/build_amd64_centos.sh new file mode 100755 index 00000000..0287c509 --- /dev/null +++ b/build_amd64_centos.sh @@ -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 diff --git a/build_arm64.sh b/build_arm64.sh index e3ed2dff..b33d13c4 100755 --- a/build_arm64.sh +++ b/build_arm64.sh @@ -142,7 +142,7 @@ 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 @@ -150,4 +150,4 @@ else 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/ diff --git a/build_armv7.sh b/build_armv7.sh index 0bff3dc0..4ca6d345 100755 --- a/build_armv7.sh +++ b/build_armv7.sh @@ -136,7 +136,7 @@ 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 @@ -144,4 +144,4 @@ else 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/