# Generate notifications, using Cycloid events as example
Most of our customers ask to send notifications for pipeline status on Slack, Github, etc.
Pipelines are really flexible and lot of functionalities can be added by resources. The best approach to send notifications is to use resources. You can integrate any notification type by using existing resource or by creating your own.
Let's use Cycloid events as example of notification.
Before using events, we advise you to create a dedicated Cycloid's user and put its credential into Cycloid credential section. In our case, we will create a dedicated user called Cyclobot and add the account as a
basic_auth typed credential named
password as fields:
As well, you already know the next step. If we want to keep our pipeline generic, let's define new variables for the API URL and the user to use in pipeline variables.
Follow those steps to apply all changes described in this step
# Cycloid events configuration api_login: ((basic_auth_cyclobot-account.username)) api_password: ((basic_auth_cyclobot-account.password)) api_url: https://http-api.cycloid.io
At this point, we are ready to configure a new
cycloid-events resource in the pipeline and use it in our job.
resource_types: ... - name: cycloid-events type: docker-image source: repository: cycloid/cycloid-events-resource resources: ... - name: cycloid-events type: cycloid-events source: api_login: ((api_login)) api_password: ((api_password)) api_url: ((api_url)) icon: fa-code-branch organization: ((customer)) severity: info type: Custom tags: - key: project value: ((project)) - key: env value: ((env)) - key: customer value: ((customer)) jobs: ... - name: functional-tests plan: - do: ... on_failure: do: - put: cycloid-events params: severity: crit message: Oops title: The deployment of ((project)) owl have failed on ((env)) environment on_success: do: - put: cycloid-events params: message: Congrats ! title: Successful deployment of ((project)) owl on ((env)) environment
First define a new type of resource
cycloid-events and configure it in the
resources section. Finally add a pipeline step hook for success and failure which call the
Add and commit those changes in Git:
git add . git commit -m "Step 7" git push origin stacks
Get back to Cycloid's dashboard, click on the
Refresh pipeline button .
After running the pipeline, a new Cycloid event should be visible on the event view: