forked from boozallen/jenkins-templating-engine
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1477c8a
commit d06828e
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
docs/how-to/library-development/package-libraries-as-plugin.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters