Skip to content

Instantly share code, notes, and snippets.

Created April 4, 2015 11:38
Show Gist options
  • Save anonymous/264eb5f74413528cd331 to your computer and use it in GitHub Desktop.
Save anonymous/264eb5f74413528cd331 to your computer and use it in GitHub Desktop.
jgorak@momentum ~/example $ cat vars/1-common/common.erb
<%
LOGDIR="/var/log"
%>
jgorak@momentum ~/example $ cat vars/2-region/dev.erb
<%
REGION="dev"
%>
jgorak@momentum ~/example $ cat vars/3-host/node1.erb
<%
HOST="host"
JAVA_XMS="512m"
%>
jgorak@momentum ~/example $ cat templates/cleanup.sh.erb
#!/bin/sh
LOGDIR=<%= LOGDIR %>
REGION=<%= REGION %>
HOST=<%= HOST %>
JAVA_XMS=<%= JAVA_XMS %>
java ...... $LOGDIR/$REGION -Dhost=$HOST .... -Xms=$JAVA_JMS
jgorak@momentum ~/example $ (cat vars/1-common/common.erb vars/2-region/dev.erb vars/3-host/node1.erb templates/cleanup.sh.erb )|erb
#!/bin/sh
LOGDIR=/var/log
REGION=dev
HOST=host
JAVA_XMS=512m
java ...... $LOGDIR/$REGION -Dhost=$HOST .... -Xms=$JAVA_JMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment