aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/build.sh15
-rwxr-xr-xtravis/deploy.sh71
-rw-r--r--travis/targets/dist-srpm.sh19
-rw-r--r--travis/targets/distcheck.sh19
-rw-r--r--travis/targets/github-lambda.sh33
-rw-r--r--travis/targets/make-embedded.sh15
-rw-r--r--travis/targets/valgrind.sh15
7 files changed, 187 insertions, 0 deletions
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/travis/deploy.sh b/travis/deploy.sh
new file mode 100755
index 0000000..15b53a7
--- /dev/null
+++ b/travis/deploy.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+set -e
+
+if [[ "x${TRAVIS_PULL_REQUEST}" != "xfalse" ]]; then
+ echo "This is a pull request. skipping deploy ..."
+ exit 0
+fi
+
+if [[ "x${TRAVIS_BRANCH}" != "xmaster" ]] && [[ "x${TRAVIS_TAG}" != xv* ]]; then
+ echo "This isn't master branch nor a valid tag. skipping deploy ..."
+ exit 0
+fi
+
+if [[ "x${CC}" != "xgcc" ]] || [[ "x${TARGET}" = "xvalgrind" ]] || [[ "x${TARGET}" = "xblogc-make-embedded" ]]; then
+ echo "Invalid target for deploy. skipping ..."
+ exit 0
+fi
+
+if [[ ! -d build ]]; then
+ echo "Build directory not found."
+ exit 1
+fi
+
+FILES=
+if [[ -n "${TARGET}" ]] && [[ -e "travis/targets/${TARGET}.sh" ]]; then
+ source "travis/targets/${TARGET}.sh"
+else
+ 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)"
+
+do_curl() {
+ curl \
+ --silent \
+ --ftp-create-dirs \
+ --upload-file "${1}" \
+ --user "${FTP_USER}:${FTP_PASSWORD}" \
+ "ftp://${FTP_HOST}/public_html/${TARNAME}/${TARNAME}-${VERSION}/$(basename ${1})"
+}
+
+echo " * Found files:"
+for f in "${FILES[@]}"; do
+ echo " $(basename ${f})"
+done
+echo
+
+for f in "${FILES[@]}"; do
+ echo " * Processing file: $(basename ${f}):"
+
+ echo -n " Generating SHA512 checksum ... "
+ pushd "$(dirname ${f})" > /dev/null
+ sha512sum "$(basename ${f})" > "$(basename ${f}).sha512"
+ popd > /dev/null
+ echo "done"
+
+ echo -n " Uploading file ... "
+ do_curl "${f}"
+ echo "done"
+
+ echo -n " Uploading SHA512 checksum ... "
+ do_curl "${f}.sha512"
+ echo "done"
+
+ echo
+done
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
+}