
When our teams are responsible for DevOps practices, we often need to monitor builds and other automated jobs.
In this tutorial, we’ll see how to configure two popular platforms, Jenkins and Slack, to work together and tell us what’s happening while our CI/CD pipelines are running.
Let’s start by configuring Slack so Jenkins can send messages to it. To do this, we’ll create a custom Slack app, which requires an Administrator account.
In Slack, we’ll create an application and generate an OAuth token:
When this is done, we’ll see a summary screen:
Now, we need to take note of the OAuth token — we’ll need it later when we configure Jenkins. We should treat these as sensitive credentials and keep them safe.
To complete the Slack setup, we must invite the new Jenkins user into the channels we wish it to use. One easy way to do this is to mention the new user with the @ character inside each channel.
To set up Jenkins, we’ll need an administrator account.
First, let’s start by logging into Jenkins and navigating to Manage Jenkins > Plugin Manager.
Then, on the Available tab, we’ll search for Slack:
Let’s select the checkbox for Slack Notification and click Install without restart.
Now, we need to configure new credentials. Let’s navigate to Jenkins > Credentials > System > Global Credentials and add a new Secret text credential:
We’ll put the OAuth token from Slack into the Secret field. We should also give these credentials a meaningful ID and description to help us easily identify them later. The Jenkins credentials store is a safe place to keep this token.
Once we save the credentials, there is one more global configuration to set. Under Jenkins > Manage Jenkins > Configure System, we need to check the Custom slack app bot user checkbox under the Slack section:
Now that we’ve completed the Jenkins setup, let’s look at how to configure Jenkins jobs and pipelines to send Slack messages.


Traditional Jenkins jobs usually execute one or more actions to accomplish their goals. These are configured via the Jenkins user interface.
In order to integrate a traditional job with Slack, we’ll use a post-build action.
Let’s pick any job, or create a new one. When we drop down the Add post-build action menu, we’ll find Slack Notifications:
Once selected, there are lots of available inputs to the Slack Notification action. Generally, most of the default values are sufficient. However, there are a few required pieces of information:
We can also specify additional fields if desired, such as commit information used for the Jenkins job, custom messages, custom bot icons, and more:
When setting things up via the UI, we can use the Test Connection button to ensure that Jenkins can reach Slack. If successful, we’ll see a test message in the Slack channel from the Jenkins user:
If the message doesn’t show up, the Jenkins log files are useful for troubleshooting. Generally, we need to double-check that the post-build action has all required fields, that the OAuth token was copied correctly, and that the token was granted the proper scopes when we configured Slack.

Jenkins Pipelines differ from traditional jobs. They use a single Groovy script, broken into stages, to define a build. They also don’t have post-build actions, so we use the pipeline script itself to send Slack messages
The following snippet sends a message to Slack from a Jenkins pipeline:
groovyslackSend botUser: true,channel: 'builds',color: '#00ff00',message: 'Testing Jekins with Slack',tokenCredentialId: 'slack-token'
Just like with the traditional Jenkins job setup, we must still specify a channel name and the name of the credential to use.
Via a Jenkins pipeline, we can also use a variety of additional Slack features, such as file upload, message threads, and more.
One downside to using Jenkins pipelines is that there’s no test button. To test the integration with Slack, we have to execute the whole pipeline.
When first setting things up, we can create a new pipeline that contains only the Slack command while we’re getting things working.


In this article, we’ve seen how to integrate Jenkins and Slack to gain feedback on our CI/CD pipelines.
Using a Jenkins plugin, along with a custom Slack application, we were able to send messages from Jenkins to Slack. This allows teams to notice the status of Jenkins jobs and address issues more quickly.

Xin chào các bạn, hôm nay mình sẽ chia sẻ với các bạn về Snowflake - một nền tảng dữ liệu đám mây mà mình đã có cơ hội làm việc và triển khai trong các dự án gần đây. Mình sẽ giải thích về Snowflake, lý do tại sao nó lại quan trọng trong môi trường production, và chia sẻ một số kinh nghiệm thực tế khi làm việc với Snowflake và AWS.
Beiryu
Contributor

To notify Slack for AWS CodePipeline, create a notification rule for the pipeline, selecting all events and Slack as the target. Register the Slack channel as a target and configure a new chatbot client. After authorizing Slack, specify the Slack channel to connect to, set the chatbot's privileges, and establish guard rules. With read-only access for both allowed rules and guard conditions, the pipeline can trigger notifications to the Slack channel.
Beiryu
Contributor