codecentric / springboot-maven3-centos

S2I builder image for building and running maven based Spring Boot applications
https://hub.docker.com/r/codecentric/springboot-maven3-centos/
Apache License 2.0
29 stars 67 forks source link

Run standalone jar or war instead of jar only #10

Closed svettwer closed 6 years ago

svettwer commented 6 years ago

Hi!

I had the issue that I had to deploy an standalone war which is nevertheless basically a spring boot app. So I used your image in my s2i process and modified it, as in this pull request, so that either a *.jar oder a *.war is started depending on the result of the maven build. I hope you find that helpful. =)

BR, Sven

svettwer commented 6 years ago

Hi!

I checkend the cause of the build failure locally.

Error: unknown flag: --force-pull
Usage:
  s2i build <source> <image> [<tag>] [flags]

Error: unknown flag: --force-pull

This seems to occur because of the s2i_args="--force-pull=false --loglevel=2" definition in /test/run.

I'll take care of this later. So it would be great if you could just keep the PR open until I had the chance to fix this.

britter commented 6 years ago

Why can't you use a standalone jar?

svettwer commented 6 years ago

Hi!

Because the application shall be deployable on various environments depending on the infrastructure. With a standalone war, we're able do deploy on a application server, as a standalone application on a plain server or within a docker container containing the fat war artifact. Now, we wanted to build and deploy it on OpenShift within a build pipeline. Therefore I modified your s2i image to be able to start the war produced by mvn.

britter commented 6 years ago

@FMAOuroboros Fine by me!

I honestly don't have time to have a look at the build errors right now. I'm not using OpenShift anymore. If you have the time it'll be great if you could have a look.

svettwer commented 6 years ago

Hi @britter!

Yeah I'll have a look at the error. I don't know exactly when I'll have the time for that but I'll fix that eventually.

BR!

britter commented 6 years ago

Thanks a lot!

svettwer commented 6 years ago

Hi @britter!

Finally I found some time to investigate the problem. As the s2i release notes of v1.1.6 show, the deprecated --force-pull flag has been removed. It was formerly replaced by --pull-policy in v1.0.4

I fixed this in the run script so that the build should pass again... At least it did locally.

britter commented 6 years ago

Awesome, thank you!

britter commented 6 years ago

@FMAOuroboros I've tagged release 1.2 with this addition for you.

svettwer commented 6 years ago

Thx a lot @britter!