Publishing Overview#

The publish command group provides workflows for publishing layers from various data sources to GeoServer.

Available Publishers#

PostGIS Publisher#

Publish vector layers from PostGIS databases.

1
./geoserver-cli publish postgis --help

See PostGIS Publishing for details.

File Publisher#

Publish layers from files (Shapefiles, GeoTIFF) using GeoServer Importer extension.

1
./geoserver-cli publish file --help

See File Import for details.

Common Workflow#

  1. Ensure Datastore Exists: Create or verify the datastore is configured
  2. Discover Resources: List available tables/files to publish
  3. Select Resources: Choose specific resources or use filters
  4. Publish: Create feature types/layers in GeoServer
  5. Configure: Set styles, enable, and advertise layers

Dry Run#

All publish commands support --dry-run to preview what would happen:

1
./geoserver-cli publish postgis --all -w my_workspace --dry-run

Concurrency#

Publishing operations support concurrent execution for better performance:

1
2
# Use 4 concurrent workers
./geoserver-cli publish postgis --all -w my_workspace --concurrency 4

Idempotency#

Publishing is idempotent - existing layers are skipped automatically:

1
2
3
4
5
# First run: publishes all layers
./geoserver-cli publish postgis --all -w my_workspace

# Second run: skips existing layers
./geoserver-cli publish postgis --all -w my_workspace