liquidのパラメータを外部から設定したい
やりたいこと:
$ embulk config.yml.liquid -X HOGE_ENV=staging
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CfP lists</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.2.1/css/bulma.min.css"> | |
</head> | |
<body> | |
<div id="app"></div> |
version: "2" | |
services: | |
jenkins: | |
image: jenkinsci/jenkins | |
ports: | |
- "8080:8080" | |
- "50000:50000" | |
volumes: | |
- "./jenkins_home:/var/jenkins_home" |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath "com.squareup.okhttp3:okhttp:3.2.0" | |
} | |
} | |
import okhttp3.OkHttpClient |
@Grab("ninja.siden:siden-core:+") | |
import ninja.siden.App | |
import groovy.json.JsonBuilder | |
Object.metaClass.asJson = { | |
def builder = new JsonBuilder(delegate) | |
builder.toString() | |
} |
よしだ
twitter: @grimrose
yokohama.groovyから来ました。
// 元ネタ | |
if(!((条件A || 条件B || 条件C)&&( 条件D || 条件E)){ | |
// do something | |
} | |
// 自分がリファクタリングするなら | |
if (改善後条件(argument)) { | |
doSomething(argument); | |
} |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "centos7" | |
config.vm.box_url = "file://./packer-templates/centos-7.1/centos-7-1-x64-virtualbox.box" | |
config.vm.box_check_update = false | |
config.ssh.forward_agent = true | |
config.vm.network "private_network", ip: "192.168.33.24" |
#!/usr/bin/env embulk exec | |
require 'embulk' | |
require 'date' | |
today = Date.today | |
yesterday = today -1 | |
from = yesterday.strftime("%Y-%m-%d") | |
to = today.strftime("%Y-%m-%d") |
@Grapes([ | |
@Grab(group = 'net.moznion', module = 'donovan', version = '1.0.0'), | |
@Grab(group = 'org.eclipse.jetty', module = 'jetty-server', version = '9.2.10.v20150310'), | |
@Grab(group = 'org.slf4j', module = 'slf4j-simple', version = '1.7.12') | |
]) | |
import net.moznion.donovan.BasicAPIResponse | |
import net.moznion.donovan.DonovanJetty | |
def jetty = new DonovanJetty() |