cachet-slack-integration icon indicating copy to clipboard operation
cachet-slack-integration copied to clipboard

Integration with cachethq/docker

Open jmccann opened this issue 6 years ago • 1 comments

First let me say THANKS for this! Was happy to see someone had code to integrate cachet with slack and happier to see it structured in a way that allows it to be integrated very easily!!

I wanted to provide what I did to get this integration to work with the existing cachethq/docker image.

Dockerfile:

FROM cachethq/docker:2.3.12

# integration for slack - https://github.com/mrbase/cachet-slack-integration
## Add version to composer
COPY patches/composer.patch /tmp/composer.patch
RUN patch /var/www/html/composer.json /tmp/composer.patch
## Install integration
RUN php /bin/composer.phar require "cachethq/cachet:2.4.x-dev" && php /bin/composer.phar require mrbase/cachet-slack-integration
COPY patches/slack.patch /tmp/slack.patch
RUN patch /var/www/html/config/app.php /tmp/slack.patch
RUN php artisan vendor:publish
## Copy default config for integration
RUN cp /var/www/html/vendor/mrbase/cachet-slack-integration/src/resources/slack.php /var/www/html/config/slack.php
RUN sudo chown www-data /var/www/html/config/slack.php

patches/composer.patch:

--- composer.orig  2017-12-01 12:13:36.000000000 -0600
+++ composer.json       2017-11-30 16:30:59.000000000 -0600
@@ -1,5 +1,6 @@
 {
     "name": "cachethq/cachet",
+    "version": "2.4.x-dev",
     "description": "An open source status page system, for everyone.",
     "keywords": ["laravel", "cachet", "alt-three", "status", "page"],
     "type": "project",

patches/slack.patch:

--- app.php
+++ app.new
@@ -189,6 +189,11 @@
         'CachetHQ\Cachet\Foundation\Providers\RepositoryServiceProvider',
         'CachetHQ\Cachet\Foundation\Providers\RouteServiceProvider',

+        /*
+         * Slack Integration
+         */
+        Maknz\Slack\SlackServiceProvider::class,
+        Mrbase\CachetSlackIntegration\ServiceProvider::class,
     ]),

     /*
@@ -229,6 +234,7 @@
         'Route'     => 'Illuminate\Support\Facades\Route',
         'Schema'    => 'Illuminate\Support\Facades\Schema',
         'Session'   => 'Illuminate\Support\Facades\Session',
+        'Slack'      =>  Maknz\Slack\Facades\Slack::class,
         'Storage'   => 'Illuminate\Support\Facades\Storage',
         'URL'       => 'Illuminate\Support\Facades\URL',
         'Validator' => 'Illuminate\Support\Facades\Validator',

Feel free to include this in your repo or just close this issue for others to find.

Thanks again!!!

jmccann avatar Dec 04 '17 15:12 jmccann

Glad you like it - I haven't used it in a while tho. Have you used it with the latest version of cachet ? Last I checket events where handled differently than the implementation i did.

mrbase avatar Dec 07 '17 13:12 mrbase