It is used to automate the next pipeline:
src
→ .jar
→ docker image
→ artifactory → OpenShift
- run
maven package
and build spring boot app (or whatever you need) - build docker image and push it into a repository
- update docker image in the cloud (currently in OpenShift)
Actually, the plugin itself automates steps 2 and 3.
- Type:
mvn clean package -DskipTests com.github.akvone:update-image-maven-plugin:update
to make full update
- 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)
- Add Configuration
- Create Maven Run Configuration
- Command line:
-N com.github.akvone:update-image-maven-plugin:update
- Before launch:
clean package -DskipTests
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)
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.
- Install Docker (Docker desktop for Windows) and run it
- Add configuration file as described in Configuration section
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.