Rezent is a Laravel app which takes incoming requests from Azure Pipelines or GitHub Actions and acts as a notification webhook where it processes the build information and outputs the results to Discord and/or Slack.
For Rezent there are 5 main things that it does:
- Recieves the API request in the
DriverController - Creates a new
ProcessBuildRequestjob - Runs the individual driver's code in
App/Driversdirectory - Checks if it hasn't posted the message once already
- Posts the message to Discord and/or Slack
To install Rezent, your machine must meet the below outlined requirements:
Required:
- PHP 7.2.5+
- Node & NPM
- Composer
- Other Laravel requirements
Highly recommended:
- Any of the Laravel supported Queue drivers to speed up Rezent dramatically.
- Rezent already comes installed with the
predis/predisComposer package installed.
- Rezent already comes installed with the
Note:
- SMTP server access is optionally required because the
Forgot password?action needs an e-mail server. If you do not have one, you can disable the action entirely by editing theroutes/web.phpfile:
Route::namespace('App\Http\Controllers')->group(function () {
- Auth::routes(['register' => false]);
+ Auth::routes(['register' => false, 'reset' => false]);
});To set up Rezent for development, you'll need to:
- Fork the repository and clone it to your machine
composer installnpm installnpm run devcp .env.example .envphp artisan key:generate- Configure the
.envfile php artisan migratephp artisan passport:installphp artisan make:user <name> <email>
Optional:
php artisan ide-helper:generatephp artisan ide-helper:modelsphp artisan ide-helper:meta
Happy coding!
To set up Rezent for production, you'll need to:
- Fork or clone the
masterbranch composer install --optimize-autoloader --no-devnpm installnpm run prodcp .env.example .env- Configure the
.envfile php artisan key:generatephp artisan migrate --forcephp artisan config:cachephp artisan route:cachephp artisan make:user <name> <email>
Ready to roll!
To start using Rezent, you'll need to follow these steps:
- Make sure that your
.envfile is configured correctly, so that you have the webhook information there - Create a user if you haven't done so already
- Log in as the created user
- Create a new project
- Note down the access token that Rezent generates
- Configure your CI tool according to the specification below
All the examples below will use Rezent at the following endpoint: https://rezent.test.
Azure Pipelines is a bit more tricky to set up.
- Navigate to your
Service Hookspage (e.g.https://dev.azure.com/my-org/my-repo/_settings/serviceHooks) - Add a new service hook by using the green
+ - Select
Web Hooks - Select the
Build completedevent - In the URL input, set it to
https://rezent.test/api/driver/pipelines - In the
HTTP headersfield add this:Authorization: Bearer <the copied token> - Don't test it because it won't work (it sends a unusable payload), just save it with
Next
GitHub Actions doesn't have a webhook implementation so we'll use cURL. To use it, you'll need to:
- Set the
REZENT_TOKENvalue in your repository'sSettings/SecretsGitHub page - Obtain the workflow ID that you will be testing against:
- You'll need to get the workflow ID which isn't available anywhere in the UI side
- Run this command (replace the placeholder data):
curl "https://api.github.com/repos/my-org/my-repo/actions/workflows" - Look for the workflow that matches the workflow name you want and find the ID of that workflow
- Insert that ID into your the placeholder ID of
123456
Example:
jobs:
notify:
needs: [validate, build]
if: always()
runs-on: ubuntu-latest
steps:
- name: Notify Rezent
env:
REZENT_TOKEN: ${{ secrets.REZENT_TOKEN }}
if: always()
run: |
curl -H "Authorization: Bearer ${REZENT_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X POST \
-d '{"organisation": "my-org", "repository": "my-repo", "workflow_id": 123456}' \
"https://rezent.test/api/driver/actions"Run the tests with:
php artisan testPlease see CONTRIBUTING.md for details.
If you discover any security-related issues, please e-mail security@garkaklis.com instead of using the issue tracker.
So, funny name for Mechilles, ZEN'ified. More of a joke, but I imagined the fact that it builds each build over and over for each new thing, and also the developer's resentment when the build fails 😄
The name is... ReZENt 😄
— Radium
The MIT License (MIT). Please see the License file for more information.