@@ -26,7 +26,7 @@ ARG libsodium_release=1.0.18
26
26
ARG pgsodium_release=3.1.6
27
27
ARG pg_graphql_release=1.4.2
28
28
ARG pg_stat_monitor_release=1.1.1
29
- ARG pg_jsonschema_release=0.1.4
29
+ ARG pg_jsonschema_release=0.2.0
30
30
ARG vault_release=0.2.8
31
31
ARG groonga_release=12.0.8
32
32
ARG pgroonga_release=2.4.0
@@ -574,6 +574,7 @@ RUN ls -al target/release
574
574
RUN mkdir archive
575
575
RUN cp target/release/pg_graphql-pg${postgresql_major}/usr/local/share/postgresql/extension/pg_graphql* archive
576
576
RUN cp target/release/pg_graphql-pg${postgresql_major}/usr/local/lib/postgresql/pg_graphql.so archive
577
+
577
578
# name of the package directory before packaging
578
579
ENV package_dir=pg_graphql-v${pg_graphql_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu
579
580
@@ -638,11 +639,60 @@ RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc
638
639
# ###################
639
640
# 22-pg_jsonschema.yml
640
641
# ###################
641
- FROM base as pg_jsonschema
642
- # Download package archive
642
+ FROM rust-toolchain as pg_jsonschema-source
643
+ # Download and extract
643
644
ARG pg_jsonschema_release
644
- ADD "https://github.com/supabase/pg_jsonschema/releases/download/v${pg_jsonschema_release}/pg_jsonschema-v${pg_jsonschema_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu.deb" \
645
- /tmp/pg_jsonschema.deb
645
+ ARG pg_jsonschema_release_checksum
646
+ ADD --checksum=${pg_jsonschema_release_checksum} \
647
+ "https://github.com/supabase/pg_jsonschema/archive/refs/tags/v${pg_jsonschema_release}.tar.gz" \
648
+ /tmp/pg_jsonschema.tar.gz
649
+ RUN tar -xvf /tmp/pg_jsonschema.tar.gz -C /tmp && \
650
+ rm -rf /tmp/pg_jsonschema.tar.gz
651
+ WORKDIR /tmp/pg_jsonschema-${pg_jsonschema_release}
652
+ RUN cargo pgrx package --no-default-features --features pg${postgresql_major}
653
+
654
+ # Create installable package
655
+ RUN mkdir archive
656
+ RUN cp target/release/pg_jsonschema-pg${postgresql_major}/usr/local/share/postgresql/extension/pg_jsonschema* archive
657
+ RUN cp target/release/pg_jsonschema-pg${postgresql_major}/usr/local/lib/postgresql/pg_jsonschema.so archive
658
+ RUN ls -al archive
659
+
660
+ # name of the package directory before packaging
661
+ ENV package_dir=pg_jsonschema-v${pg_jsonschema_release}-pg${postgresql_major}-${TARGETARCH}-linux-gnu
662
+
663
+ # # Copy files into directory structure
664
+ RUN mkdir -p ${package_dir}/usr/lib/postgresql/lib
665
+ RUN mkdir -p ${package_dir}/var/lib/postgresql/extension
666
+ RUN cp archive/*.so ${package_dir}/usr/lib/postgresql/lib
667
+ RUN cp archive/*.control ${package_dir}/var/lib/postgresql/extension
668
+ RUN cp archive/*.sql ${package_dir}/var/lib/postgresql/extension
669
+
670
+ # symlinks to Copy files into directory structure
671
+ RUN mkdir -p ${package_dir}/usr/lib/postgresql/${postgresql_major}/lib
672
+ WORKDIR ${package_dir}/usr/lib/postgresql/${postgresql_major}/lib
673
+ RUN cp -s ../../lib/*.so .
674
+ WORKDIR ../../../../../..
675
+
676
+ RUN mkdir -p ${package_dir}/usr/share/postgresql/${postgresql_major}/extension
677
+ WORKDIR ${package_dir}/usr/share/postgresql/${postgresql_major}/extension
678
+
679
+ RUN cp -s ../../../../../var/lib/postgresql/extension/pg_jsonschema.control .
680
+ RUN cp -s ../../../../../var/lib/postgresql/extension/pg_jsonschema*.sql .
681
+ WORKDIR ../../../../../..
682
+
683
+ RUN mkdir -p ${package_dir}/DEBIAN
684
+ RUN touch ${package_dir}/DEBIAN/control
685
+ RUN echo 'Package: pg-jsonschema' >> ${package_dir}/DEBIAN/control
686
+ RUN echo 'Version:' ${pg_jsonschema_release} >> ${package_dir}/DEBIAN/control
687
+ RUN echo "Architecture: ${TARGETARCH}" >> ${package_dir}/DEBIAN/control
688
+ RUN echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control
689
+ RUN echo 'Description: A PostgreSQL extension' >> ${package_dir}/DEBIAN/control
690
+
691
+ # Create deb package
692
+ RUN chown -R root:root ${package_dir}
693
+ RUN chmod -R 00755 ${package_dir}
694
+ RUN dpkg-deb --build --root-owner-group ${package_dir}
695
+ RUN cp ./*.deb /tmp/pg_jsonschema.deb
646
696
647
697
# ###################
648
698
# 23-vault.yml
@@ -869,7 +919,7 @@ COPY --from=pgsodium-source /tmp/*.deb /tmp/
869
919
COPY --from=pg_hashids-source /tmp/*.deb /tmp/
870
920
COPY --from=pg_graphql-source /tmp/*.deb /tmp/
871
921
COPY --from=pg_stat_monitor-source /tmp/*.deb /tmp/
872
- COPY --from=pg_jsonschema /tmp/*.deb /tmp/
922
+ COPY --from=pg_jsonschema-source /tmp/*.deb /tmp/
873
923
COPY --from=vault-source /tmp/*.deb /tmp/
874
924
COPY --from=pgroonga-source /tmp/*.deb /tmp/
875
925
COPY --from=wrappers /tmp/*.deb /tmp/
0 commit comments