Git Product home page Git Product logo

slackjob's Introduction

Helm3 hooks example that sends slack message on post-install and post-upgrade hooks

Example of how to use Helm3 hookst to execte customer job In our case it's a simple slack hook but it can be Codefresh pipleine or anything else. In addition you can see example of running Codefresh Pipeline

In this repo there is a simple implementation of slack notify component that recieves arguments of SLACK_CHANNEL - env variable full url for shared channel to send a messgage msg flag - that help to override message

In ./demochart/template/test there is a definition of job , it uses already build verchol/slackjob public images built from this repo (see below)

Run Example

git clone https://github.com/verchol/slackjob.git && cd ./slackjob

helm3 install  --debug d2 ./demochart/ --set Slack.SLACK_CHANNEL=$SLACK_CHANNEL --set Slack.SLACK_MSG="notificaiton message"

Job manfiest

{{define "defaultmessage"}}
 "hello from" -  {{template "demochart.fullname" .}}
{{end}}
apiVersion: batch/v1
kind: Job
metadata:
 name: "{{ include "demochart.fullname" . }}-{{ uuidv4 }}-job"
 annotations:
   "helm.sh/hook": "post-install, post-upgrade"
   "helm.sh/hook-delete-policy": "hook-failed, hook-succeded" 

spec:
 backoffLimit: 6
 completions: 1
 parallelism: 1
 template:
   spec:
     containers:
     - image: verchol/slackjob
       imagePullPolicy: Always
       env:
       - name: SLACK_CHANNEL
         value: {{.Values.Slack.SLACK_CHANNEL}}
       name: j1
       args: ["--msg", {{ default (include "defaultmessage" .) .Values.Slack.SLACK_MSG | quote }}]
     restartPolicy: Never
     

slackjob's People

Contributors

verchol avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.