Zum Inhalt springen

Integrating Container Registry with your toolchain

A modern container registry must do more than just store images; it must serve as a hub that integrates seamlessly into the broader DevOps and security toolchain. STACKIT Container Registry is designed for extensibility, offering a flexible webhook system for event-driven automation. This feature enables deep integration with CI/CD systems, monitoring platforms, and other essential tools.

By leveraging webhooks, you can transform STACKIT Container Registry from a passive artifact store into an active participant in your automated workflows. This guide details how to react to events in real time.

Webhooks are a powerful tool for reacting to events within the registry. They enable STACKIT CR to send real-time notifications to external systems whenever specific events occur within a project. This event-driven approach is perfect for triggering downstream automations.

Project administrators can configure webhooks to send an HTTP POST request to a specified URL (the “webhook endpoint”) when an event is triggered. The payload of this request contains a JSON object with detailed information about the event.

  • Supported Endpoints: Webhooks can be configured to send notifications to a generic HTTP endpoint or a Slack incoming webhook URL for direct integration with Slack channels.
  • Payload Formats: For HTTP endpoints, two JSON payload formats are supported:
    • Default: The legacy format used in older versions of Harbor.
    • CloudEvents: A standardized, specification-compliant format that provides richer metadata and better interoperability across systems. This is the recommended format for new integrations.

The following table summarizes the key events that can trigger a webhook, the essential data included in the payload, and common use cases for each. This serves as a quick reference for developers building integrations.

Webhook capabilities enable a rich ecosystem of integrations. For example:

  • GitLab CI/CD: GitLab can be easily integrated with STACKIT CR. By configuring the Harbor integration in GitLab, CI/CD pipelines gain access to predefined environment variables (e.g., $HARBOR_URL, $HARBOR_PROJECT, $HARBOR_PASSWORD) that simplify the process of logging in, pushing, and pulling images within pipeline jobs.