Skip to content

Instantly share code, notes, and snippets.

@rtyler
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtyler/90ff7367968464c0c979 to your computer and use it in GitHub Desktop.
Save rtyler/90ff7367968464c0c979 to your computer and use it in GitHub Desktop.
Sketching out a possible API for the service artifact plugin. Whose responsibility is to encapsulate some of the artifact standards and creation across projects.
plugins {
id "com.github.lookout.service-artifact" version "1.0"
}
/* serviceVersion is a helper method which will add SNAPSHOT when appropriate,
* but also introduce the appropriate Gerrit or Travis meta-data into the version
* number (e.g. 1.0.{GERRIT_CHANGE}.{GERRIT_PATCH})
*/
version = serviceVersion('1.0')
description = 'A sample Service to be built with Gradle'
group = 'com.github.lookout'
/* The following is an example of what a Gradle file might look like
* for a JRuby-based service artifact.
*
* A service artifact is a self-contained artifact containing everything
* execute a service. An artifact will take the form of a .tar.gz file,
* and inside would be:
*
* my-fancy-service.tar.gz
* - bin/ # managmeent scripts, as determined by @mbbx6spp
* - start
* - stop
* - my-fancy-service.jar
*/
service {
jruby {
/* Include these directories into the service jar.
*
* By default the `app` and `config` directory will
* be included as well as the `config.ru` file if it is present
*/
include 'backend', 'lib'
}
/* scripts inside of bin/ will override the defaults,
* but this closure can be used to source additional scripts
*/
scripts {
include 'examples/bin'
}
}
dependencies {
gems "rubygems:faraday:1.0"
}

Build

  • distShadowTarGz
  • distShadowZip
  • assemble

Test

  • (JRuby) spec
  • (JRuby) cucumber
  • check

Publish

  • uploadArtifacts

Internal-ish

  • prepareServiceScripts - empty by default, can be used to set up build logic to generate service scripts
  • prepareServiceJar - largely empty right now, just a standard dependency to chain builder tasks like shadowJar for jruby-gradle-jar plugin off of.

Documentation

  • docs
  • (asciidoctor) asciidoctor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment