This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIGDAG=~/bin/digdag | |
# see https://github.com/treasure-data/digdag/blob/v0.9.27/digdag-cli/src/main/java/io/digdag/cli/client/ShowAttempts.java#L83-L95 | |
last_result=$($DIGDAG attempts 2>&1 | tail -13); | |
if [[ $last_result =~ ^.+attempt[[:space:]]id:[[:space:]]([0-9]+).+$ ]]; | |
then | |
attempt_id=${BASH_REMATCH[1]}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
access_key = "ACCESS_KEY_HERE" | |
secret_key = "SECRET_KEY_HERE" | |
region = "us-east-1" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-27ce4931" | |
instance_type = "t1.micro" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage('dump redash postgre') { | |
sh ''' | |
cid=`/usr/local/bin/docker ps | grep redash_postgres | /usr/bin/awk '{print $1}'` | |
if [ -z "${cid}" ] | |
then | |
return 1; | |
else | |
ts=`date +%Y%m%d` | |
/usr/local/bin/docker exec ${cid} /bin/bash -c 'pg_dump -U postgres postgres | gzip > /usr/local/redash.gz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App{ | |
/****************** | |
* val : immutable valuable | |
******************/ | |
val one: Int = 1 | |
println(s"one is ${one}") | |
val two = 2 | |
println(s"two is ${two}") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App{ | |
/********** | |
* define methd | |
**********/ | |
def plus(a: Int, b: Int): Int = { | |
a + b | |
} | |
// no arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App{ | |
// Here your code ! | |
println("Hello world") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby "2.3.0" | |
gem "test-unit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function global:prompt { | |
$now = Get-Date -format "yyyy/MM/dd HH:mm" | |
Write-Host($now + " ") -nonewline | |
return "> " | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 以下のコマンドで本番環境用のサーバ構築が実行されます | |
ansible-playbook -i hosts nginx.yml --extra-vars="server_name=product worker_processes=2" -k | |
# 開発環境サーバ構築はこちら | |
ansible-playbook -i hosts nginx.yml --extra-vars="server_name=product worker_processes=2" -k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import env, run, local, sudo, cd | |
from fabric.contrib.files import exists, upload_template | |
from fabric.decorators import task | |
import java_setup | |
nginx_version='1.2.8' | |
nginx_dir = "nginx-%s" % nginx_version | |
nginx_url = "http://nginx.org/download/%s.tar.gz" % nginx_dir | |
install_dir = "/usr/local/nginx" |
NewerOlder