/thrive-service-plugin

Primary LanguageGroovyApache License 2.0Apache-2.0

thrive-service-plugin

This plugin automates a lot in scope of Thrive.

Basically, what you get is (some of those are optional, see Usage):

  • applied java-library plugin
  • configured common Maven repositories (Maven Central, JFrog snapshots and releases, Spring milestones, Jitpack)
  • applied git properties plugin
  • applied dependency management plugin
  • used Thrive BOM
  • configured Lombok dependency
  • configured thrive-common dependencies
  • applied and preconfigured (specifically for Thrive) Spring Boot plugin
  • added printVersion and addVersion tasks
  • added writeDockerfile task
  • configured Thrive internals (thrive-related build directories, writeCapabilities task)

Basically, you should be able to apply this plugin and write your business microservice, adding only the dependencies that you need (and not those that Thrive needs, as it's done for you). Once you have your business logic as a code, you should be able to deploy this service with thrive-package-plugin.

Keep in mind, that this plugin does NOT apply versioning plugin. If you're releasing your code with JitPack, I strongly recommend that you use it.

Get it

This plugin is already usable, even though there is still some work to do. Current work happens mainly in scope of package plugin, once it's done, there will be some tweaking here.

Long story short, this should already provide you with added value.

Use JitPack and declare proper buildscript dependency:

buildscript {
    repositories {
        mavenCentral()
        maven {
            name "jitpack"
            url "https://jitpack.io"
        }
        gradlePluginPortal()
    }
    dependencies {
        classpath "com.github.thrive-framework:thrive-service-plugin:0.3.0-SNAPSHOT"
    }
}

Don't forget to use Maven Central and Plugin Portal repositories - some dependencies of this project are hosted there.

Then apply it:

apply plugin: "com.github.thrive"

New-style plugin syntax may come soon. I have other priorities right now.

Usage

todo document extension layout and what does it do

You can pretty much figure it out yourself by browsing this package though.

ToDo

  • finish the implementation (duh)
    • apply package plugin
    • preconfigure it
    • add tasks for docker build (?)
    • ... ?
    • REFACTOR!!!
      • sanitize extensions (use conventions instead of setting values, use extensions' extensions instead of method accepting closures)
  • test it somehow
  • provie CircleCI config