2015-03-25 16:33:29 +00:00
|
|
|
# Service Artifact Gradle Plugin
|
|
|
|
|
|
|
|
[![Build
|
2015-04-17 17:38:54 +00:00
|
|
|
Status](https://travis-ci.org/lookout/service-artifact-gradle-plugin.svg?branch=master)](https://travis-ci.org/lookout/service-artifact-gradle-plugin)
|
2015-04-19 05:06:06 +00:00
|
|
|
[ ![Download](https://api.bintray.com/packages/lookout/systems/service-artifact-plugin/images/download.svg) ](https://bintray.com/lookout/systems/service-artifact-plugin/\_latestVersion)
|
2015-03-25 15:58:45 +00:00
|
|
|
|
2015-04-17 17:38:54 +00:00
|
|
|
Gradle plugin for building a prim and proper service artifact. This
|
|
|
|
plugin is meant to codify some standards and conventions around building
|
|
|
|
service artifacts that can be easily built, tested and deployed
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
This plugin will include the appropriate versions of the following plugins:
|
|
|
|
|
|
|
|
* jruby-gradle base
|
|
|
|
* jruby-gradle jar
|
|
|
|
* asciidoctor
|
2015-03-25 15:58:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
2015-04-17 17:38:54 +00:00
|
|
|
### Example
|
|
|
|
|
|
|
|
```gradle
|
|
|
|
plugins {
|
2015-07-09 00:32:39 +00:00
|
|
|
id "com.github.lookout.service-artifact" version "0.4.0"
|
2015-04-17 17:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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})
|
|
|
|
*/
|
2015-04-19 04:46:25 +00:00
|
|
|
version = service.version('1.0')
|
2015-04-17 17:38:54 +00:00
|
|
|
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 {
|
2015-07-09 00:32:39 +00:00
|
|
|
name "amazingserv"
|
|
|
|
|
|
|
|
component("app", type: JRuby) {
|
2015-04-17 17:38:54 +00:00
|
|
|
/* Include these directories into the service jar.
|
|
|
|
*
|
2015-04-20 04:45:40 +00:00
|
|
|
* By default everything in src/main/ruby will be included
|
2015-04-17 17:38:54 +00:00
|
|
|
*/
|
|
|
|
include 'backend', 'lib'
|
2015-05-07 08:16:08 +00:00
|
|
|
mainScript 'backend/main'
|
2015-04-17 17:38:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
gems "rubygems:faraday:1.0"
|
2015-04-20 04:45:40 +00:00
|
|
|
gems "rubygems:sinatra:1.4.6"
|
2015-04-17 17:38:54 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Tasks
|
|
|
|
|
2015-04-20 04:45:40 +00:00
|
|
|
(*NOTE:* many of these tasks are not yet implemented)
|
|
|
|
|
2015-04-17 17:38:54 +00:00
|
|
|
#### Build
|
|
|
|
|
2015-07-09 00:32:39 +00:00
|
|
|
* **assemble** prepare all the service artifacts
|
2015-04-17 17:38:54 +00:00
|
|
|
|
|
|
|
#### Test
|
|
|
|
|
|
|
|
* check
|
|
|
|
|
|
|
|
#### Publish
|
|
|
|
|
2015-04-20 04:45:40 +00:00
|
|
|
* publish
|
2015-04-17 17:38:54 +00:00
|
|
|
|
|
|
|
#### Documentation
|
2015-03-25 15:58:45 +00:00
|
|
|
|
2015-04-17 17:38:54 +00:00
|
|
|
* docs
|
|
|
|
* (asciidoctor) asciidoctor
|