An open API service indexing awesome lists of open source software.

https://github.com/saagie/saagie-maven-plugin

Plugin maven to automatically upload jar into a specified platform and create or update job
https://github.com/saagie/saagie-maven-plugin

Last synced: 5 months ago
JSON representation

Plugin maven to automatically upload jar into a specified platform and create or update job

Awesome Lists containing this project

README

          

# Saagie Maven Plugin

## :warning: This plugin is **deprecated**, no more maintained, and may contain some vulnerabilities. Provided as-is; use it at your own risk.

[![Travis CI](https://travis-ci.org/spotify/docker-maven-plugin.svg?branch=master)](https://travis-ci.org/spotify/docker-maven-plugin/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.saagie/saagie-maven-plugin/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22saagie-maven-plugin%22)

A Maven plugin to push jar files in Saagie Manager and create a new java job.

More information about Saagie : https://www.saagie.com/

* [Usage](#usage)
* [Creation](#job-creation)
* [Update](#update)
* [Authentication](#authentication)
* [Configuration](#configuration)
* [List of all parameters available](#list-of-all-available-parameters)
* [Mandatory for all modes](#mandatory-for-all-modes)
* [Mandatory for update mode only](#mandatory-for-update-mode-only)
* [Mandatory if you use authenticating directly in pom](#mandatory-if-authenticating-directly-from-pom)
* [Optional parameters](#optional-parameters)
* [Example](#example)

## Usage

### Setup
In order to use this plugin, you need to set it up in your project's Maven configuration file.
First you need to add its configuration in the `` block of your `pom.xml`.

Here is the minimum required:
```


...

io.saagie
saagie-maven-plugin
1.0.5

my-username
my-password
my-realm
1
TestMaven
extract


...

```
_Note that `login` and `password` can also be removed : see [Authentication](#authentication)._

See [Configuration](#configuration) to fine tune your configuration.

Optionally, you can force a job creation after generating your project jar file, by adding the following `execution` strategy to the plugin configuration:
```


...

io.saagie
saagie-maven-plugin
1.0.5

my-username
my-password
my-realm
1
TestMaven
extract



create
package

create




...

```

### Job creation
After setting up the plugin, you can create a job by running the following command:
```
mvn clean package saagie:create
```

### Update
You can update an existing job by running the following command:
```
mvn clean package saagie:update
```

After you added (at least) the jobId to the plugin configuration:
```


...

io.saagie
saagie-maven-plugin
1.0.5

my-username
my-password
my-realm
1
18
TestMaven
extract


...

```

_Note:_

- _The jobId is given at creation time_
- _`jobId` parameter is ignored present in "create" mode_

## Authentication

### Using settings.xml

You can put your credentials in your Maven's global `settings.xml` file as part of the `` block.
```


saagie-manager
username
your-password

```

### Using settings.xml and encrypted passwords

Credentials can be encrypted using [Maven's built in encryption function.](https://maven.apache.org/guides/mini/guide-encryption.html)
Only passwords enclosed in curly braces will be considered as encrypted.



saagie-manager
username
{4sNnX2vJXuoH6StIbCWwORqaF4nhRMOPffdmB9YHhuw=}

## Configuration

### List of all available parameters

#### Mandatory for all modes
These parameters are mandatory (in create and update mode) :

* **realm**
- represents the realm (often the company name) of Saagie's platform owner. This realm can be retrieved in the platform URL: _https://**companyName**-manager.prod.saagie.io_ - Here "**companyName**" is the realm.
* **platformId**
- represents the id of the platform you want to add the job. This id is accessible via the URL when you are authenticated and in your manager : _https://.../#/manager/**1**_ - Here "**1**" is the plaformId.
* **jobName**
- represents the name of the job you want to create or to update (should be exactly the same for update - a verification is made).
* **jobCategory**
- represents the category of the job you want to create or to update (should be exactly the same for update - a verification is made).
- can be : "**extract**" or "**processing**" (another values can produce errors).

#### Mandatory for update mode only

* **jobId**
- represents the id the job you want to update. This id is accessible via the URL when you are on the details page of the job : _https://.../#/manager/1/job/**49**_ Here "**49**" is the jobId.

#### Mandatory if authenticating directly from pom

We recommend to use the authenticating mode using the settings.xml. It's more secure and you'll be sure to never commit your login/password in your pom.xml.

* **login**
- represents the login you'll use to have access to your manager (UI and API use the same).

* **password**
- represents the password you'll use to have access to your manager (UI and API use the same).


#### Optional parameters
Setting those parameters will override default values.

* **urlAPI**
- represents the URL of your manager.
- default value : "https://realm-manager.prod.saagie.io/api/v1" where "realm" is automatically replaced by the value of the given "realm" parameter.
- If overriding this parameter, don't forget to add "**/api/v1**" at the end of the URL. In this case, the "realm" parameter will have no impact.

* **jarName**
- represents the name of the jar you want to upload
- default value : "${project.build.finalName}-jar-with-dependencies.jar"
- By default, we use the _maven-assembly-plugin_ to generate jar with dependencies (some examples are available in our [Github](https://github.com/saagie)) and the jar generated use this template. If you use the _maven-shade-plugin_ or other maven plugin, you can override this parameter to target the correct jar (```${project.build.finalName}.jar``` for the _maven-shade-plugin_ ).

* **cpu / mem / disk**
- represents the amount of CPU / memory / disk space you want to reserve for your job (like you can set in the manager interface).
- default values : **cpu**:0.5 / **mem**:512 / **disk**:1024
- For **cpu**, the value represents the number of core (0.5 represent an half of core).
- For **mem** and **disk**, the value represents the number of mega-octet allocated.

* **languageVersion**
- represents the version of language you want to run your job.
- default value : 8
- Only 8 or 7 are available (See [anapsix/alpine-java](https://hub.docker.com/r/anapsix/alpine-java/) to see the precise version of java we use).

* **arguments**
- represents the arguments in the the job command-line.
- default value : Empty-String

* **jobType**
- represents the type of job you want to create
- default value : "java-scala"
- for the moment, only "java-scala" works

* **releaseNote**
- represents the release note of the job version.
- default value : Empty-String

* **description**
- represents the job description.
- default value : Empty-String

#### Example
A fully customized configuration may look like this:
```


...

io.saagie
saagie-maven-plugin
1.0.5

my-username
my-password
my-realm
1
My Java job
processing
https://realm-manager.prod.saagie.io/api/v1
0.4
256
1024
${project.build.finalName}.jar
1234
Adding new feature
My Java job goal
arg1
8.131



create
package

create




...

```