Skip to content

Commit f5201a6

Browse files
committed
chore(stacks): add timescaledb to postgresql
1 parent 42e178f commit f5201a6

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN install-packages \
1717
procps
1818

1919
RUN install-packages \
20+
cmake \
2021
autoconf \
2122
automake \
2223
bzip2 \
@@ -69,4 +70,5 @@ RUN UPX_VERSION=4.0.2; \
6970
wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${OS_ARCH}_linux.tar.xz; \
7071
tar -Jxvf upx-${UPX_VERSION}-${OS_ARCH}_linux.tar.xz; \
7172
cp upx-${UPX_VERSION}-${OS_ARCH}_linux/upx /usr/local/bin; \
73+
rm -rf upx-*; \
7274
pip install oss2;

stacks/postgresql/build.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Load stack utils
44
. /usr/bin/stack-utils
55
POSTGIS_VERSION=$(curl -Ls https://github.com/postgis/postgis/tags|grep /postgis/postgis/releases/tag/ | sed -E 's/.*\/postgis\/postgis\/releases\/tag\/([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
6+
TIMESCALE_VERSION=$(curl -Ls https://github.com/timescale/timescaledb/releases|grep /timescale/timescaledb/releases/tag/ | sed -E 's/.*\/timescale\/timescaledb\/releases\/tag\/([0-9\.]{1,})".*/\1/g' | head -1)
67
# Implement build function
78
function build() {
89
# Generate binary
@@ -79,17 +80,27 @@ function build() {
7980
--prefix="/opt/drycc/postgresql/${PG_MAJOR}/postgis/${POSTGIS_VERSION}" \
8081
--with-pgconfig=/opt/drycc/postgresql/"${PG_MAJOR}"/bin/pg_config \
8182
&& \
82-
make && \
83-
make install
83+
make && \
84+
make install && \
85+
cd - && \
86+
rm -rf postgis-"${POSTGIS_VERSION}"
87+
88+
# timescaledb
89+
curl -sSL "https://github.com/timescale/timescaledb/archive/refs/tags/${TIMESCALE_VERSION}.tar.gz" | tar -xz &&
90+
cd timescaledb-"${TIMESCALE_VERSION}" && \
91+
cmake -DPG_CONFIG=/opt/drycc/postgresql/"${PG_MAJOR}"/bin/pg_config -DAPACHE_ONLY=true && \
92+
make && \
93+
make install && \
94+
cd - && \
95+
rm -rf timescaledb-"${TIMESCALE_VERSION}"
8496

8597
cat << EOF > "${PROFILE_DIR}/${STACK_NAME}.sh"
8698
export PATH="/opt/drycc/postgresql/$PG_MAJOR/bin:\$PATH"
8799
export LD_LIBRARY_PATH="/opt/drycc/postgresql/$PG_MAJOR/lib:\$LD_LIBRARY_PATH"
88100
EOF
89101
cp -rf /opt/drycc/postgresql/* "${DATA_DIR}"
90-
cd /workspace && rm "postgresql-${PG_VER}" -rf
102+
cd /workspace && rm -rf "postgresql-${PG_VER}"
91103
}
92104

93105
# call build stack
94106
build-stack "${1}"
95-

0 commit comments

Comments
 (0)