Yabeda is a tool that gets information about pipelines from GitLab CI and sends it to Slack as pretty messages to. You can call it from your deployment pipelines to get detailed deployment notifications.
To allow yabeda get pipeline info from GitLab you need to provide access token with "api" scope for any GitLab user. Because "api" scope provides too much access, it's better to create a separate user with limited permissions.
Assuming you have self-hosted GitLab instance and access to admin panel:
/admin/users/new
page in you Gitlab/admin/users/yabeda/impersonation_tokens
.Save token. You'll need to provide it in yabeda configuration.
You have to create your own slack app so only your instances of yabeda can post notifications to your slack workspace.
After installing app to your workspace you'll see two tokens: "OAuth Access Token" and "Bot User OAuth Access Token". Save them both. You'll need to provide them in yabeda configuration.
:yabeda-pending-stage:
:gitlab-status-canceled:
:gitlab-status-created:
:gitlab-status-failed:
:gitlab-status-manual:
:gitlab-status-pending:
:gitlab-status-running:
:gitlab-status-skipped:
:gitlab-status-success:
:gitlab-status-warning:
yabeda:
stage: build
image: alpine
before_script:
- apk --no-cache add ca-certificates httpie
script:
- http --check-status --ignore-stdin -f POST "https://my-yabeda-host.test/report/$CI_PROJECT_PATH" pipeline_id=${CI_PIPELINE_ID} token=${YABEDA_TOKEN} channel=random
allow_failure: true
only:
- master
- tags
except:
- schedules
Replace random
with your slack channel name, https://my-yabeda-host.test
with your yabeda host and add YABEDA_TOKEN
to your CI secrets.
You can also call yabeda with any http client like curl:
curl -X POST -d "channel=random&pipeline_id=${CI_PIPELINE_ID}&token=${YABEDA_TOKEN}" "https://my-yabeda-host.test/report/$CI_PROJECT_PATH"
You can create a virtualenv with python3 -m venv .venv
and source .venv/bin/activate
to ensure everytihing is local
make install
make run-locally