diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-02-10 01:14:48 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-02-10 01:14:48 +0100 |
commit | 6e8e544cb8559aa5d8db72176c957e2513e3898a (patch) | |
tree | 995ad3176ebdbaa4b75c4dc1c938652f1a283ab3 | |
parent | 68aa9e1b26b0af916423def6892de7fdb8a03048 (diff) | |
download | blogc-6e8e544cb8559aa5d8db72176c957e2513e3898a.tar.gz blogc-6e8e544cb8559aa5d8db72176c957e2513e3898a.tar.bz2 blogc-6e8e544cb8559aa5d8db72176c957e2513e3898a.zip |
travis: splitted scripts
-rw-r--r-- | .travis.yml | 12 | ||||
-rwxr-xr-x | build-aux/travis-build.sh | 48 | ||||
-rwxr-xr-x | travis/build.sh | 15 | ||||
-rwxr-xr-x | travis/deploy.sh (renamed from build-aux/travis-deploy.sh) | 12 | ||||
-rw-r--r-- | travis/targets/dist-srpm.sh | 19 | ||||
-rw-r--r-- | travis/targets/distcheck.sh | 19 | ||||
-rw-r--r-- | travis/targets/github-lambda.sh | 33 | ||||
-rw-r--r-- | travis/targets/make-embedded.sh | 15 | ||||
-rw-r--r-- | travis/targets/valgrind.sh | 15 |
9 files changed, 129 insertions, 59 deletions
diff --git a/.travis.yml b/.travis.yml index f34e0d3..e7059b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,17 +17,17 @@ env: - TARGET=valgrind - TARGET=distcheck - TARGET=dist-srpm - - TARGET=blogc-github-lambda - - TARGET=blogc-make-embedded + - TARGET=github-lambda + - TARGET=make-embedded matrix: exclude: - compiler: clang env: TARGET=dist-srpm - compiler: clang - env: TARGET=blogc-github-lambda + env: TARGET=github-lambda - compiler: clang - env: TARGET=blogc-make-embedded + env: TARGET=make-embedded install: gem install ronn @@ -36,5 +36,5 @@ before_script: - ./autogen.sh script: - - ./build-aux/travis-build.sh - - ./build-aux/travis-deploy.sh + - ./travis/build.sh + - ./travis/deploy.sh diff --git a/build-aux/travis-build.sh b/build-aux/travis-build.sh deleted file mode 100755 index 223d145..0000000 --- a/build-aux/travis-build.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -ex - -MAKE_CONFIGURE="--enable-make" -if [[ "x${TARGET}" = "xblogc-make-embedded" ]]; then - MAKE_CONFIGURE="--enable-make-embedded" - TARGET="check" -fi -if [[ "x${TARGET}" = "xblogc-github-lambda" ]]; then - MAKE_CONFIGURE="--enable-make-embedded" -fi - - -rm -rf build -mkdir -p build - -pushd build > /dev/null -../configure \ - CFLAGS="-Wall -g -O0" \ - --enable-ronn \ - --disable-silent-rules \ - --enable-tests \ - --enable-valgrind \ - --enable-git-receiver \ - --enable-runserver \ - ${MAKE_CONFIGURE} -popd > /dev/null - -if [[ "x${TARGET}" = "xblogc-github-lambda" ]]; then - make -C build LDFLAGS="-all-static" blogc - - rm -rf root - mkdir -p root - - PV="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" - - install -m 755 build/blogc root/blogc - install -m 644 src/blogc-github-lambda/lambda_function.py root/lambda_function.py - install -m 644 LICENSE root/LICENSE - strip root/blogc - - pushd root/ > /dev/null - zip --symlinks -rq "../blogc-github-lambda-${PV}.zip" * - popd > /dev/null -else - make -C build "${TARGET}" -fi diff --git a/travis/build.sh b/travis/build.sh new file mode 100755 index 0000000..9e12ada --- /dev/null +++ b/travis/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -ex + +if [[ -n "${TARGET}" ]] && [[ -e "travis/targets/${TARGET}.sh" ]]; then + source "travis/targets/${TARGET}.sh" +else + echo "Target not defined or invalid!" + exit 1 +fi + +rm -rf build +mkdir -p build + +build diff --git a/build-aux/travis-deploy.sh b/travis/deploy.sh index 7c295c4..15b53a7 100755 --- a/build-aux/travis-deploy.sh +++ b/travis/deploy.sh @@ -22,14 +22,16 @@ if [[ ! -d build ]]; then exit 1 fi -if [[ "x${TARGET}" = "xdist-srpm" ]]; then - FILES=( build/*.src.rpm ) -elif [[ "x${TARGET}" = "xblogc-github-lambda" ]]; then - FILES=( *.zip ) +FILES= +if [[ -n "${TARGET}" ]] && [[ -e "travis/targets/${TARGET}.sh" ]]; then + source "travis/targets/${TARGET}.sh" else - FILES=( build/*.{*.tar.{gz,bz2,xz},zip} ) + echo "Target not defined or invalid!" + exit 1 fi +deploy + TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" diff --git a/travis/targets/dist-srpm.sh b/travis/targets/dist-srpm.sh new file mode 100644 index 0000000..87858c6 --- /dev/null +++ b/travis/targets/dist-srpm.sh @@ -0,0 +1,19 @@ +build() { + pushd build > /dev/null + ../configure \ + CFLAGS="-Wall -g -O0" \ + --disable-silent-rules \ + --enable-ronn \ + --enable-tests \ + --enable-valgrind \ + --enable-git-receiver \ + --enable-make \ + --enable-runserver + popd > /dev/null + + make -C build dist-srpm +} + +deploy() { + FILES=( build/*.src.rpm ) +} diff --git a/travis/targets/distcheck.sh b/travis/targets/distcheck.sh new file mode 100644 index 0000000..06a0ba3 --- /dev/null +++ b/travis/targets/distcheck.sh @@ -0,0 +1,19 @@ +build() { + pushd build > /dev/null + ../configure \ + CFLAGS="-Wall -g -O0" \ + --disable-silent-rules \ + --enable-ronn \ + --enable-tests \ + --enable-valgrind \ + --enable-git-receiver \ + --enable-make \ + --enable-runserver + popd > /dev/null + + make -C build distcheck +} + +deploy() { + FILES=( build/*.{*.tar.{gz,bz2,xz},zip} ) +} diff --git a/travis/targets/github-lambda.sh b/travis/targets/github-lambda.sh new file mode 100644 index 0000000..a92d586 --- /dev/null +++ b/travis/targets/github-lambda.sh @@ -0,0 +1,33 @@ +build() { + pushd build > /dev/null + ../configure \ + CFLAGS="-Wall -g -O0" \ + --enable-ronn \ + --disable-silent-rules \ + --enable-tests \ + --enable-valgrind \ + --enable-git-receiver \ + --enable-make-embedded \ + --enable-runserver + popd > /dev/null + + make -C build LDFLAGS="-all-static" blogc + + rm -rf build/root + mkdir -p build/root + + PV="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" + + install -m 755 build/blogc build/root/blogc + install -m 644 src/blogc-github-lambda/lambda_function.py build/root/lambda_function.py + install -m 644 LICENSE build/root/LICENSE + strip build/root/blogc + + pushd build/root/ > /dev/null + zip -rq "../blogc-github-lambda-${PV}.zip" * + popd > /dev/null +} + +deploy() { + FILES=( build/*.zip ) +} diff --git a/travis/targets/make-embedded.sh b/travis/targets/make-embedded.sh new file mode 100644 index 0000000..b2d3f80 --- /dev/null +++ b/travis/targets/make-embedded.sh @@ -0,0 +1,15 @@ +build() { + pushd build > /dev/null + ../configure \ + CFLAGS="-Wall -g -O0" \ + --enable-ronn \ + --disable-silent-rules \ + --enable-tests \ + --enable-valgrind \ + --enable-git-receiver \ + --enable-make-embedded \ + --enable-runserver + popd > /dev/null + + make -C build check +} diff --git a/travis/targets/valgrind.sh b/travis/targets/valgrind.sh new file mode 100644 index 0000000..7870ec1 --- /dev/null +++ b/travis/targets/valgrind.sh @@ -0,0 +1,15 @@ +build() { + pushd build > /dev/null + ../configure \ + CFLAGS="-Wall -g -O0" \ + --disable-silent-rules \ + --enable-ronn \ + --enable-tests \ + --enable-valgrind \ + --enable-git-receiver \ + --enable-make \ + --enable-runserver + popd > /dev/null + + make -C build valgrind +} |