Skip to content

Instantly share code, notes, and snippets.

View EtienneDepaulis's full-sized avatar
🏠
Working from home

Etienne Depaulis EtienneDepaulis

🏠
Working from home
View GitHub Profile
@EtienneDepaulis
EtienneDepaulis / bash
Created December 8, 2018 17:51
CircleCi notifications article - Bash init
npm install serverless -g
serverless create -template aws-ruby
@EtienneDepaulis
EtienneDepaulis / config.yml
Created December 8, 2018 17:46
CircleCi notifications article - CircleCI final configuration
# .circleci/config.yml
version: 2
jobs:
test:
docker:
- image: circleci/ruby:2.5.3-node-browsers
working_directory: ~/repo
steps:
- checkout
@EtienneDepaulis
EtienneDepaulis / circleci-notifications.rb
Created December 8, 2018 16:57
CircleCi notifications article - Main code with slack integration
# circleci-notifications.rb
require 'json'
require 'slack-ruby-client'
Slack.configure do |config|
config.token = ENV['SLACK_TOKEN']
end
SLACK_USERS = {
@EtienneDepaulis
EtienneDepaulis / bash
Last active December 8, 2018 16:53
CircleCi notifications article - SSM config
brew install awscli
aws configure
aws --region eu-west-1 ssm put-parameter --name circleci-notifications-slack-token --value top-secret-value --type String
@EtienneDepaulis
EtienneDepaulis / circleci-notifications.rb
Created December 8, 2018 16:36
CircleCi notifications article - Main code
# circleci-notifications.rb
require 'json'
def handler(event:, context:)
body = JSON.parse(event['body'])
payload = body['payload']
if payload['failed']
@EtienneDepaulis
EtienneDepaulis / Gemfile
Last active December 8, 2018 16:32
CircleCi notifications article - basic Gemfile
source 'https://rubygems.org'
gem 'rspec'
gem 'webmock'
gem 'awesome_print'
@EtienneDepaulis
EtienneDepaulis / serverless.yml
Created December 8, 2018 16:13
CircleCi notifications article - Basic serverless configuration
service: lambda-circleci-notifications
provider:
name: aws
runtime: ruby2.5
stage: dev
region: eu-west-1
functions:
circleci-notifications:
@EtienneDepaulis
EtienneDepaulis / config.yml
Created December 8, 2018 15:02
CircleCi notifications article - webhook registration
version: 2
jobs:
...
workflows:
...
notify:
webhooks:
- url: https://execute-api.eu-west-1.amazonaws.com/prod/notify_author
@EtienneDepaulis
EtienneDepaulis / config.yml
Last active July 30, 2018 12:47
CircleCI V2 Rails + Postgres + Headless Chrome + Rubocop + Heroku we currently use @ Lifen
version: 2
jobs:
checkout_code:
docker:
- image: circleci/ruby:2.5.1-node-browsers
- image: circleci/postgres:10.3-alpine
working_directory: ~/circleci-app
steps:
- checkout
- save_cache:
@EtienneDepaulis
EtienneDepaulis / application.css
Created February 19, 2014 10:45
Bower + Rails + Heroku + Glyphicons
/*
*= require bootstrap
*/
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../assets/bootstrap/fonts/glyphicons-halflings-regular.eot');
src: url('../assets/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../assets/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../assets/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),