Parent Issue
Part of #561 (Make DocumentDB usable from package install)
Problem
The gateway package currently ships only the binary, config, and systemd unit. The documentdb-setup CLI (#562) and the Docker emulator entrypoint both depend on helper scripts (utils.sh, start_oss_server.sh, emulator_entrypoint.sh, etc.) and sample data files. Without these, neither the setup CLI nor the Docker image can function from package-installed paths.
Solution
Include the following in gateway packages at standardized paths:
Scripts (/usr/share/documentdb/scripts/)
documentdb-setup.sh -> installed as /usr/bin/documentdb-setup (755)
utils.sh
start_oss_server.sh
build_and_start_gateway.sh
emulator_entrypoint.sh
init_documentdb_data.sh
setup_psqlrc.sh
Sample Data (/usr/share/documentdb/sample-data/)
01-users.js
02-products.js
03-orders.js
04-analytics.js
README.md
Changes
DEB (pg_documentdb_gw/documentdb_gateway/Cargo.toml):
- Add 13 asset entries under
[package.metadata.deb]
- Add
depends = ["jq"] (required by documentdb-setup)
- Update
maintainer-scripts/postinst with quick-start hint
RPM (packaging/rpm/spec/documentdb_gateway.spec):
- Add
Requires: jq
- Add
%install commands to copy scripts + sample-data
- Add
%files entries for the new paths
Runtime Dependency
jq is required by documentdb-setup for safe JSON construction (SQL injection prevention via jq -n --arg). Added as a package dependency so dpkg -i / rpm -i will flag it.
Parent Issue
Part of #561 (Make DocumentDB usable from package install)
Problem
The gateway package currently ships only the binary, config, and systemd unit. The
documentdb-setupCLI (#562) and the Docker emulator entrypoint both depend on helper scripts (utils.sh,start_oss_server.sh,emulator_entrypoint.sh, etc.) and sample data files. Without these, neither the setup CLI nor the Docker image can function from package-installed paths.Solution
Include the following in gateway packages at standardized paths:
Scripts (
/usr/share/documentdb/scripts/)documentdb-setup.sh-> installed as/usr/bin/documentdb-setup(755)utils.shstart_oss_server.shbuild_and_start_gateway.shemulator_entrypoint.shinit_documentdb_data.shsetup_psqlrc.shSample Data (
/usr/share/documentdb/sample-data/)01-users.js02-products.js03-orders.js04-analytics.jsREADME.mdChanges
DEB (
pg_documentdb_gw/documentdb_gateway/Cargo.toml):[package.metadata.deb]depends = ["jq"](required bydocumentdb-setup)maintainer-scripts/postinstwith quick-start hintRPM (
packaging/rpm/spec/documentdb_gateway.spec):Requires: jq%installcommands to copy scripts + sample-data%filesentries for the new pathsRuntime Dependency
jqis required bydocumentdb-setupfor safe JSON construction (SQL injection prevention viajq -n --arg). Added as a package dependency sodpkg -i/rpm -iwill flag it.