Skip to content

Instantly share code, notes, and snippets.

View u-minor's full-sized avatar

Minoru Nakata u-minor

View GitHub Profile
#!/bin/bash
set -e
usage() {
echo "Usage: git release [-r <reviewers>] <version>" >&2
echo " reviewers: List of GitHub user ID (<uid>[,<uid>...])" >&2
echo " version: <newversion>|major|minor|patch|premajor|preminor|prepatch|prerelease" >&2
exit 1
}
###
# Post s3 path to Slack
#
# Usage: bash circleci2-s3path-slack
#
# Required environment variables:
#
# - SLACK_ENDPOINT: Slack endpoint url
# - S3PATH: S3 path
#
@u-minor
u-minor / circleci2-container-tag-slack
Created June 5, 2017 12:19
Post docker image tag to Slack (CircleCI 2.0)
###
# Post docker container tag to Slack
#
# Usage: bash circleci2-container-tag-slack
#
# Required environment variables:
#
# - SLACK_ENDPOINT: Slack endpoint url
# - IMAGE: container image name
# - TAG: tag of container image
@u-minor
u-minor / circleci2-coverage-slack
Last active September 22, 2020 10:38
Calc coverage rate from CircleCI build and post to Slack (support CircleCI 2.0)
###
# Post coverage rate to Slack
#
# Usage: bash circleci-coverage-slack.sh [cobertura|jacoco]
#
# Required environment variables:
#
# - CIRCLE_TOKEN: project-specific readonly API token (need to access build artifacts for others)
# - SLACK_ENDPOINT: Slack endpoint url
# - COVERAGE_FILE: coverage xml filename (default: coverage.xml)
@u-minor
u-minor / AssumeRolePolicy.json
Last active June 22, 2016 06:18
AWS Lambda を作成・更新するための gulpfile 雛形 ref: http://qiita.com/u-minor/items/17802910bcf54e10625f
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
@u-minor
u-minor / file1.txt
Last active August 29, 2015 14:24
API Gateway + Lambda で SNS にメッセージ投稿する ref: http://qiita.com/u-minor/items/f1eb05b3d333e8cc45a6
aws --region us-east-1 lambda create-function \
--function-name lambda-newrelic-sns \
--runtime nodejs \
--role arn:aws:iam::xxxxxxxx:role/lambda_sns_execution \
--handler index.handler \
--description 'Send message to Amazon SNS' \
--timeout 3 \
--memory-size 128 \
--zip-file fileb://dist/lambda.zip
@u-minor
u-minor / gulpfile.coffee
Last active August 29, 2015 14:24
SNS + Lambda + Slack でアラート通知を受け取る ref: http://qiita.com/u-minor/items/596329da79abd64af658
gulp = require 'gulp'
coffee = require 'gulp-coffee'
zip = require 'gulp-zip'
del = require 'del'
runSequence = require 'run-sequence'
gulp.task 'clean', (cb) ->
del 'build', cb
gulp.task 'coffee', ->
@u-minor
u-minor / file3.txt
Last active August 29, 2015 14:23
SNS + Lambda + Twilio で音声電話をかける v2 ref: http://qiita.com/u-minor/items/d72e77e79203aab6ca70
aws --region ap-northeast-1 lambda update-function-code --function-name YOUR_FUNCTION_NAME --zip-file fileb://dist/lambda.zip
@u-minor
u-minor / TwiML.xml
Last active August 29, 2015 14:23
アラート発生時に AWS Lambda を使って音声電話をかける ref: http://qiita.com/u-minor/items/3eb01783b818273080c2
<Response>
<Say language="ja-JP" voice="alice">これはアラート通知テストです。</Say>
<Pause length="1"/>
<Say language="ja-JP" voice="alice">詳細は XXXX までお問い合わせください。</Say>
</Response>