Skip to content

Instantly share code, notes, and snippets.

@maxlinc
Created September 14, 2012 22:51
Show Gist options
  • Save maxlinc/3725464 to your computer and use it in GitHub Desktop.
Save maxlinc/3725464 to your computer and use it in GitHub Desktop.
Call an environment specific value-adding activity from within a Go template
<pipeline name="deploy">
<stage name="deploy">
<jobs>
<job name="deploy">
<tasks>
<exec command="bundle" workingdir="rpm">
<arg>install</arg>
<arg>--quiet</arg>
<arg>--path</arg>
<arg>/var/go/gems</arg>
<runif status="passed" />
</exec>
<rake target="deploy:all" workingdir="rpm">
<runif status="passed" />
</rake>
<rake target="deploy:smoke" workingdir="rpm">
<runif status="passed" />
</rake>
</tasks>
<resources>
<resource>deployer</resource>
</resources>
</job>
</jobs>
</stage>
<stage name="awesomeness">
<environmentvariables>
<variable name="GEM_DIR">
<value>/var/go/gems</value>
</variable>
</environmentvariables>
<jobs>
<job name="awesomeness">
<tasks>
<exec command="bundle" workingdir="rpm">
<arg>install</arg>
<arg>--quiet</arg>
<arg>--path</arg>
<arg>/var/go/gems</arg>
<runif status="passed" />
</exec>
<exec command="bash" workingdir="rpm">
<arg>-c</arg>
<arg>bundle exec rake GEM_DIR=${GEM_DIR} awesomeness:${GO_PIPELINE_NAME}</arg>
<runif status="passed" />
</exec>
</tasks>
<resources>
<resource>deployer</resource>
</resources>
</job>
</jobs>
</stage>
</pipeline>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment