Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js

dist: xenial

node_js:
- "10"
- "8"
Expand All @@ -8,8 +10,15 @@ node_js:
services:
- postgresql

before_script:
sudo: true

before_install:
- psql -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres
- if [ $TRAVIS_OS_NAME == "linux" ]; then
if [[ $(node -v) =~ v[1-9][0-9] ]]; then
source ./ci_scripts/build.sh;
fi
fi

notifications:
email:
Expand Down
9 changes: 9 additions & 0 deletions ci_scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

BUILD_DIR="$(pwd)"
source ./ci_scripts/install_openssl.sh 1.1.1b
sudo updatedb
source ./ci_scripts/install_libpq.sh
sudo updatedb
sudo ldconfig
cd $BUILD_DIR
38 changes: 38 additions & 0 deletions ci_scripts/install_libpq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

OPENSSL_DIR="$(pwd)/openssl-1.1.1b"
POSTGRES_VERSION="11.3"
POSTGRES_DIR="$(pwd)/postgres-${POSTGRES_VERSION}"
TMP_DIR="/tmp/postgres"
JOBS="-j$(nproc || echo 1)"

if [ -d "${TMP_DIR}" ]; then
rm -rf "${TMP_DIR}"
fi

mkdir -p "${TMP_DIR}"

curl https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgresql-${POSTGRES_VERSION}.tar.gz | \
tar -C "${TMP_DIR}" -xzf -

cd "${TMP_DIR}/postgresql-${POSTGRES_VERSION}"

if [ -d "${POSTGRES_DIR}" ]; then
rm -rf "${POSTGRES_DIR}"
fi
mkdir -p $POSTGRES_DIR

./configure --prefix=$POSTGRES_DIR --with-openssl --with-includes=${OPENSSL_DIR}/include --with-libraries=${OPENSSL_DIR}/lib --without-readline

cd src/interfaces/libpq; make; make install; cd -
cd src/bin/pg_config; make install; cd -
cd src/backend; make generated-headers; cd -
cd src/include; make install; cd -

export PATH="${POSTGRES_DIR}/bin:${PATH}"
export CFLAGS="-I${POSTGRES_DIR}/include"
export LDFLAGS="-L${POSTGRES_DIR}/lib"
export LD_LIBRARY_PATH="${POSTGRES_DIR}/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="${POSTGRES_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
35 changes: 35 additions & 0 deletions ci_scripts/install_openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

if [ ${#} -lt 1 ]; then
echo "OpenSSL version required." 1>&2
exit 1
fi

OPENSSL_VERSION="${1}"
OPENSSL_DIR="$(pwd)/openssl-${OPENSSL_VERSION}"
TMP_DIR="/tmp/openssl"
JOBS="-j$(nproc)"

if [ -d "${TMP_DIR}" ]; then
rm -rf "${TMP_DIR}"
fi
mkdir -p "${TMP_DIR}"
curl -s https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | \
tar -C "${TMP_DIR}" -xzf -
pushd "${TMP_DIR}/openssl-${OPENSSL_VERSION}"
if [ -d "${OPENSSL_DIR}" ]; then
rm -rf "${OPENSSL_DIR}"
fi
./Configure \
--prefix=${OPENSSL_DIR} \
enable-crypto-mdebug enable-crypto-mdebug-backtrace \
linux-x86_64
make -s $JOBS
make install_sw
popd

export PATH="${OPENSSL_DIR}/bin:${PATH}"
export CFLAGS="-I${OPENSSL_DIR}/include"
export LDFLAGS="-L${OPENSSL_DIR}/lib"
export LD_LIBRARY_PATH="${OPENSSL_DIR}/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="${OPENSSL_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"