Skip to content

Commit

Permalink
Merge pull request #352 from oleg-nenashev/parent-packaging-pom
Browse files Browse the repository at this point in the history
Add experimental Plugin Packaging POM for building custom Jenkinsfile Runner distributions
  • Loading branch information
oleg-nenashev authored Aug 3, 2020
2 parents 0558286 + 0659698 commit 902ff56
Show file tree
Hide file tree
Showing 16 changed files with 480 additions and 174 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ payload/target
payload-dependencies/target
setup/target
target/
vanilla-package/target/war
vanilla-package/target/plugins
vanilla-package/target/maven-archiver
vanilla-package/target/maven-status
vanilla-package/target/jenkinsfile-runner*
vanilla-package/target/surefire-reports
vanilla-package/target/classes
vanilla-package/target/generated-sources
vanilla-package/target/generated-test-sources

# Tests
tests
Expand Down
36 changes: 9 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,25 @@ payload-dependencies/target/
payload/target/
setup/target/
tests/target/
packaging-parent-pom/target
tests/.jenkinsfile-runner-test-framework/
vanilla-package/target
cwp-cli-1.3.jar
demo/cwp/tmp/output
demo/cwp/tmp/prebuild
demo/cwp/out
demo/databound/out
demo/databound/source
demo/cwp/source
demo/cwp-jdk11/out/
demo/cwp-jdk11/source/
.idea
*.iml
.project
.settings/
app/.classpath
app/.factorypath
app/.project
app/.settings/
bootstrap/.classpath
bootstrap/.project
bootstrap/.settings/
payload-dependencies/.classpath
payload-dependencies/.factorypath
payload-dependencies/.project
payload-dependencies/.settings/
payload/.classpath
payload/.factorypath
payload/.project
payload/.settings/
setup/.classpath
setup/.factorypath
setup/.project
setup/.settings/
tests/.classpath
tests/.project
tests/.settings/
**/.classpath
**/.factorypath
**/.project
**/.settings/
tests/*.log
demo/cwp-jdk11/out/
demo/cwp-jdk11/source/
vanilla-package/.classpath
vanilla-package/.factorypath
vanilla-package/target/

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ This will generate an assembly artifact through the `appassembler-maven-plugin`

This repository includes the base image which can be built simply as...

docker build -t jenkins4eval/jenkinsfile-runner -f packaging/docker/unix/8-jdk-hotspot/Dockerfile .
docker build -t jenkins4eval/jenkinsfile-runner -f packaging/docker/unix/adoptopenjdk-8-hotspot/Dockerfile .

During development you can reuse the local machine build instead of doing a full build from scratch

docker build -t jenkins4eval/jenkinsfile-runner:dev -f packaging/docker/unix/8-jdk-hotspot/Dockerfile-dev .
docker build -t jenkins4eval/jenkinsfile-runner:dev -f packaging/docker/unix/adoptopenjdk-8-hotspot/Dockerfile-dev .

## Debugging

Expand Down
5 changes: 5 additions & 0 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
</execution>
</executions>
</plugin>
<!-- TODO(oleg_nenashev): Standalone JAR generation works by luck: https://github.com/jenkinsci/jenkinsfile-runner/issues/350
META-INF definitions are not merged correctly, and extension annotations from the core might be overridden by plugins.
Custom container description handlers are required to handle META-INF/annotations/hudson.Extension though it might be replaced by META-INF/annotations/hudson.Extension.txt.
FTR: https://maven.apache.org/plugins/maven-assembly-plugin/examples/single/using-container-descriptor-handlers.html
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down
30 changes: 30 additions & 0 deletions packaging-parent-pom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Jenkinsfile Runner Packaging POM (Experimental)
==============================================

This is an experimental parent POM for packaging custom Jenkinsfile Runner images.
It can be used for packaging of custom Jenkinsfile Runner bundles,
but at the moment it has a lot of limitations.

The framework is not ready for public use,
but you can try it out in your projects.
See the [Vanilla Package](/vanilla-package) definition to get an example.

## Known limitations

* Package produced by appassembler is **NOT** enough.
Although it packages JARs and sets up classpath correctly,
the resulting JFR bundle cannot execute Pipelines which rely on
`Jenkins.instance.getPluginManager().getPlugin(String)`,
because the plugin manager cannot discover plugins from classpath.
* Solution: provide plugins using `--plugins`.
It leads to higher image sizes, and needs to be fixed somehow.
* Uber Jar Packaging does not work reliably.
See https://github.com/jenkinsci/jenkinsfile-runner/issues/350

## Other TODOs

* Cleanup profile management (there are warnings during the build)
* Add support for Docker packaging
* Add a light testing framework for Jenkinsfile Runner bundles
* Simplify management of Groovy Hooks, JCasC configs and System Properties.
It would reduce need in Custom WAR Packager for simple use-cases.
1 change: 1 addition & 0 deletions packaging-parent-pom/parent-pom-marker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Skips the packaging steps when building plugin pom
Loading

0 comments on commit 902ff56

Please sign in to comment.