|
5 | 5 | 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 | 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) |
7 | 7 | PGVECTOR_VERSION=$(curl -Ls https://github.com/pgvector/pgvector/tags | grep '/pgvector/pgvector/archive/refs/tags/' | sed -E 's|.*/tags/v([0-9]+\.[0-9]+\.[0-9]+).*|\1|' | sort -Vr | head -1) |
| 8 | +PG_REPACK_VERSION=$(curl -Ls https://github.com/reorg/pg_repack/tags | grep '/pg_repack/archive/refs/tags/' | sed -E 's|.*/tags/ver_([0-9]+\.[0-9]+\.[0-9]+).*|\1|' | sort -Vr | head -1) |
| 9 | + |
8 | 10 | # Implement build function |
9 | 11 | function build() { |
10 | 12 | # Generate binary |
@@ -41,7 +43,7 @@ function build() { |
41 | 43 | libproj-dev \ |
42 | 44 | libprotobuf-c-dev \ |
43 | 45 | protobuf-c-compiler |
44 | | - |
| 46 | + echo "-----------------start buid postpostgres-------------" |
45 | 47 | # postgresql |
46 | 48 | curl -sSL "https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz" | tar -xz && \ |
47 | 49 | cd postgresql-"${PG_VER}" && \ |
@@ -73,7 +75,7 @@ function build() { |
73 | 75 | # we can change from world to world-bin in newer releases |
74 | 76 | make world && \ |
75 | 77 | make install-world |
76 | | - |
| 78 | + cd - |
77 | 79 | # postgis |
78 | 80 | echo "-----------------start buid postgis-------------" |
79 | 81 | curl -sSL "https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz" | tar -xz && \ |
@@ -101,11 +103,22 @@ function build() { |
101 | 103 | echo "-----------------start buid vector-------------" |
102 | 104 | export PG_CONFIG=/opt/drycc/postgresql/"${PG_MAJOR}"/bin/pg_config |
103 | 105 | curl -sSL https://codeload.github.com/pgvector/pgvector/tar.gz/refs/tags/v${PGVECTOR_VERSION} | tar -xz && |
104 | | - cd pgvector-${PGVECTOR_VERSION}/ |
| 106 | + cd pgvector-${PGVECTOR_VERSION} && \ |
105 | 107 | make && \ |
106 | 108 | make install && \ |
107 | | - cd - |
108 | | - rm -rf pgvector-${PGVECTOR_VERSION}/ |
| 109 | + cd - && \ |
| 110 | + rm -rf pgvector-${PGVECTOR_VERSION} |
| 111 | + |
| 112 | + |
| 113 | +# pg_repack |
| 114 | + echo "-----------------start buid pg_repack-------------" |
| 115 | + export PG_CONFIG=/opt/drycc/postgresql/"${PG_MAJOR}"/bin/pg_config |
| 116 | + curl -sSL https://github.com/reorg/pg_repack/archive/refs/tags/ver_${PG_REPACK_VERSION}.tar.gz | tar -xz && |
| 117 | + cd pg_repack-ver_${PG_REPACK_VERSION} && \ |
| 118 | + make && \ |
| 119 | + make install && \ |
| 120 | + cd - && \ |
| 121 | + rm -rf pg_repack-ver-${PG_REPACK_VERSION} |
109 | 122 |
|
110 | 123 | cat << EOF > "${PROFILE_DIR}/${STACK_NAME}.sh" |
111 | 124 | export PATH="/opt/drycc/postgresql/$PG_MAJOR/bin:\$PATH" |
|
116 | 129 | cd /workspace && rm -rf "postgresql-${PG_VER}" |
117 | 130 | } |
118 | 131 |
|
119 | | - |
120 | 132 | # call build stack |
121 | 133 | build-stack "${1}" |
0 commit comments