com.github.akvone:update-image-maven-plugin

Maven plugin to automate "package-build-update docker images" iteration

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.github.akvone
ArtifactId

ArtifactId

update-image-maven-plugin
Last Version

Last Version

0.6.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

com.github.akvone:update-image-maven-plugin
Maven plugin to automate "package-build-update docker images" iteration
Project URL

Project URL

https://github.com/akvone/update-image-maven-plugin
Source Code Management

Source Code Management

https://github.com/akvone/update-image-maven-plugin/tree/master

Download update-image-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.akvone</groupId>
    <artifactId>update-image-maven-plugin</artifactId>
    <version>0.6.0</version>
</plugin>

Dependencies

compile (11)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.6.1
org.apache.maven : maven-project jar 2.2.1
org.slf4j : slf4j-api jar 1.7.30
com.github.docker-java : docker-java jar 3.2.1
com.github.docker-java : docker-java-transport-okhttp jar 3.2.1
com.sun.activation : javax.activation jar 1.2.0
org.apache.httpcomponents : httpclient jar 4.5.9
com.google.guava : guava jar 28.0-jre
org.apache.commons : commons-configuration2 jar 2.5
commons-beanutils : commons-beanutils jar 1.9.4
org.yaml : snakeyaml jar 1.24

provided (2)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0
org.projectlombok : lombok jar 1.18.12

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.30
org.junit.jupiter : junit-jupiter-engine jar 5.6.2

Project Modules

There are no modules declared in this project.

Maven Central

Update image Maven plugin

What is it used for?

It is used to automate the next pipeline:

src.jardocker image → artifactory → OpenShift

  1. run maven package and build spring boot app (or whatever you need)
  2. build docker image and push it into a repository
  3. update docker image in the cloud (currently in OpenShift)

Actually, the plugin itself automates steps 2 and 3.

How to use

With maven

What you really need:

  • Type: mvn clean package -DskipTests com.github.akvone:update-image-maven-plugin:update to make full update

May be useful also

  • Type: mvn clean compile jar:jar org.springframework.boot:spring-boot-maven-plugin:repackage com.github.akvone:update-image-maven-plugin:update to make full update (fastest command, but works only with Spring Boot projects)
  • Type: mvn com.github.akvone:update-image-maven-plugin:update to make partial update (without generating new jar)
  • Type: mvn com.github.akvone:update-image-maven-plugin:build-push to make build and push (without generating new jar)

With Intellij IDEA

  1. Add Configuration
  2. Create Maven Run Configuration
  3. Command line: -N com.github.akvone:update-image-maven-plugin:update
  4. Before launch: clean package -DskipTests

EXAMPLE

Configuration

Add required properties

  • in {project root}/../config.yaml (most preferable way)
  • or in {project root}/gitignore/config.yaml (add {project root}/gitignore to .gitignore file then)

See default config

docker:
  host: "***" # Already has defaults based on your OS
  username: "!!!"
  authorization: "!!!"
artifactory:
  url: "!!!"
  repository: "!!!"
cloudProvider:
  type: "openshift" # currently, OpenShift is supported only
  url: "***"
  namespace: "***"
  authorizationToken: "***" # get it from OpenShift (Bearer token)

Note that properties with "!!!" are required and "***" are optional.

Prerequisites

  • Install Docker (Docker desktop for Windows) and run it
  • Add configuration file as described in Configuration section

Additionally

You can additionally use tcp protocol. Use "tcp://127.0.0.1:2375" in docker.host property.

After that you must enable 'Docker without TLS' (Docker -> Settings -> General -> Expose daemon on tcp://localhost:2375 without tls) in Windows or something similar in macOS.

Versions

Version
0.6.0
0.5.3
0.5.2