Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: gitlab

RSS

GitLab Pipeline DingTalk Notification

This document describes how to integrate DingTalk bot notifications into a GitLab CI pipeline. The author created a base repository, `share/gitlab-ci`, which contains a `dingtalk.yml` template file. This file leverages GitLab Hook events to call the DingTalk API via `curl` to send messages. The core implementation includes defining global variables, validating the Access Token and URL-encoding the project address in the prepare stage, and constructing a Markdown message in the send stage that includes details such as task status, commit information, and the executor. It supports displaying different colors based on statuses like success or failure and includes jump buttons to view project and task details. In specific projects, this template is referenced using the `include` directive, and the `.dingtalk` configuration is inherited via `extends` in tasks across various stages, thereby enabling automated notifications for steps such as code inspection, building, and deployment. This solution addresses the previous issue where only repository information was recorded without pipeline notifications, achieving full-process visual feedback from task initiation to execution results. This enhances the transparency and collaboration efficiency of the DevOps workflow.

Views 341
ci-cd daily devops dingtalk integration gitlab gitlab ci

GitLab Deployment and DingTalk Integration

This article provides a detailed walkthrough of the complete process for deploying GitLab using Docker and deeply integrating it with DingTalk. First, the article demonstrates how to start the GitLab container using Docker commands, with a focus on the port mapping strategy: mapping port 80 directly to accommodate DingTalk's SSO login redirect behavior, which ignores ports; mapping the SSH port to 7003 and providing a corresponding client configuration example; and configuring persistent storage for configuration files, logs, and data directories. Second, the article explains in depth how to configure DingTalk as an Identity Provider (IdP) to implement Single Sign-On (SSO). This includes creating an application on the DingTalk Open Platform, obtaining the AppKey and AppSecret, configuring the callback domain, and enabling OmniAuth in GitLab's `gitlab.rb` file while entering the DingTalk credentials. Additionally, the article demonstrates in detail the configuration and verification of GitLab's SMTP email service to ensure that the email binding notification feature works correctly when users log in for the first time. Finally, the article introduces how to use DingTalk group robots as Webhook receivers to synchronize GitLab events, such as pushes and merge requests, to DingTalk group chats in real time, thereby enabling automated notifications for development collaboration information.

Views 129
DingTalk SSO devops docker gitlab k8s sso