Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split build and deploy phases for Docker images #1204

Merged
merged 1 commit into from Jul 27, 2021

Conversation

dadoonet
Copy link
Owner

If we build the docker image in the deploy phase, something unexpected is happening.

The call to the deploy plugin, changes the name of the artifact when using a SNAPSHOT version.
That artifact is then used by the docker plugin and pulled from Sonatype without changing its name.
So we end up with a name like fscrawler-es7-2.7-20210726.044935-205.jar instead of the finalName which is fscrawler-es7-2.7-SNAPSHOT.jar.

The fscrawler job can not start because it calls:

exec "$JAVA" ${JAVA_OPTS} -cp "$FS_CLASSPATH" -jar "$FS_HOME/lib/${project.build.finalName}.jar" "$@"

The jar is then not found.

If we split the docker build and the docker deploy within 2 different phases, the build generates the right artifact name locally and the deploy "just" deploy what has already been generated.

This commit adds this behavior.

Closes #1201.

If we build the docker image in the deploy phase, something unexpected is happening.

The call to the deploy plugin, changes the name of the artifact when using a SNAPSHOT version.
That artifact is then used by the docker plugin and pulled from Sonatype **without** changing its name.
So we end up with a name like `fscrawler-es7-2.7-20210726.044935-205.jar` instead of the `finalName` which is `fscrawler-es7-2.7-SNAPSHOT.jar`.

The fscrawler job can not start because it calls:

```sh
exec "$JAVA" ${JAVA_OPTS} -cp "$FS_CLASSPATH" -jar "$FS_HOME/lib/${project.build.finalName}.jar" "$@"
```

The jar is then not found.

If we split the docker build and the docker deploy within 2 different phases, the build generates the right artifact name locally and the deploy "just" deploy what has already been generated.

This commit adds this behavior.

Closes #1201.
@dadoonet dadoonet added the bug For confirmed bugs label Jul 27, 2021
@dadoonet dadoonet added this to the 2.7 milestone Jul 27, 2021
@dadoonet dadoonet self-assigned this Jul 27, 2021
@dadoonet dadoonet merged commit c1975a8 into master Jul 27, 2021
@dadoonet dadoonet deleted the pr/1201-fix-docker-builds branch July 27, 2021 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For confirmed bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.7 - Docker image broken
1 participant