-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all docker testing tools to its own directory
- Loading branch information
Showing
9 changed files
with
126 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
!sql | ||
!src | ||
!test | ||
!entrypoint.sh | ||
!h3.control | ||
!Makefile |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ARG UBUNTU=xenial | ||
FROM ubuntu:${UBUNTU} | ||
ARG UBUNTU | ||
ARG POSTGRESQL=10 | ||
ARG POSTGIS=2.4 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git | ||
|
||
# xenial needs gnupg-curl for https support | ||
RUN if [ "$UBUNTU" = "xenial" ] ; then apt-get install -y gnupg-curl; fi | ||
|
||
# Setup PostgreSQL apt repository | ||
RUN apt-key adv --fetch-keys https://www.postgresql.org/media/keys/ACCC4CF8.asc | ||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ ${UBUNTU}-pgdg main" >> /etc/apt/sources.list.d/pgdg.list | ||
RUN apt-get update | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
postgresql-${POSTGRESQL}-postgis-${POSTGIS}-scripts \ | ||
postgresql-${POSTGRESQL}-postgis-${POSTGIS} \ | ||
postgresql-server-dev-${POSTGRESQL} \ | ||
postgresql-${POSTGRESQL} | ||
|
||
# Set workdir | ||
WORKDIR /tmp/h3-pg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ARG UBUNTU | ||
FROM h3-pg:base-${UBUNTU} | ||
ARG UBUNTU | ||
ARG POSTGRESQL | ||
ARG POSTGIS | ||
|
||
COPY . /tmp/h3-pg | ||
|
||
RUN make install | ||
|
||
USER postgres | ||
|
||
CMD service postgresql start && \ | ||
psql -c "CREATE EXTENSION postgis;" && \ | ||
make installcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BASEDIR=$(dirname $(realpath "$0")) | ||
cd $BASEDIR | ||
|
||
docker build -f base.Dockerfile -t h3-pg:base .. | ||
docker build -f build.Dockerfile -t h3-pg:build .. | ||
|
||
cd .. | ||
docker run --rm -v "$PWD":/tmp/h3-pg h3-pg:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG UBUNTU | ||
FROM h3-pg:base-${UBUNTU} | ||
ARG UBUNTU | ||
ARG POSTGRESQL | ||
ARG POSTGIS | ||
|
||
# Hacky solution to non-root user in CMD | ||
RUN chmod -R a+w \ | ||
/usr/share/postgresql/${POSTGRESQL} \ | ||
/usr/lib/postgresql/${POSTGRESQL}/lib | ||
|
||
USER postgres | ||
|
||
CMD service postgresql start && \ | ||
psql -c "CREATE EXTENSION postgis;" && \ | ||
make install && \ | ||
make installcheck && \ | ||
make clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG UBUNTU | ||
FROM h3-pg:base-${UBUNTU} | ||
ARG UBUNTU | ||
ARG POSTGRESQL | ||
ARG POSTGIS | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
pgxnclient | ||
|
||
RUN pgxnclient install h3 | ||
|
||
USER postgres | ||
|
||
CMD service postgresql start && \ | ||
psql -c "CREATE EXTENSION postgis;" && \ | ||
pgxnclient load h3 && \ | ||
pgxnclient check h3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
BASEDIR=$(dirname $(realpath "$0")) | ||
cd $BASEDIR | ||
cd .. | ||
|
||
for UBUNTU in bionic xenial | ||
do | ||
echo "Testing on Ubuntu ${UBUNTU}" | ||
|
||
echo " - Building Docker images" | ||
for IMAGE in base build pgxn | ||
do | ||
echo -n " * $IMAGE... " | ||
result=$(docker build \ | ||
--build-arg UBUNTU=${UBUNTU} \ | ||
-f docker/${IMAGE}.Dockerfile \ | ||
-t h3-pg:${IMAGE}-${UBUNTU} \ | ||
. 2> /dev/null) | ||
if [[ $? -eq 0 ]] ; then | ||
echo "success" | ||
else | ||
echo "fail:" | ||
echo "$result" | ||
fi | ||
done | ||
|
||
echo " - Testing Docker images" | ||
for IMAGE in build pgxn | ||
do | ||
echo -n " * $IMAGE... " | ||
result=$(docker run --rm h3-pg:${IMAGE}-${UBUNTU} 2> /dev/null) | ||
if [[ $? -eq 0 ]] ; then | ||
echo "success" | ||
else | ||
echo "fail:" | ||
echo "$result" | ||
fi | ||
done | ||
done |
This file was deleted.
Oops, something went wrong.