Skip to content

Instantly share code, notes, and snippets.

View watarin's full-sized avatar

Takashi Watanabe watarin

View GitHub Profile
@watarin
watarin / jenkins-alb-nginx.conf
Created December 3, 2018 02:39
JenkinsをALB経由で受けるようにするnginx conf : ALB -> nginx -> Jenkins
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@watarin
watarin / modules_subnet_main.tf
Created November 29, 2018 09:38
Terraform AWS public/private subnetを持つVPC作成
#
# EIP for Nat Gateway
#
resource "aws_eip" "private-ngw" {
count = "${length(var.vpc_azs)}"
vpc = true
tags {
Name = "${var.prefix}-private-${var.vpc_short_azs[count.index]}-ngw"
}
}
@watarin
watarin / packer.sh
Last active November 16, 2018 05:12
#!/bin/bash
if [ $# -ne 2 ]; then
cat <<EOF
Usage $0 ACTION TARGET_JSON
ACTION: validate or build
TARGET_JSON: file name of json
EOF
exit 1
pipeline {
agent any
parameters {
string(name: 'BRANCH_NAME', defaultValue: 'DUMMY(please input branch name)', description: 'branch name')
choice(name: 'SERVICE_NAME', choices: 'NO_SELECT\nglobal\nfoo\nbar', description: 'target service: global or a seivice name')
choice(name: 'STAGE_NAME', choices: 'stag\nprod', description: 'target stege : stag or prod (if SERVICE_NAME is global, this value is no means)')
}
stages {
// apply global
@watarin
watarin / roadworker_Jenkinsfile
Last active November 16, 2018 05:00
roadworker scripts
pipeline {
agent any
parameters {
string(name: 'BRANCH_NAME', defaultValue: 'DUMMY(please input branch name)', description: 'branch name')
choice(name: 'ACTION', choices: 'dry-run\napply', description: 'action: dry-run or apply')
}
stages {
// dry-run
stage('Dry-Run'){
@watarin
watarin / ansible_converge.sh
Created November 16, 2018 04:53
ansible run scripts
#!/bin/bash
function print_usage (){
cat <<EOF
$0 PLAYBOOK INVENTORY [ansible-options]
EOF
}
@watarin
watarin / aws_sam_run.sh
Last active November 16, 2018 05:01
aws_sam_run.sh
#!/bin/bash
cd `dirname $0`
function print_usage (){
cat <<EOF
$0 ACTION STACK_NAME
ACTION: validate or test, build, package, changeset
@watarin
watarin / dot_ssh
Created October 26, 2018 10:11
dot_ssh common for Mac
ForwardAgent yes
UseKeychain yes
AddKeysToAgent yes
@watarin
watarin / dot_spacemacs
Last active October 29, 2018 08:07
spacemacs .spacemacs for Mac
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@watarin
watarin / nginx_jenkins_alb.conf
Created October 26, 2018 10:07
ALB->nginx->Jenkins 構成の nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {