Skip to content

Commit

Permalink
add docs for gradle jte plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-terrana-bah committed Sep 22, 2022
1 parent 1477c8a commit d06828e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/concepts/library-development/library-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ This repository can be a local directory with a `.git` directory accessible from

The Plugin Library Source is used when libraries have been bundled into a separate plugin.
This option will only be available in the Jenkins UI when a plugin has been installed that can serve as a library-providing plugin.

!!! note "Learn More"
To learn more, check out [How to Package a Library Source as a Plugin](/how-to/library-development/package-libraries-as-plugin)
29 changes: 29 additions & 0 deletions docs/how-to/library-development/package-libraries-as-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Package a Library Source as a Plugin

Users can package their Library Source as a stand-alone Jenkins Plugin.

This has a couple advantages:

1. **Performance**: Avoid fetching from a remote repository on every Pipeline Run
2. **Plugin Dependencies**: Ensure the Jenkins Plugins your libraries depend upon are installed

## Gradle JTE Plugin

To package your Library Source, the simplest path is to use the [Gradle JTE Plugin](https://github.com/jenkinsci/gradle-jte-plugin).

```groovy
plugins{
// used to packate these libraries as a jenkins plugin
id "io.jenkins.jte" version "0.2.0"
}
```

You can use the configuraiton options defined in the [README](https://github.com/jenkinsci/gradle-jte-plugin/blob/main/README.md) to configure the plugin.

To package your Library Source, run `./gradlew jte`.
The `hpi` file will be output to your projects build directory.

from there, you can install the `hpi` file via the Jenkins UI.

!!! note
To see an example Library Source, check out the [jte-library-scaffold](https://github.com/steven-terrana/jte-library-scaffold).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ nav:
- 'how-to/overview.md'
- Library Development:
- 'how-to/library-development/lifecycle-hooks-on-failure.md'
- 'how-to/library-development/package-libraries-as-plugin.md'
- Upgrade Guides:
- 'how-to/upgrade-2.0/index.md'
- Contributing:
Expand Down

0 comments on commit d06828e

Please sign in to comment.