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

New functionality by groovy-shared library #457

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"cSpell.words": [
"accmod",
"findbugs",
"Gitter",
"Gruetzmacher",
"hamcrest",
"instanceof",
"jenkinsci",
"kohsuke",
"lockableresources",
"Servlet"
]
}
4 changes: 1 addition & 3 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ This steps need additional automation in release management. Therefore are comme
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.
- [ ] Any localizations are transferred to *.properties files.
- [ ] Changes in the interface are documented also as [examples](src/doc/examples/readme.md).
- [ ] Changes in the interface are documented also as [examples](src/doc/examples/readme.md), [groovy/examples](src/doc/examples/readme.md).
mPokornyETM marked this conversation as resolved.
Show resolved Hide resolved

### Maintainer checklist

Before the changes are marked as `ready-for-merge`:

- [ ] There is at least one (1) approval for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the **pull request title** and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically. See also [release-drafter-labels](https://github.com/jenkinsci/.github/blob/ce466227c534c42820a597cb8e9cac2f2334920a/.github/release-drafter.yml#L9-L50).
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
Expand Down
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</scm>

<properties>
<changelist>999999-SNAPSHOT</changelist>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.361.4</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<spotbugs.effort>Max</spotbugs.effort>
Expand Down Expand Up @@ -114,6 +114,16 @@
<artifactId>data-tables-api</artifactId>
</dependency>

<!-- allow Groovy shared library -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>pipeline-groovy-lib</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git</artifactId>
</dependency>

<!-- Testing scope -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
27 changes: 27 additions & 0 deletions shared-library/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

Fork this repository. Make your changes, tests it and provide a pull-request. That`s it.

## Git workflow
mPokornyETM marked this conversation as resolved.
Show resolved Hide resolved

To eliminate weird and often changes in master branch we provide long time **develop** branch.
That means all changes (feature requests, bug fixing) must be merged in to **develop** branch first
and not into **master**.
The branch **develop** will be merged in to master on demand.

```
R1 R2 Rn
--- master ----------------------------------------- ... ------------
\--- develop ---/\--- develop ---/\--- develop ---/
\-feature1-/ / /
\-feature2--/ /
\-feature3-/
```

## Setup environment

Lockable resource plugin shall setup everything you need on demand.

## Build and test

TBD
64 changes: 64 additions & 0 deletions shared-library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Jenkins lockable-resources-shared-library

Jenkins shared library to extends [lockable-resources-plugin](https://github.com/jenkinsci/lockable-resources-plugin) as a groovy code.

The goal is to extend lockable-resources-plugin functionality in simple way and provide a solution for end-user (administrators) with much more then one simple lock() step.

Many users has own solutions like create resources, or check it is isFree().
A lot of them are done in uncommon way and a lot of them make some useful magic.
This shall helps to all Jenkins administrators to interact with lockable-resources:

+ without coding own code
+ spare maintenance on own side
+ spare testing after each plugin and jenkins update
+ customizing
+ share ideas with community
+ do not copy examples from untrusted zones in to your code
+ be sure your solutions are done in proper / supported way

---

## Usage

The lockable-resources-plugin will setup on your Jenkins instace new global shared library named **lockable-resources-shared-library**.

**Default version** of branch use release-IDs. It will be automatically updated on every plugin update. That means you does not care about that in normal case.
This grants you, that the plugin and shared library works together.
Of cores you can change the branch name every time you need. For example to *master*.
In this case you will pull last commit from master. It is fine to get the changes before officially release. But it is potential risk, because shared-lib may not work with you plugin version.

Enjoy in your pipelines.
<!-- TBD: describe detailed steps, and hallo world project-->

### Customizing

Fork this repository and change what you want.

> You can share your ideas with community, when you create pull-request into this repository. This will help you to eliminate maintenance and help the community with more power.

> Keep in mind, that we can not care about your changes in forked repository. It means, when this repository became an update, you need merge changes by your self.

---

## Report an Issue

Please report issues and enhancements through the [GitHub](https://github.com/jenkinsci/lockable-resources-plugin/issues/new/choose).

If you have an example to share, please create a [new documentation issue](https://github.com/jenkinsci/lockable-resources-plugin/issues/new?assignees=&labels=documentation&template=3-documentation.yml) and provide additional examples as a [pull request](https://github.com/jenkinsci/lockable-resources-plugin/pulls) to the repository.

If you have a question, please open a [GitHub issue](https://github.com/jenkinsci/lockable-resources-plugin/issues/new/choose) with your question.

---

## Contributing

Contributions are welcome, please refer to the separate [CONTRIBUTING](../CONTRIBUTING.md) document for details on how to proceed!

Join [Gitter channel](https://gitter.im/jenkinsci/lockable-resources) to discuss your ideas with the community.

---

## License

All source code is licensed under the MIT license.
See [LICENSE](../LICENSE.txt)
4 changes: 4 additions & 0 deletions shared-library/doc/examples/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Examples

TBD
<!-- provide examples here -->
Loading