Rancher API Maven Plugin

This software component enables maven access to a rancher server.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

io.crowdcode.maven.plugins
ArtifactId

ArtifactId

rancher-maven-plugin
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Rancher API Maven Plugin
This software component enables maven access to a rancher server.
Project URL

Project URL

http://crowdcode.io
Project Organization

Project Organization

Crowdcode GmbH + Co.KG
Source Code Management

Source Code Management

https://github.com/crowdcode-de/rancher-maven-plugin

Download rancher-maven-plugin

How to add to project

<plugin>
    <groupId>io.crowdcode.maven.plugins</groupId>
    <artifactId>rancher-maven-plugin</artifactId>
    <version>1.2.0</version>
</plugin>

Dependencies

compile (9)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
org.springframework : spring-web jar 4.3.6.RELEASE
com.jayway.jsonpath : json-path jar 2.2.0
com.fasterxml.jackson.core : jackson-core jar 2.8.6
com.fasterxml.jackson.core : jackson-databind jar 2.8.6
org.projectlombok : lombok jar 1.16.18
org.slf4j : slf4j-api jar 1.7.16
ch.qos.logback : logback-classic jar 1.2.3
commons-logging : commons-logging jar 1.1.1

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (8)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
junit : junit jar 4.12
org.apache.maven : maven-artifact jar 3.3.9
org.apache.maven : maven-compat jar 3.3.9
org.apache.maven.plugins : maven-resources-plugin jar 3.0.2
org.apache.maven : maven-core jar 3.3.9
org.codehaus.plexus : plexus-component-annotations jar 1.5.5
org.mockito : mockito-all jar 1.9.5

Project Modules

There are no modules declared in this project.

Rancher API Maven plugin

A Maven plugin for interacting with rancher. Basing on the sources from: https://github.com/RedFroggy/rancher-maven-plugin

Goal

There is only one goal: stack-deploy which purpose is to delete and/or create a new rancher stack thanks to a docker-compose file

Usage

pom.xml file

<plugin>
    <groupId>io.crowdcode.maven.plugins</groupId>
    <artifactId>rancher-maven-plugin</artifactId>
    <version>1.1.0</version>
    <configuration>
        <dockerComposeFile>src/main/resources/docker-compose.yml</dockerComposeFile>
        <accessKey>${ACCESS_KEY}</accessKey>
        <password>${PASSWORD}</password>
        <skip>false</skip>
        <url>http://${HOST}/v2-beta</url>
        <environment>Default</environment>
        <stack>
            <dockerComposeFile>src/main/resources/docker-compose.yml</dockerComposeFile>
            <name>Stackname</name>
            <description>Stackdiscriptions</description>
            <actions>remove,wait:millis,create,verify[:timeout[:attempts]]</actions>
        </stack>
    </configuration>
</plugin>

Command line

All optons can be overidden by using line arguments:

- rancher.accessKey # rancher login
- rancher.password # rancher password
- rancher.url #rancher url (should be http://HOST)(v2-beta will be used)
- rancher.environment # environment
- rancher.skip # enable or disable plugin. Default enable
- rancher.stack.name # Name of the stack to delete/create
- rancher.stack.description # Stack description
- rancher.stack.startOnCreate
- rancher.stack.dockerComposeFile # docker-compose file
- rancher.stack.rancherComposeFile # rancher-compose file
- rancher.stack.actions # actions witch has to do (remove/create/wait:time/verify[:timeout[:attempts]])

Examples:

mvn rancher:stack-deploy -Drancher.accessKey=XXXX -Drancher.password=YYYYY -D.....

skip:

If set to true disables creating a Stack. This config option is best used together with a maven property

Tests

mvn clean test

Nice to have

  • Convert current unit tests into integration tests because it needs infrastructure (Rancher).
  • Check maven parameter provided by user.
  • More Debug-Logging.
  • Better exception handling.
  • Update stacks.
  • Update single services in a stack.
io.crowdcode.maven.plugins

CROWDCODE GmbH & Co. KG

Versions

Version
1.2.0
1.1.0