├── .editorconfig ├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── cd.yaml │ ├── crowdin.yml │ └── jenkins-security-scan.yml ├── .gitignore ├── .gitpod.yml ├── .mvn ├── extensions.xml └── maven.config ├── CHANGELOG.old.md ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE.txt ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── crowdin.yml ├── pom.xml └── src ├── doc └── examples │ ├── lock-nodes.md │ ├── locking-multiple-stages-in-declarative-pipeline.md │ ├── locking-random-free-resource.md │ ├── readme.md │ └── scripted-vs-declarative-pipeline.md ├── main ├── java │ └── org │ │ └── jenkins │ │ └── plugins │ │ └── lockableresources │ │ ├── BackwardCompatibility.java │ │ ├── ExcludeFromJacocoGeneratedReport.java │ │ ├── FreeDeadJobs.java │ │ ├── LockStep.java │ │ ├── LockStepExecution.java │ │ ├── LockStepResource.java │ │ ├── LockableResource.java │ │ ├── LockableResourceProperty.java │ │ ├── LockableResources.java │ │ ├── LockableResourcesManager.java │ │ ├── RequiredResourcesProperty.java │ │ ├── ResourceSelectStrategy.java │ │ ├── actions │ │ ├── LockableResourcesRootAction.java │ │ ├── LockedResourcesBuildAction.java │ │ └── ResourceVariableNameAction.java │ │ ├── nodes │ │ └── NodesMirror.java │ │ ├── queue │ │ ├── LockRunListener.java │ │ ├── LockableResourcesQueueTaskDispatcher.java │ │ ├── LockableResourcesStruct.java │ │ ├── QueuedContextStruct.java │ │ └── Utils.java │ │ └── util │ │ ├── Constants.java │ │ └── SerializableSecureGroovyScript.java ├── resources │ ├── index.jelly │ └── org │ │ └── jenkins │ │ └── plugins │ │ └── lockableresources │ │ ├── LockStep │ │ ├── config.jelly │ │ ├── config.properties │ │ ├── config_cs.properties │ │ ├── config_de.properties │ │ ├── config_fr.properties │ │ ├── config_sk.properties │ │ ├── help-inversePrecedence.html │ │ ├── help-label.html │ │ ├── help-priority.html │ │ ├── help-quantity.html │ │ ├── help-resource.html │ │ ├── help-resourceSelectStrategy.html │ │ ├── help-skipIfLocked.html │ │ └── help-variable.html │ │ ├── LockStepResource │ │ ├── config.jelly │ │ ├── config.properties │ │ ├── config_cs.properties │ │ ├── config_de.properties │ │ ├── config_fr.properties │ │ ├── config_sk.properties │ │ ├── help-label.html │ │ ├── help-quantity.html │ │ └── help-resource.html │ │ ├── LockableResource │ │ ├── config.jelly │ │ ├── config.properties │ │ ├── config_cs.properties │ │ ├── config_de.properties │ │ ├── config_fr.properties │ │ └── config_sk.properties │ │ ├── LockableResourceProperty │ │ ├── config.jelly │ │ ├── config.properties │ │ └── config_fr.properties │ │ ├── LockableResourcesManager │ │ ├── config.jelly │ │ ├── config.properties │ │ ├── config_cs.properties │ │ ├── config_de.properties │ │ ├── config_fr.properties │ │ └── config_sk.properties │ │ ├── Messages.properties │ │ ├── Messages_cs.properties │ │ ├── Messages_de.properties │ │ ├── Messages_fr.properties │ │ ├── Messages_sk.properties │ │ ├── RequiredResourcesProperty │ │ ├── config.jelly │ │ ├── config.properties │ │ ├── config_cs.properties │ │ ├── config_de.properties │ │ ├── config_fr.properties │ │ ├── config_sk.properties │ │ ├── help-labelName.html │ │ ├── help-resourceMatchScript.html │ │ ├── help-resourceNames.html │ │ ├── help-resourceNamesVar.html │ │ └── help-resourceNumber.html │ │ └── actions │ │ ├── LockableResourcesRootAction │ │ ├── _api.jelly │ │ ├── index.jelly │ │ ├── index.properties │ │ ├── index_cs.properties │ │ ├── index_de.properties │ │ ├── index_fr.properties │ │ ├── index_sk.properties │ │ ├── noteForm.jelly │ │ ├── tableLabels │ │ │ ├── table.jelly │ │ │ ├── table.properties │ │ │ ├── table_cs.properties │ │ │ ├── table_de.properties │ │ │ ├── table_fr.properties │ │ │ └── table_sk.properties │ │ ├── tableQueue │ │ │ ├── queue-too-long.js │ │ │ ├── table.jelly │ │ │ └── table.properties │ │ └── tableResources │ │ │ ├── table.jelly │ │ │ ├── table.properties │ │ │ ├── table_cs.properties │ │ │ ├── table_de.properties │ │ │ ├── table_fr.properties │ │ │ └── table_sk.properties │ │ └── LockedResourcesBuildAction │ │ ├── index.jelly │ │ ├── index.properties │ │ ├── index_cs.properties │ │ ├── index_de.properties │ │ ├── index_fr.properties │ │ └── index_sk.properties └── webapp │ ├── css │ └── style.css │ └── js │ └── lockable-resources.js └── test ├── java └── org │ └── jenkins │ └── plugins │ └── lockableresources │ ├── ConcurrentModificationExceptionTest.java │ ├── ConfigurationAsCodeTest.java │ ├── DeclarativePipelineTest.java │ ├── FreeStyleProjectTest.java │ ├── InteroperabilityTest.java │ ├── LockStepHardKillTest.java │ ├── LockStepTest.java │ ├── LockStepTestBase.java │ ├── LockStepTest_manualUnreserveUnblocksJob.java │ ├── LockStepTest_reserveInsideLockHonoured.java │ ├── LockStepTest_setReservedByInsideLockHonoured.java │ ├── LockStepWithRestartTest.java │ ├── LockableResourceApiTest.java │ ├── LockableResourceManagerTest.java │ ├── LockableResourceRootActionSEC1361Test.java │ ├── LockableResourceTest.java │ ├── NodesMirrorTest.java │ ├── PressureTest.java │ ├── TestHelpers.java │ ├── actions │ └── LockableResourcesRootActionTest.java │ └── util │ └── SerializableSecureGroovyScriptTest.java └── resources ├── org └── jenkins │ └── plugins │ └── lockableresources │ ├── casc_expected_output.yml │ └── configuration-as-code.yml └── plugins └── jobConfigHistory.hpi /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | 9 | [*.{html,java,jelly,xml}] 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @jenkinsci/lockable-resources-plugin-developers 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "maven" 6 | directory: "/" 7 | schedule: 8 | interval: "weekly" 9 | - package-ecosystem: "github-actions" 10 | directory: "/" 11 | schedule: 12 | interval: "weekly" 13 | -------------------------------------------------------------------------------- /.github/workflows/cd.yaml: -------------------------------------------------------------------------------- 1 | # Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins 2 | 3 | name: cd 4 | on: 5 | workflow_dispatch: 6 | check_run: 7 | types: 8 | - completed 9 | 10 | jobs: 11 | maven-cd: 12 | uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 13 | secrets: 14 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 15 | MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} 16 | -------------------------------------------------------------------------------- /.github/workflows/crowdin.yml: -------------------------------------------------------------------------------- 1 | # This workflow requires additional setup, see: https://jenkins.io/doc/developer/crowdin/ 2 | 3 | name: Crowdin 4 | 5 | on: 6 | schedule: 7 | - cron: '0 */24 * * *' 8 | workflow_dispatch: 9 | 10 | permissions: 11 | actions: write 12 | contents: write 13 | pull-requests: write 14 | 15 | jobs: 16 | synchronize-with-crowdin: 17 | runs-on: ubuntu-latest 18 | if: github.repository_owner == 'jenkinsci' 19 | 20 | steps: 21 | 22 | - name: Checkout 23 | uses: actions/checkout@v4 24 | 25 | - name: crowdin action 26 | uses: crowdin/github-action@v2.7.0 27 | with: 28 | upload_translations: false 29 | download_translations: true 30 | skip_untranslated_files: true 31 | push_translations: true 32 | export_only_approved: true 33 | commit_message: 'New Crowdin translations' 34 | create_pull_request: true 35 | pull_request_title: 'Update localization' 36 | pull_request_labels: 'localization' 37 | base_url: 'https://jenkins.crowdin.com' 38 | config: 'crowdin.yml' 39 | env: 40 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 41 | CROWDIN_PROJECT_ID: 26 42 | CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} 43 | -------------------------------------------------------------------------------- /.github/workflows/jenkins-security-scan.yml: -------------------------------------------------------------------------------- 1 | # Jenkins Security Scan 2 | # For more information, see: https://www.jenkins.io/doc/developer/security/scan/ 3 | 4 | name: Jenkins Security Scan 5 | 6 | on: 7 | push: 8 | branches: 9 | - master 10 | pull_request: 11 | types: [opened, synchronize, reopened] 12 | workflow_dispatch: 13 | 14 | permissions: 15 | security-events: write 16 | contents: read 17 | actions: read 18 | 19 | jobs: 20 | security-scan: 21 | uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2 22 | with: 23 | java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate. 24 | # java-version: 21 # Optionally specify what version of Java to set up for the build, or remove to use a recent default. 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .DS_Store 3 | /.idea/ 4 | /target/ 5 | /work/ 6 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - init: mvn clean verify 3 | 4 | vscode: 5 | extensions: 6 | - bierner.markdown-preview-github-styles 7 | - vscjava.vscode-java-pack 8 | - redhat.java 9 | - vscjava.vscode-java-debug 10 | - vscjava.vscode-java-dependency 11 | - vscjava.vscode-java-test 12 | - vscjava.vscode-maven 13 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.jenkins.tools.incrementals 4 | git-changelist-maven-extension 5 | 1.8 6 | 7 | 8 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Pconsume-incrementals 2 | -Pmight-produce-incrementals 3 | -Dchangelist.format=%d.v%s 4 | -------------------------------------------------------------------------------- /CHANGELOG.old.md: -------------------------------------------------------------------------------- 1 | # Old Changelog 2 | 3 | This is the old changelog, see 4 | [GitHub Releases](https://github.com/jenkinsci/lockable-resources-plugin/releases) 5 | for recent versions. 6 | 7 | ## Release 2.5 (2019-03-25) 8 | 9 | - [Fix security issue](https://jenkins.io/security/advisory/2019-03-25/) 10 | 11 | ## Release 2.4 (2019-01-18) 12 | 13 | - [JENKINS-46555](https://issues.jenkins-ci.org/browse/JENKINS-46555) - Fix NPE 14 | on invalid entries. 15 | 16 | ## Release 2.3 (2018-06-26) 17 | 18 | - [JENKINS-34433](https://issues.jenkins-ci.org/browse/JENKINS-34433) - Signal 19 | queued Pipeline tasks on unreserve 20 | 21 | - Allow locking multiple resources in Pipeline 22 | 23 | ## Release 2.2 (2018-03-06) 24 | 25 | - [JENKINS-40997](https://issues.jenkins-ci.org/browse/JENKINS-40997) - New 26 | configuration option to get the name of the locked resource inside the lock 27 | block (Pipeline). 28 | 29 | - [JENKINS-49734](https://issues.jenkins-ci.org/browse/JENKINS-49734) - 30 | Add a PauseAction to the build when waiting for locking, so Pipeline 31 | representations in the UI are correctly shown. 32 | - [JENKINS-43574](https://issues.jenkins-ci.org/browse/JENKINS-43574) - Fixed 33 | the "empty" resources lock (message: "acquired lock on \[\]") 34 | 35 | ## Release 2.1 (2017-11-13) 36 | 37 | - [JENKINS-47235](https://issues.jenkins-ci.org/browse/JENKINS-47235) - 38 | Trim whitespace from resource names. 39 | - [JENKINS-47754](https://issues.jenkins-ci.org/browse/JENKINS-47754) - 40 | Fix broken Freestyle behavior. 41 | 42 | ## Release 1.11.2 (2017-03-15) 43 | 44 | - [JENKINS-40368](https://issues.jenkins-ci.org/browse/JENKINS-40368) - Locked 45 | resources are not always freed up on Pipeline hard kill when there 46 | are other pipelines waiting on the Resource 47 | 48 | ## Release 1.11.1 (2017-02-20) 49 | 50 | - [JENKINS-40879](https://issues.jenkins-ci.org/browse/JENKINS-40879) - Locked 51 | areas are executed multiple times in parallel 52 | 53 | ## Release 1.11 (2016-12-19) 54 | 55 | - [JENKINS-34268](https://issues.jenkins-ci.org/browse/JENKINS-34268) - 56 | lock multiple resources concurrently 57 | - [JENKINS-34273](https://issues.jenkins-ci.org/browse/JENKINS-34273) - 58 | add the number of resources to lock from a given label 59 | 60 | ## Release 1.10 (2016-07-12) 61 | 62 | - [JENKINS-36479](https://issues.jenkins-ci.org/browse/JENKINS-36479) - 63 | properly clean up resources locked by hard-killed or deleted while 64 | in progress Pipeline builds. 65 | 66 | ## Release 1.9 (2016-06-01) 67 | 68 | - Reserved resources parameter visibility in environment (related to 69 | SECURITY-170) 70 | 71 | ## Release 1.8 (2016-04-14) 72 | 73 | - Pipeline compatibility: lock step 74 | 75 | ## Release 1.2 (2014-02-05) 76 | 77 | - Manual reservation/un-reservation of resources now require specific 78 | permissions 79 | 80 | ## Release 1.1 (2014-02-03) 81 | 82 | - Allow jobs to require a subset of specified resources (the number of required 83 | resources is configurable) 84 | - Allow manual reservation/un-reservation of resources 85 | 86 | ## Release 1.0 (2013-12-12) 87 | 88 | - Initial release 89 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing 3 | 4 | If you want to contribute to this plugin, you probably will need a Jenkins plugin development 5 | environment. This basically means a current version of Java (Java 11 should probably be okay for now) 6 | and [Apache Maven]. See the [Jenkins Plugin Tutorial] for details. 7 | You could also go the [GitPod](https://gitpod.io/#https://github.com/jenkinsci/lockable-resources-plugin) way. 8 | 9 | If you have the proper environment, typing: 10 | 11 | ```sh 12 | mvn verify 13 | ``` 14 | 15 | should create a plugin as `target/*.hpi`, which you can install in your Jenkins instance. Running 16 | 17 | ```sh 18 | mvn hpi:run 19 | ``` 20 | 21 | allows you to spin up a test Jenkins instance on [localhost] to test your 22 | local changes before committing. 23 | 24 | [Apache Maven]: https://maven.apache.org/ 25 | [Jenkins Plugin Tutorial]: https://jenkins.io/doc/developer/tutorial/prepare/ 26 | [localhost]: http://localhost:8080/jenkins/ 27 | 28 | ## Code Style 29 | 30 | This plugin tries to migrate to [Google Java Code Style], please try to adhere to that style 31 | whenever adding new files or making big changes to existing files. If your IDE doesn't support 32 | this style, you can use the [fmt-maven-plugin], like this: 33 | 34 | ```sh 35 | mvn fmt:format -DfilesNamePattern=ChangedFile\.java 36 | ``` 37 | 38 | to reformat Java code in the proper style. 39 | 40 | [Google Java Code Style]: https://google.github.io/styleguide/javaguide.html 41 | [fmt-maven-plugin]: https://github.com/coveo/fmt-maven-plugin 42 | 43 | ## Code coverage 44 | 45 | Test coverage is a percentage measure of the degree to which the source code of a program is executed when a test is run. A program with high test coverage has more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low test coverage. The best way to improve code coverage is writing of automated tests. 46 | 47 | To get local line-by-line coverage report execute this command 48 | 49 | ```sh 50 | mvn -P enable-jacoco clean verify jacoco:report 51 | ``` 52 | 53 | The report is then located in *target/site/jacoco/index.html*. 54 | 55 | ## License 56 | 57 | The MIT License (MIT) 58 | 59 | - Copyright 2013-2015 6WIND 60 | - Copyright 2016-2018 Antonio Muñiz 61 | - Copyright 2019 TobiX 62 | - Copyright 2017-2022 Jim Klimov 63 | 64 | See [LICENSE](LICENSE.txt) 65 | 66 | ## Localization 67 | 68 | [![Crowdin](https://badges.crowdin.net/e/656dcffac5a09ad0fbdedcb430af1904/localized.svg)](https://jenkins.crowdin.com/lockable-resources-plugin) 69 | 70 | Internationalization documentation for Jelly, Java and Groovy can be found [here](https://www.jenkins.io/doc/developer/internationalization/). 71 | 72 | To translate this plugin we recommend to use [Crowdin](https://jenkins.crowdin.com/lockable-resources-plugin). 73 | 74 | Read on [how to use the crowdin web interface](https://www.jenkins.io/doc/developer/crowdin/) to translate plugins. 75 | 76 | When you want to help us, please create a new [feature request](https://github.com/jenkinsci/lockable-resources-plugin/issues/new?assignees=&labels=enhancement&template=2-feature-request.yml) with following content 77 | 78 | Title: 79 | l10n: \ 80 | Description 81 | I would provide new (or update) translations for \ 82 | 83 | We will then add you to the Crowdin project. 84 | 85 | For short translations / updates we can also send you invitation (time limited) 86 | 87 | **Privacy policy notice** 88 | When you start translating via Crowdin service, your browsers will send cookies to Crowdin so that Crowdin can identify translators contributing to the project. You might need to update the privacy policy to reflect this aspect of cookies usage. 89 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | /* 2 | See the documentation for more options: 3 | https://github.com/jenkins-infra/pipeline-library/ 4 | */ 5 | buildPlugin( 6 | forkCount: '1C', // Run parallel tests on ci.jenkins.io for lower costs, faster feedback 7 | useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests 8 | configurations: [ 9 | [platform: 'linux', jdk: 21], 10 | [platform: 'windows', jdk: 17], 11 | ]) 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2013-2015, 6WIND S.A. All rights reserved. 4 | Copyright 2016-2018, Antonio Muñiz 5 | Copyright 2019, TobiX 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | See [JENKINS-XXXXX](https://issues.jenkins.io/browse/JENKINS-XXXXX). 7 | 8 | See #XXXXX 9 | 10 | 11 | 18 | 19 | ### Testing done 20 | 21 | 30 | 31 | ### Proposed upgrade guidelines 32 | 33 | N/A 34 | 35 | ### Localizations 36 | 37 | 45 | 46 | - [ ] English 47 | - [ ] German 48 | - [ ] French 49 | - [ ] Slovak 50 | - [ ] Czech 51 | - [ ] ... 52 | 53 | ### Submitter checklist 54 | 55 | - [ ] The Jira / Github issue, if it exists, is well-described. 56 | - [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/main/content/_data/changelogs/weekly.yml)). 57 | - The changelog generator for plugins uses the **pull request title as the changelog entry**. 58 | - Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during the upgrade. 59 | - [ ] There is automated testing or an explanation that explains why this change has no tests. 60 | - [ ] New public functions for internal use only are annotated with `@NoExternalUse`. In case it is used by non java code the `Used by {@code .jelly}` Javadocs are annotated. 61 | 66 | - [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease the future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)). 67 | - [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials. 68 | - [ ] For new APIs and extension points, there is a link to at least one consumer. 69 | - [ ] Any localizations are transferred to *.properties files. 70 | - [ ] Changes in the interface are documented also as [examples](src/doc/examples/readme.md). 71 | 72 | ### Maintainer checklist 73 | 74 | Before the changes are marked as `ready-for-merge`: 75 | 76 | - [ ] There is at least one (1) approval for the pull request and no outstanding requests for change. 77 | - [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change. 78 | - [ ] Changelog entries in the **pull request title** and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood. 79 | - [ ] 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). 80 | - [ ] 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)). 81 | - [ ] java code changes are tested by automated test. 82 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | project_id_env: CROWDIN_PROJECT_ID 2 | api_token_env: CROWDIN_PERSONAL_TOKEN 3 | files: 4 | - source: /src/main/resources/org/jenkins/plugins/lockableresources/**/*.properties 5 | ignore_settings: 1 6 | ignore: 7 | - /src/main/resources/org/jenkins/plugins/lockableresources/**/%file_name%_%two_letters_code%.properties 8 | translation: /src/main/resources/org/jenkins/plugins/lockableresources/**/%file_name%_%two_letters_code%.properties 9 | -------------------------------------------------------------------------------- /src/doc/examples/lock-nodes.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | ## Node dependent resources 4 | 5 | Locking a resource that depends on a specific node can be very helpful in many cases. 6 | That means a job must pick a target node that has the requested resource available. 7 | 8 | ```groovy 9 | // allocate node 10 | node('some-build-node') { 11 | // Lock resource named *whatever-resource-some-build-node* 12 | lock("whatever-resource-${env.NODE_NAME}") { 13 | echo "Running on node ${env.NODE_NAME} with locked resource ${env.LOCKED_RESOURCE}" 14 | } 15 | } 16 | ``` 17 | 18 | But much more useful is lock node first. 19 | 20 | ```groovy 21 | // Lock resource named *some-build-node* 22 | lock('some-build-node') { 23 | // allocate node 24 | node(env.LOCKED_RESOURCE) { 25 | 26 | echo "I am on node ${env.NODE_NAME} and locked resource ${env.LOCKED_RESOURCE}" 27 | } 28 | } 29 | ``` 30 | 31 | Let explain in more complex use case. 32 | 33 | *Request:* 34 | Our job tests server-client integration. That means we need 2 nodes (1 server and 1 client). 35 | On every node must be test sources up-to-date. 36 | Tests are running only on client side. 37 | 38 | *Solution:* 39 | Create 2 nodes: 40 | 41 | - node-server 42 | - node-client 43 | 44 | and execute it parallel like this: 45 | 46 | ```groovy 47 | Map stages = [:]; 48 | stages['server'] = { 49 | node('node-server') { 50 | prepareTests() 51 | startServer() 52 | } 53 | } 54 | stages['client'] = { 55 | node('node-client') { 56 | prepareTests() 57 | startClientTest() 58 | } 59 | } 60 | // execute all prepare stages synchronous 61 | parallel stages 62 | 63 | // Prepare tests on node 64 | void prepareTests() { 65 | checkout([$class: 'GitSCM', 66 | branches: [[name: 'master']] 67 | ]) 68 | } 69 | // Start server 70 | void startServer() { 71 | echo 'Server will be started in few seconds' 72 | sh 'mvn clean hpi:run' 73 | echo 'Server is done' 74 | } 75 | // Start client 76 | void startClientTest() { 77 | sleep 20 78 | sh 'mvn clean verify' 79 | } 80 | ``` 81 | 82 | It looks pretty fine and easy, but !!!. 83 | 84 | Executing all steps parallel might leads to timing issues, because checkout on server-node might takes much longer then on client-node. This is serious issue because the client starts before the server and can not connect to server. 85 | 86 | The solution is to synchronized parallel stages like this. 87 | 88 | ```groovy 89 | Map prepareStages = [:]; 90 | prepareStages['server'] = { 91 | node('node-server') { 92 | prepareTests() 93 | } 94 | } 95 | prepareStages['client'] = { 96 | node('node-client') { 97 | startServer() 98 | } 99 | } 100 | // execute all prepare stages synchronous 101 | parallel prepareStages 102 | 103 | Map testStages = [:] 104 | testStages['server'] = { 105 | node('node-server') { 106 | prepareTests(); 107 | } 108 | } 109 | testStages['client'] = { 110 | node('node-client') { 111 | sleep 20 112 | startClientTest(); 113 | } 114 | } 115 | 116 | // execute all test stages at the same time 117 | testStages.failFast = true 118 | parallel testStages 119 | 120 | ... 121 | ``` 122 | 123 | Ok we solve the timing issue, but what is wrong here? 124 | 125 | When the step *parallel prepareStages* is done then are on both nodes executors free. At this moment 126 | it might happen, that some other job allocate one of the nodes. This will leads to more side effects, like: 127 | 128 | - no body can grant, that currently checked out workspace will be untouched 129 | - no body can grant how long will be the node allocated 130 | - ... and many others 131 | 132 | Instead, we lock both nodes with a single call to `lock`. 133 | 134 | Create two resources: 135 | name | Labels | 136 | ---------------|--------| 137 | nodes-server-1 | server-node | 138 | nodes-client-1 | client-node | 139 | 140 | 141 | ```groovy 142 | lock(variable: 'locked_resources', 143 | extra: [ 144 | [label: 'server-node', quantity: 1], 145 | [label: 'client-node', quantity: 1] 146 | ) { 147 | final String serverNodeName = env.LOCKED_RESOURCE0; 148 | final String clientNodeName = env.LOCKED_RESOURCE1; 149 | Map prepareStages = [:]; 150 | prepareStages['server'] = { 151 | node(serverNodeName) { 152 | prepareTests() 153 | } 154 | } 155 | prepareStages['client'] = { 156 | node(clientNodeName) { 157 | startServer() 158 | } 159 | } 160 | // execute all prepare stages synchronous 161 | parallel prepareStages 162 | 163 | Map testStages = [:] 164 | testStages['server'] = { 165 | node(serverNodeName) { 166 | prepareTests(); 167 | } 168 | } 169 | testStages['client'] = { 170 | node(clientNodeName) { 171 | sleep 20 172 | startClientTest(); 173 | } 174 | } 175 | 176 | // execute all test stages at the same time 177 | testStages.failFast = true 178 | parallel testStages 179 | 180 | } 181 | 182 | ... 183 | ``` 184 | 185 | Keep in mind, that `lock()` only helps when locks are consistently requested for resources. 186 | -------------------------------------------------------------------------------- /src/doc/examples/locking-multiple-stages-in-declarative-pipeline.md: -------------------------------------------------------------------------------- 1 | # Locking multiple stages in declarative pipeline 2 | 3 | You can lock the entire job in the options block of the pipeline: 4 | 5 | 6 | ```groovy 7 | pipeline { 8 | options { 9 | lock 'lockable-resource' 10 | } 11 | 12 | agent any 13 | 14 | stages { 15 | stage('Build') { 16 | steps { 17 | sh 'make' 18 | } 19 | } 20 | stage('Test'){ 21 | steps { 22 | sh 'make check' 23 | junit 'reports/**/*.xml' 24 | } 25 | } 26 | stage('Deploy') { 27 | steps { 28 | sh 'make publish' 29 | } 30 | } 31 | } 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /src/doc/examples/locking-random-free-resource.md: -------------------------------------------------------------------------------- 1 | ## Locking a random free resource 2 | 3 | In same cases, you want a random resource to be locked instead of always choosing the first one. For example, 4 | if resources like accounts could get rate limited if they are used too often by your pipelines. 5 | 6 | With the following resources created: 7 | 8 | | Name | Label | 9 | |-----------|---------| 10 | | account_1 | account | 11 | | account_2 | account | 12 | 13 | You can pick a single random available resource like in the following declarative pipeline: 14 | 15 | ```groovy 16 | pipeline { 17 | agent any 18 | stages { 19 | stage("Build") { 20 | steps { 21 | lock(label: "account", resourceSelectStrategy: 'random', resource: null, quantity: 1, variable: "account") { 22 | echo "Using account " + env.account 23 | // do your thing using the resource 24 | } 25 | } 26 | } 27 | } 28 | } 29 | ``` 30 | 31 | The `quantity` can be changed to lock any amount of available resources with the given label. Not specifying the 32 | quantity will lock all resources, but still randomize the order of resources in the numbered environment variable. 33 | 34 | Not specifying `resourceSelectStrategy`, will fall back to the default behaviour of locking resources according to 35 | their order in the lockable resources list. You can also explicitly configure the default strategy 36 | with `resourceSelectStrategy: 'sequential'`. 37 | -------------------------------------------------------------------------------- /src/doc/examples/readme.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Examples of lockable resources include: 4 | 5 | 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. 6 | If you have a question, please open a [GitHub issue](https://github.com/jenkinsci/lockable-resources-plugin/issues/new/choose) with your question. 7 | 8 | - [Node depended resources](lock-nodes.md) 9 | - [Locking multiple stages in declarative pipeline](locking-multiple-stages-in-declarative-pipeline.md) 10 | - [Locking a random free resource](locking-random-free-resource.md) 11 | - [Scripted vs declarative pipeline](scripted-vs-declarative-pipeline.md) 12 | -------------------------------------------------------------------------------- /src/doc/examples/scripted-vs-declarative-pipeline.md: -------------------------------------------------------------------------------- 1 | # Scripted vs declarative pipeline 2 | 3 | Due an historical reason is not possible to use exact same syntax in the declarative and scripted pipeline. 4 | In declarative pipeline you must so far set **resource : null**. 5 | 6 | ## Declarative 7 | 8 | ``` groovy 9 | pipeline { 10 | agent any 11 | 12 | stages { 13 | stage("Build") { 14 | steps { 15 | lock(label: 'printer', quantity: 1, resource : null) { 16 | echo 'printer locked' 17 | } 18 | } 19 | } 20 | } 21 | } 22 | ``` 23 | 24 | ## Scripted 25 | 26 | ``` groovy 27 | node() { 28 | stage("Build") { 29 | lock(label: 'printer', quantity: 1) { 30 | echo 'printer locked' 31 | } 32 | } 33 | } 34 | ``` 35 | 36 | ## Pitfalls 37 | 38 | Setting `quantity` to `null`, `0` or a smaller number, all available resources of that label are locked at once. 39 | See [#198 - Lock All resources by setting quantity to 0 is not documented](https://github.com/jenkinsci/lockable-resources-plugin/issues/198). 40 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/BackwardCompatibility.java: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | * Copyright (c) 2016, Florian Hug. All rights reserved. * 3 | * * 4 | * This file is part of the Jenkins Lockable Resources Plugin and is * 5 | * published under the MIT license. * 6 | * * 7 | * See the "LICENSE.txt" file for more information. * 8 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 9 | 10 | package org.jenkins.plugins.lockableresources; 11 | 12 | import hudson.init.InitMilestone; 13 | import hudson.init.Initializer; 14 | import java.util.ArrayList; 15 | import java.util.Collections; 16 | import java.util.List; 17 | import java.util.logging.Level; 18 | import java.util.logging.Logger; 19 | import org.jenkins.plugins.lockableresources.queue.LockableResourcesStruct; 20 | import org.jenkinsci.plugins.workflow.steps.StepContext; 21 | 22 | /** 23 | * This class migrates "active" queuedContexts from LockableResource to LockableResourcesManager 24 | * 25 | * @deprecated Migration code for field introduced in 1.8 (since 1.11) 26 | */ 27 | @Deprecated 28 | @ExcludeFromJacocoGeneratedReport 29 | public final class BackwardCompatibility { 30 | private static final Logger LOG = Logger.getLogger(BackwardCompatibility.class.getName()); 31 | 32 | private BackwardCompatibility() {} 33 | 34 | @Initializer(after = InitMilestone.JOB_LOADED) 35 | public static void compatibilityMigration() { 36 | LockableResourcesManager lrm = LockableResourcesManager.get(); 37 | synchronized (lrm.syncResources) { 38 | List resources = lrm.getResources(); 39 | LOG.log( 40 | Level.FINE, 41 | "lockable-resources-plugin compatibility migration task run for " + resources.size() 42 | + " resources"); 43 | for (LockableResource resource : resources) { 44 | List queuedContexts = resource.getQueuedContexts(); 45 | if (!queuedContexts.isEmpty()) { 46 | for (StepContext queuedContext : queuedContexts) { 47 | List resourcesNames = new ArrayList<>(); 48 | resourcesNames.add(resource.getName()); 49 | LockableResourcesStruct resourceHolder = new LockableResourcesStruct(resourcesNames, "", 0); 50 | LockableResourcesManager.get() 51 | .queueContext( 52 | queuedContext, 53 | Collections.singletonList(resourceHolder), 54 | resource.getName(), 55 | null, 56 | false, 57 | 0); 58 | } 59 | queuedContexts.clear(); 60 | } 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/ExcludeFromJacocoGeneratedReport.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target({ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR}) 10 | public @interface ExcludeFromJacocoGeneratedReport {} 11 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/FreeDeadJobs.java: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | * Copyright (c) 2016, Florian Hug. All rights reserved. * 3 | * * 4 | * This file is part of the Jenkins Lockable Resources Plugin and is * 5 | * published under the MIT license. * 6 | * * 7 | * See the "LICENSE.txt" file for more information. * 8 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 9 | 10 | package org.jenkins.plugins.lockableresources; 11 | 12 | import hudson.init.InitMilestone; 13 | import hudson.init.Initializer; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | import java.util.logging.Level; 17 | import java.util.logging.Logger; 18 | 19 | /** 20 | * Sometimes after re-starts (jenkins crashed or what ever) are resources still locked by build, but 21 | * the build is no more running. This script will 'unlock' all resource assigned to dead builds 22 | */ 23 | @ExcludeFromJacocoGeneratedReport 24 | public final class FreeDeadJobs { 25 | private static final Logger LOG = Logger.getLogger(FreeDeadJobs.class.getName()); 26 | 27 | private FreeDeadJobs() {} 28 | 29 | @Initializer(after = InitMilestone.JOB_LOADED) 30 | public static void freePostMortemResources() { 31 | 32 | LockableResourcesManager lrm = LockableResourcesManager.get(); 33 | synchronized (lrm.syncResources) { 34 | List orphan = new ArrayList<>(); 35 | LOG.log(Level.FINE, "lockable-resources-plugin free post mortem task run"); 36 | for (LockableResource resource : lrm.getResources()) { 37 | if (resource.getBuild() != null && !resource.getBuild().isInProgress()) { 38 | orphan.add(resource); 39 | } 40 | } 41 | 42 | for (LockableResource resource : orphan) { 43 | LOG.log( 44 | Level.INFO, 45 | "lockable-resources-plugin reset resource " 46 | + resource.getName() 47 | + " due post mortem job: " 48 | + resource.getBuildName()); 49 | resource.recycle(); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/LockableResourceProperty.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources; 2 | 3 | import edu.umd.cs.findbugs.annotations.NonNull; 4 | import hudson.Extension; 5 | import hudson.model.AbstractDescribableImpl; 6 | import hudson.model.Descriptor; 7 | import java.io.Serializable; 8 | import org.kohsuke.stapler.DataBoundConstructor; 9 | import org.kohsuke.stapler.DataBoundSetter; 10 | import org.kohsuke.stapler.export.Exported; 11 | import org.kohsuke.stapler.export.ExportedBean; 12 | 13 | @ExportedBean(defaultVisibility = 999) 14 | public class LockableResourceProperty extends AbstractDescribableImpl 15 | implements Serializable { 16 | 17 | private String name; 18 | private String value; 19 | 20 | @DataBoundConstructor 21 | public LockableResourceProperty() {} 22 | 23 | @DataBoundSetter 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | @DataBoundSetter 29 | public void setValue(String value) { 30 | this.value = value; 31 | } 32 | 33 | @Exported 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | @Exported 39 | public String getValue() { 40 | return value; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return name; 46 | } 47 | 48 | @Extension 49 | public static class DescriptorImpl extends Descriptor { 50 | 51 | @NonNull 52 | @Override 53 | public String getDisplayName() { 54 | return "Property"; 55 | } 56 | } 57 | 58 | private static final long serialVersionUID = 1L; 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/LockableResources.java: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | * Copyright (c) 2015, 6WIND S.A. All rights reserved. * 3 | * * 4 | * This file is part of the Jenkins Lockable Resources Plugin and is * 5 | * published under the MIT license. * 6 | * * 7 | * See the "LICENSE.txt" file for more information. * 8 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 9 | package org.jenkins.plugins.lockableresources; 10 | 11 | import hudson.Plugin; 12 | import hudson.model.Api; 13 | import java.util.List; 14 | import org.kohsuke.stapler.export.Exported; 15 | import org.kohsuke.stapler.export.ExportedBean; 16 | 17 | @ExportedBean 18 | public class LockableResources extends Plugin { 19 | 20 | public Api getApi() { 21 | return new Api(this); 22 | } 23 | 24 | @Exported 25 | public List getResources() { 26 | return LockableResourcesManager.get().getReadOnlyResources(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/ResourceSelectStrategy.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources; 2 | 3 | public enum ResourceSelectStrategy { 4 | SEQUENTIAL, 5 | RANDOM 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/actions/ResourceVariableNameAction.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources.actions; 2 | 3 | import edu.umd.cs.findbugs.annotations.NonNull; 4 | import hudson.EnvVars; 5 | import hudson.Extension; 6 | import hudson.model.EnvironmentContributor; 7 | import hudson.model.InvisibleAction; 8 | import hudson.model.Run; 9 | import hudson.model.StringParameterValue; 10 | import hudson.model.TaskListener; 11 | import java.util.List; 12 | import org.kohsuke.accmod.Restricted; 13 | import org.kohsuke.accmod.restrictions.NoExternalUse; 14 | 15 | @Restricted(NoExternalUse.class) 16 | public class ResourceVariableNameAction extends InvisibleAction { 17 | 18 | private final List resourceNameParameter; 19 | 20 | public ResourceVariableNameAction(List r) { 21 | this.resourceNameParameter = r; 22 | } 23 | 24 | List getParameter() { 25 | return resourceNameParameter; 26 | } 27 | 28 | @Extension 29 | public static final class ResourceVariableNameActionEnvironmentContributor extends EnvironmentContributor { 30 | 31 | @Override 32 | public void buildEnvironmentFor(@NonNull Run r, @NonNull EnvVars envs, @NonNull TaskListener listener) { 33 | ResourceVariableNameAction a = r.getAction(ResourceVariableNameAction.class); 34 | if (a != null && a.getParameter() != null) { 35 | for (StringParameterValue envToSet : a.getParameter()) { 36 | envs.override(envToSet.getName(), envToSet.getValue()); 37 | } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/nodes/NodesMirror.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources; 2 | 3 | import hudson.Extension; 4 | import hudson.init.InitMilestone; 5 | import hudson.init.Initializer; 6 | import hudson.model.Node; 7 | import hudson.slaves.ComputerListener; 8 | import java.util.Iterator; 9 | import java.util.logging.Logger; 10 | import java.util.stream.Collectors; 11 | import jenkins.model.Jenkins; 12 | import jenkins.util.SystemProperties; 13 | import org.jenkins.plugins.lockableresources.util.Constants; 14 | 15 | // ----------------------------------------------------------------------------- 16 | /** Mirror Jenkins nodes to lockable-resources */ 17 | @Extension 18 | public class NodesMirror extends ComputerListener { 19 | 20 | private static final Logger LOGGER = Logger.getLogger(NodesMirror.class.getName()); 21 | private static LockableResourcesManager lrm; 22 | 23 | // --------------------------------------------------------------------------- 24 | private static boolean isNodeMirrorEnabled() { 25 | return SystemProperties.getBoolean(Constants.SYSTEM_PROPERTY_ENABLE_NODE_MIRROR); 26 | } 27 | 28 | // --------------------------------------------------------------------------- 29 | @Initializer(after = InitMilestone.JOB_LOADED) 30 | public static void createNodeResources() { 31 | LOGGER.info("lockable-resources-plugin: configure node resources"); 32 | mirrorNodes(); 33 | } 34 | 35 | // --------------------------------------------------------------------------- 36 | @Override 37 | public final void onConfigurationChange() { 38 | mirrorNodes(); 39 | } 40 | 41 | // --------------------------------------------------------------------------- 42 | private static void mirrorNodes() { 43 | if (!isNodeMirrorEnabled()) { 44 | return; 45 | } 46 | 47 | LOGGER.info("lockable-resources-plugin: start nodes mirroring"); 48 | lrm = LockableResourcesManager.get(); 49 | synchronized (lrm.syncResources) { 50 | for (Node n : Jenkins.get().getNodes()) { 51 | mirrorNode(n); 52 | } 53 | // please do not remove it, From time to time is necessary for developer debugs 54 | // thx 55 | // lrm.printResources(); 56 | deleteNotExistingNodes(); 57 | // lrm.printResources(); 58 | } 59 | LOGGER.info("lockable-resources-plugin: nodes mirroring finished"); 60 | } 61 | 62 | // --------------------------------------------------------------------------- 63 | private static void deleteNotExistingNodes() { 64 | Iterator resourceIterator = lrm.getResources().iterator(); 65 | while (resourceIterator.hasNext()) { 66 | LockableResource resource = resourceIterator.next(); 67 | if (!resource.isNodeResource() || (Jenkins.get().getNode(resource.getName()) != null)) { 68 | continue; 69 | } 70 | if (resource.isFree()) { 71 | // we can remove this resource. Is newer used currently 72 | LOGGER.config("lockable-resources-plugin: remove node resource '" + resource.getName() + "'."); 73 | resourceIterator.remove(); 74 | } else { 75 | LOGGER.warning("lockable-resources-plugin: can not remove node-resource '" 76 | + resource.getName() 77 | + "'. The resource is currently used (not free)."); 78 | } 79 | } 80 | } 81 | 82 | // --------------------------------------------------------------------------- 83 | private static void mirrorNode(Node node) { 84 | if (node == null) { 85 | return; 86 | } 87 | 88 | LockableResource nodeResource = lrm.fromName(node.getNodeName()); 89 | boolean exist = nodeResource != null; 90 | if (!exist) { 91 | nodeResource = new LockableResource(node.getNodeName()); 92 | LOGGER.config("lockable-resources-plugin: Node-resource '" + nodeResource.getName() + "' will be added."); 93 | } else { 94 | LOGGER.fine("lockable-resources-plugin: Node-resource '" + nodeResource.getName() + "' will be updated."); 95 | } 96 | nodeResource.setLabels( 97 | node.getAssignedLabels().stream().map(Object::toString).collect(Collectors.joining(" "))); 98 | nodeResource.setNodeResource(true); 99 | nodeResource.setEphemeral(false); 100 | nodeResource.setDescription(node.getNodeDescription()); 101 | 102 | if (!exist) { 103 | lrm.addResource(nodeResource); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/queue/Utils.java: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | * Copyright (c) 2013, 6WIND S.A. All rights reserved. * 3 | * * 4 | * This file is part of the Jenkins Lockable Resources Plugin and is * 5 | * published under the MIT license. * 6 | * * 7 | * See the "LICENSE.txt" file for more information. * 8 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 9 | package org.jenkins.plugins.lockableresources.queue; 10 | 11 | import edu.umd.cs.findbugs.annotations.CheckForNull; 12 | import edu.umd.cs.findbugs.annotations.NonNull; 13 | import hudson.EnvVars; 14 | import hudson.matrix.MatrixConfiguration; 15 | import hudson.model.Job; 16 | import hudson.model.Queue; 17 | import hudson.model.Run; 18 | import org.jenkins.plugins.lockableresources.RequiredResourcesProperty; 19 | 20 | public final class Utils { 21 | private Utils() {} 22 | 23 | @CheckForNull 24 | public static Job getProject(@NonNull Queue.Item item) { 25 | if (item.task instanceof Job) return (Job) item.task; 26 | return null; 27 | } 28 | 29 | @NonNull 30 | public static Job getProject(@NonNull Run build) { 31 | return build.getParent(); 32 | } 33 | 34 | @CheckForNull 35 | public static LockableResourcesStruct requiredResources(@NonNull Job project) { 36 | EnvVars env = new EnvVars(); 37 | 38 | if (project instanceof MatrixConfiguration) { 39 | env.putAll(((MatrixConfiguration) project).getCombination()); 40 | project = (Job) project.getParent(); 41 | } 42 | 43 | RequiredResourcesProperty property = project.getProperty(RequiredResourcesProperty.class); 44 | if (property != null) return new LockableResourcesStruct(property, env); 45 | 46 | return null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/util/Constants.java: -------------------------------------------------------------------------------- 1 | package org.jenkins.plugins.lockableresources.util; 2 | 3 | public class Constants { 4 | /// Enable mirror nodes to lockable-resources 5 | public static final String SYSTEM_PROPERTY_ENABLE_NODE_MIRROR = 6 | "org.jenkins.plugins.lockableresources.ENABLE_NODE_MIRROR"; 7 | /// Disable saving lockable resources states, properties ... into local file system. 8 | /// This option makes the plugin much faster (everything is in cache) but 9 | /// **Keep in mind, that you will lost all your manual changed properties** 10 | /// The best way is to use it with JCaC plugin. 11 | public static final String SYSTEM_PROPERTY_DISABLE_SAVE = "org.jenkins.plugins.lockableresources.DISABLE_SAVE"; 12 | /// Enable to print lock causes. Keep in mind, that the log output may grove depends on count of 13 | /// blocked resources. 14 | public static final String SYSTEM_PROPERTY_PRINT_BLOCKED_RESOURCE = 15 | "org.jenkins.plugins.lockableresources.PRINT_BLOCKED_RESOURCE"; 16 | public static final String SYSTEM_PROPERTY_PRINT_QUEUE_INFO = 17 | "org.jenkins.plugins.lockableresources.PRINT_QUEUE_INFO"; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/jenkins/plugins/lockableresources/util/SerializableSecureGroovyScript.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2017 Oleg Nenashev. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.jenkins.plugins.lockableresources.util; 25 | 26 | import edu.umd.cs.findbugs.annotations.CheckForNull; 27 | import edu.umd.cs.findbugs.annotations.NonNull; 28 | import edu.umd.cs.findbugs.annotations.Nullable; 29 | import hudson.model.Descriptor; 30 | import hudson.util.FormValidation; 31 | import java.io.Serializable; 32 | import java.net.MalformedURLException; 33 | import java.util.ArrayList; 34 | import java.util.List; 35 | import java.util.logging.Level; 36 | import java.util.logging.Logger; 37 | import org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript; 38 | import org.jenkinsci.plugins.scriptsecurity.scripts.ClasspathEntry; 39 | import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; 40 | import org.kohsuke.accmod.Restricted; 41 | import org.kohsuke.accmod.restrictions.NoExternalUse; 42 | 43 | /** 44 | * Wrapper for a {@link SecureGroovyScript}. 45 | * 46 | * @author Oleg Nenashev 47 | */ 48 | @Restricted(NoExternalUse.class) 49 | public class SerializableSecureGroovyScript implements Serializable { 50 | 51 | private static final long serialVersionUID = 1L; 52 | 53 | @CheckForNull 54 | private final String script; 55 | 56 | private final boolean sandbox; 57 | /** {@code null} if and only if the {@link #script is null}. */ 58 | @Nullable 59 | private final ArrayList classPathEntries; 60 | 61 | private static final Logger LOGGER = Logger.getLogger(SerializableSecureGroovyScript.class.getName()); 62 | 63 | public SerializableSecureGroovyScript(@CheckForNull SecureGroovyScript secureScript) { 64 | if (secureScript == null) { 65 | script = null; 66 | sandbox = false; 67 | classPathEntries = null; 68 | } else { 69 | this.script = secureScript.getScript(); 70 | this.sandbox = secureScript.isSandbox(); 71 | 72 | List classpath = secureScript.getClasspath(); 73 | classPathEntries = new ArrayList<>(classpath.size()); 74 | for (ClasspathEntry e : classpath) { 75 | classPathEntries.add(new SerializableClassPathEntry(e)); 76 | } 77 | } 78 | } 79 | 80 | @CheckForNull 81 | public String getScript() { 82 | return script; 83 | } 84 | 85 | @CheckForNull 86 | public SecureGroovyScript rehydrate() throws Descriptor.FormException { 87 | if (script == null) { 88 | return null; 89 | } 90 | 91 | ArrayList p = new ArrayList<>(classPathEntries.size()); 92 | for (SerializableClassPathEntry e : classPathEntries) { 93 | ClasspathEntry entry = e.rehydrate(); 94 | if (entry != null) { 95 | p.add(entry); 96 | } 97 | } 98 | 99 | return new SecureGroovyScript(script, sandbox, p); 100 | } 101 | 102 | private static class SerializableClassPathEntry implements Serializable { 103 | 104 | private static final long serialVersionUID = 1L; 105 | 106 | private final String url; 107 | 108 | private SerializableClassPathEntry(@NonNull ClasspathEntry entry) { 109 | this.url = entry.getPath(); 110 | } 111 | 112 | @CheckForNull 113 | private ClasspathEntry rehydrate() { 114 | try { 115 | ClasspathEntry entry = new ClasspathEntry(url); 116 | if (ScriptApproval.get().checking(entry).kind.equals(FormValidation.Kind.OK)) { 117 | return entry; 118 | } else { 119 | return null; 120 | } 121 | } catch (MalformedURLException ex) { 122 | // Unrealistic 123 | LOGGER.log(Level.SEVERE, "Failed to rehydrate the URL " + url + ". It will be skipped", ex); 124 | return null; 125 | } 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/resources/index.jelly: -------------------------------------------------------------------------------- 1 | 2 | 12 |
13 | This plugin allows to define external resources (such as printers, phones, 14 | computers) that can be locked by builds. If a build requires an external 15 | resource which is already locked, it will wait for the resource to be free. 16 |
17 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Resource 24 | entry.label.title=Label 25 | entry.quantity.title=Quantity 26 | entry.variable.title=Result variable 27 | entry.inversePrecedence.checkbox.title=Inverse precedence 28 | entry.skipIfLocked.title=Skip if locked 29 | entry.priority.title=Queue priority 30 | entry.resourceSelectStrategy.title=Strategy for resource selection 31 | entry.extra.title=Extra resources 32 | entry.extra.add=Add Resource 33 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config_cs.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Zdroj 24 | entry.label.title=Popisek 25 | entry.quantity.title=Mno\u017estv\u00ed 26 | entry.variable.title=Prom\u011bnn\u00e1 v\u00fdsledk\u016f 27 | entry.inversePrecedence.checkbox.title=Obr\u00e1cen\u00e9 po\u0159ad\u00ed 28 | entry.skipIfLocked.title=P\u0159esko\u010dit frontu 29 | entry.resourceSelectStrategy.title=Strategie v\u00fdb\u011bru zdroj\u016f 30 | entry.extra.title=Dodate\u010dn\u00e9 zdroje 31 | entry.extra.add=P\u0159idat zdroj 32 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config_de.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Ressource 24 | entry.label.title=Label 25 | entry.quantity.title=Anzahl 26 | entry.variable.title=Ergebnisvariable 27 | entry.inversePrecedence.checkbox.title=Umgekehrter Vorrang 28 | entry.skipIfLocked.title=Warteschlange \u00fcberspringen 29 | entry.resourceSelectStrategy.title=Strategie f\u00fcr Ressourcenauswahl 30 | entry.extra.title=Zus\u00e4tzliche Ressourcen 31 | entry.extra.add=Ressource hinzuf\u00fcgen 32 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Ressource 24 | entry.label.title=Libell\u00e9 25 | entry.quantity.title=Quantit\u00e9 26 | entry.variable.title=Variable r\u00e9sultat 27 | entry.inversePrecedence.checkbox.title=Priorit\u00e9 invers\u00e9e 28 | entry.skipIfLocked.title=Sauter la file d'attente 29 | entry.extra.title=Ressources suppl\u00e9mentaires 30 | entry.extra.add=Ajouter une ressource -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config_sk.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Zdroj 24 | entry.label.title=\u0160t\u00edtok 25 | entry.quantity.title=Po\u010det 26 | entry.variable.title=Pramenn\u00e1 s v\u00fdsledkami 27 | entry.inversePrecedence.checkbox.title=Opa\u010dn\u00e9 poradie 28 | entry.skipIfLocked.title=Predbehn\u00fa\u0165 rad 29 | entry.resourceSelectStrategy.title=Strat\u00e9gia v\u00fdberu zdrojov 30 | entry.extra.title=Dodato\u010dn\u00e9 zdroje 31 | entry.extra.add=Prida\u0165 zdroj 32 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-inversePrecedence.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | By default waiting builds get the lock in the same order they requested to acquire it. 4 |

5 |

6 | By checking this option the newest build in the waiting queue will get the lock first. 7 |

8 |

9 | See also 10 | examples 11 | . 12 |

13 |
14 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-label.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The label of the resources to be locked as defined in Global settings. 4 |

5 |

6 | Either a resource or a label need to be specified. 7 |

8 |

9 | See also 10 | examples and 11 | Scripted vs declarative pipeline 12 | . 13 |

14 |
15 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-priority.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The priority of the lock, 4 |

5 |

6 | which takes an integer number that defines the order in which concurrent jobs waiting for the same resource are served. 7 | The job with the highest number would get the resource first. If the priority is equal, the current precedence (first comes first) would be applied. 8 |

9 |

10 | See also 11 | examples 12 | . 13 |

14 |
15 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-quantity.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The quantity of resources with the specified label to be locked as defined in Global settings. 4 |

5 |

6 | Either a resource or a label need to be specified. 7 | Empty value or 0 means lock all matching resources. 8 |

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-resource.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The resource name to lock as defined in Global settings. 4 |

5 |

6 | If the resource does not exist in Global Settings it will be automatically created on build execution. 7 | Either a resource or a label need to be specified. 8 |

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-resourceSelectStrategy.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The strategy used to chose which available resources get locked. 4 | By default, the strategy will be "sequential" and resources are locked following the order in the lockable resources list. 5 | Set the strategy to "random" to randomize the order in which resources are locked. 6 |

7 |
8 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-skipIfLocked.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | By default waiting builds get the lock. 4 |

5 |

6 | By checking this option the body will not be executed if there is a queue. 7 | It will only take the lock if it can be taken immediately. 8 |

9 |

10 | See also 11 | examples 12 | . 13 |

14 |
15 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-variable.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Name of an environment variable that will receive the comma separated list of the names of the locked resources while the block executes. 4 |

5 |

6 | See also 7 | examples and 8 | Scripted vs declarative pipeline 9 | . 10 |

11 |
12 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Resource 24 | entry.label.title=Label 25 | entry.quantity.title=Quantity -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config_cs.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Zdroj 24 | entry.label.title=Popisek 25 | entry.quantity.title=Po\u010det -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config_de.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Ressource 24 | entry.label.title=Label 25 | entry.quantity.title=Menge -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Ressource 24 | entry.label.title=Libell\u00e9 25 | entry.quantity.title=Quantit\u00e9 -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/config_sk.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.resource.title=Zdroj 24 | entry.label.title=\u0160t\u00edtok 25 | entry.quantity.title=Po\u010det -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/help-label.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The label of the resources to be locked as defined in Global settings. 4 |

5 |

6 | Either a resource or a label need to be specified. 7 |

8 |

9 | See also 10 | examples and 11 | Scripted vs declarative pipeline 12 | . 13 |

14 |
15 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/help-quantity.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The quantity of resources with the specified label to be locked as defined in Global settings. 4 |

5 |

6 | Either a resource or a label need to be specified. 7 | Empty value or 0 means lock all matching resources. 8 |

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockStepResource/help-resource.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | The resource name to lock as defined in Global settings. 4 |

5 |

6 | If the resource does not exist in Global Settings it will be automatically created on build execution. 7 | Either a resource or a label need to be specified. 8 |

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 |
33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Name 24 | entry.description.title=Description 25 | entry.labels.title=Labels 26 | entry.reservedBy.title=Reserved by 27 | entry.properties.title=Properties 28 | entry.properties.add=Add Property 29 | entry.properties.delete=Delete Property -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_cs.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Jm\u00e9no 24 | entry.description.title=Popis 25 | entry.labels.title=Popisky 26 | entry.reservedBy.title=Rezervace u\u017eivatelem -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_de.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Name 24 | entry.description.title=Beschreibung 25 | entry.labels.title=Labels 26 | entry.reservedBy.title=Reserviert durch -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Nom 24 | entry.description.title=Description 25 | entry.labels.title=Libell\u00e9s 26 | entry.reservedBy.title=R\u00e9serv\u00e9e par 27 | entry.properties.title=Propri\u00e9t\u00e9s 28 | entry.properties.add=Ajouter une propri\u00e9t\u00e9 29 | entry.properties.delete=Supprimer une propri\u00e9t\u00e9 -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResource/config_sk.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Meno 24 | entry.description.title=Popis 25 | entry.labels.title=\u0160t\u00edtky 26 | entry.reservedBy.title=Rezervovan\u00e9 u\u017e\u00edvate\u013eom -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourceProperty/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourceProperty/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Name 24 | entry.value.title=Value -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourceProperty/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | entry.name.title=Nom 24 | entry.value.title=Valeur -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | section.title=Lockable Resources Manager 24 | entry.title=Lockable Resources 25 | field.header=Resource 26 | field.add=Add Lockable Resource -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config_cs.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | section.title=Spr\u00e1vce uzamykateln\u00fdch zdroj\u00fa 24 | entry.title=Uzamykateln\u00e9 zdroje 25 | field.header=Zdroj 26 | field.add=P\u0159idat uzamykateln\u00fd zdroj -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config_de.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | section.title=Sperrbare Ressourcen verwalten 24 | entry.title=Sperrbare Ressourcen 25 | field.header=Ressource 26 | field.add=Sperrbare Ressource hinzuf\u00fcgen -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | section.title=Gestionnaire des ressources verrouillables 24 | entry.title=Ressources verrouillables 25 | field.header=Ressource 26 | field.add=Ajouter une ressource verrouillable -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/LockableResourcesManager/config_sk.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | section.title=Spr\u00e1vca uzamykate\u013en\u00fdch zdrojov 24 | entry.title=Uzamykate\u013en\u00e9 zdroje 25 | field.header=Zdroj 26 | field.add=Prida\u0165 uzamykate\u013en\u00fd zdroj -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/Messages.properties: -------------------------------------------------------------------------------- 1 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 2 | # Copyright (c) 2014, 6WIND S.A. All rights reserved. # 3 | # # 4 | # This file is part of the Jenkins Lockable Resources Plugin and is # 5 | # published under the MIT license. # 6 | # # 7 | # See the "LICENSE.txt" file for more information. # 8 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 9 | 10 | LockableResourcesRootAction.PermissionGroup=Lockable Resources 11 | LockableResourcesRootAction.UnlockPermission=Unlock 12 | LockableResourcesRootAction.UnlockPermission.Description=This permission grants the ability to manually \ 13 | unlock resources that have been locked by builds. 14 | LockableResourcesRootAction.ReservePermission=Reserve 15 | LockableResourcesRootAction.ReservePermission.Description=This permission grants the ability to manually \ 16 | reserve lockable resources outside of a build. 17 | LockableResourcesRootAction.StealPermission=Steal 18 | LockableResourcesRootAction.StealPermission.Description=This permission grants the ability to manually \ 19 | "steal" resources that have been locked by builds or "reassign" those reserved by users. 20 | LockableResourcesRootAction.ViewPermission=View 21 | LockableResourcesRootAction.ViewPermission.Description=This permission grants the ability to view \ 22 | lockable resources. 23 | LockableResourcesRootAction.QueueChangeOrderPermission=Queue 24 | LockableResourcesRootAction.QueueChangeOrderPermission.Description=This permission grants the ability to \ 25 | manually manipulate the lockable resources queue.. 26 | LockedResourcesBuildAction.displayName=Lockable resources 27 | # Java errors 28 | error.labelDoesNotExist=The resource label does not exist: {0}. 29 | error.resourceDoesNotExist=The resource does not exist: {0}. 30 | error.labelOrNameMustBeSpecified=Either resource label or resource name must be specified. 31 | error.labelAndNameSpecified=Resource label and resource name cannot be specified simultaneously. 32 | error.labelAndNameOrGroovySpecified=Only resource label, groovy expression, or resource names can be defined, not more than one. 33 | error.couldNotParseToint=Could not parse the given value as integer. 34 | error.givenAmountIsGreaterThatResourcesAmount=Given amount %d is greater than amount of resources: %d. 35 | error.resourceAlreadyLocked=Resource {0} already reserved or locked! 36 | error.invalidResourceSelectionStrategy=The strategy "{0}" is not supported. Valid options are {1}. 37 | error.isNotANumber=The queue position must be a number. Given: {0} 38 | error.queuePositionOutOfRange=The queue position {0} is out of range (1 - {1})! 39 | error.queueDoesNotExist=The queue {0} does not (anymore) exist. 40 | error.inversePrecedenceAndPriorityAreSet=The "inverse precedence" option is not compatible with "queue priority" option! 41 | # display-names 42 | LockStep.displayName=Lock shared resource 43 | LockStepResource.displayName=Resource 44 | LockableResource.displayName=Resource 45 | LockableResourcesManager.displayName=External Resources 46 | RequiredResourcesProperty.displayName=Required Lockable Resources 47 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/Messages_cs.properties: -------------------------------------------------------------------------------- 1 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 2 | # Copyright (c) 2014, 6WIND S.A. All rights reserved. # 3 | # # 4 | # This file is part of the Jenkins Lockable Resources Plugin and is # 5 | # published under the MIT license. # 6 | # # 7 | # See the "LICENSE.txt" file for more information. # 8 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 9 | 10 | LockableResourcesRootAction.PermissionGroup=Uzamykateln\u00e9 zdroje 11 | LockableResourcesRootAction.UnlockPermission=Odemknout 12 | LockableResourcesRootAction.UnlockPermission.Description=Toto opr\u00e1vn\u011bn\u00ed ud\u011bluje mo\u017enost ru\u010dn\u011b odemknout zdroje, kter\u00e9 byly uzam\u010deny sestaven\u00edmi. 13 | LockableResourcesRootAction.ReservePermission=Rezervovat 14 | LockableResourcesRootAction.ReservePermission.Description=Toto opr\u00e1vn\u011bn\u00ed poskytuje mo\u017enost ru\u010dn\u011b rezervovat uzamykateln\u00e9 zdroje mimo sestaven\u00ed. 15 | LockableResourcesRootAction.StealPermission=Ukradnout 16 | LockableResourcesRootAction.StealPermission.Description=Toto opr\u00e1vn\u011bn\u00ed ud\u011bluje mo\u017enost manu\u00e1ln\u011b "ukradnout" zdroje, kter\u00e9 byly uzam\u010deny sestaven\u00edm nebo "p\u0159e\u0159adit" polo\u017eky rezervovan\u00e9 u\u017eivateli. 17 | LockableResourcesRootAction.ViewPermission=Zobrazit 18 | LockableResourcesRootAction.ViewPermission.Description=Toto opr\u00e1vn\u011bn\u00ed ud\u011bluje mo\u017enost zobrazit uzamykateln\u00e9 zdroje. 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/Messages_de.properties: -------------------------------------------------------------------------------- 1 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 2 | # Copyright (c) 2014, 6WIND S.A. All rights reserved. # 3 | # # 4 | # This file is part of the Jenkins Lockable Resources Plugin and is # 5 | # published under the MIT license. # 6 | # # 7 | # See the "LICENSE.txt" file for more information. # 8 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 9 | 10 | LockableResourcesRootAction.PermissionGroup=Sperrbare Ressourcen 11 | LockableResourcesRootAction.UnlockPermission=Entsperren 12 | LockableResourcesRootAction.UnlockPermission.Description=Diese Berechtigung gew\u00e4hrt die M\u00f6glichkeit, Ressourcen manuell freizuschalten, die durch Builds gesperrt wurden. 13 | LockableResourcesRootAction.ReservePermission=Reservieren 14 | LockableResourcesRootAction.ReservePermission.Description=Diese Berechtigung gew\u00e4hrt die M\u00f6glichkeit, verschlie\u00dfbare Ressourcen au\u00dferhalb eines Build manuell zu reservieren. 15 | LockableResourcesRootAction.StealPermission=Stehlen 16 | LockableResourcesRootAction.StealPermission.Description=Diese Berechtigung gew\u00e4hrt die M\u00f6glichkeit, Ressourcen manuell zu stehlen, die durch Builds gesperrt oder von Benutzern reserviert wurden. 17 | LockableResourcesRootAction.ViewPermission=Ansicht 18 | LockableResourcesRootAction.ViewPermission.Description=Diese Berechtigung gew\u00e4hrt die M\u00f6glichkeit, gesperrte Ressourcen zu sehen. 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/Messages_fr.properties: -------------------------------------------------------------------------------- 1 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 2 | # Copyright (c) 2014, 6WIND S.A. All rights reserved. # 3 | # # 4 | # This file is part of the Jenkins Lockable Resources Plugin and is # 5 | # published under the MIT license. # 6 | # # 7 | # See the "LICENSE.txt" file for more information. # 8 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 9 | 10 | LockableResourcesRootAction.PermissionGroup=Ressources verrouillables 11 | LockableResourcesRootAction.UnlockPermission=D\u00e9verrouiller 12 | LockableResourcesRootAction.UnlockPermission.Description=Cette permission accorde la possibilit\u00e9 de d\u00e9verrouiller manuellement les ressources qui ont \u00e9t\u00e9 verrouill\u00e9es par les builds. 13 | LockableResourcesRootAction.ReservePermission=R\u00e9server 14 | LockableResourcesRootAction.ReservePermission.Description=Cette permission accorde la possibilit\u00e9 de r\u00e9server manuellement les ressources verrouillables \u00e0 l'ext\u00e9rieur d'un build. 15 | LockableResourcesRootAction.StealPermission=Voler 16 | LockableResourcesRootAction.StealPermission.Description=Cette permission permet de "voler" manuellement les ressources qui ont \u00e9t\u00e9 verrouill\u00e9es par les builds ou de "r\u00e9assigner" celles r\u00e9serv\u00e9es par les utilisateurs. 17 | LockableResourcesRootAction.ViewPermission=Voir 18 | LockableResourcesRootAction.ViewPermission.Description=Cette permission accorde la possibilit\u00e9 de voir les ressources verrouillables. 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/Messages_sk.properties: -------------------------------------------------------------------------------- 1 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 2 | # Copyright (c) 2014, 6WIND S.A. All rights reserved. # 3 | # # 4 | # This file is part of the Jenkins Lockable Resources Plugin and is # 5 | # published under the MIT license. # 6 | # # 7 | # See the "LICENSE.txt" file for more information. # 8 | # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # 9 | 10 | LockableResourcesRootAction.PermissionGroup=Uzamykate\u013en\u00e9 zdroje 11 | LockableResourcesRootAction.UnlockPermission=Odomkn\u00fa\u0165 12 | LockableResourcesRootAction.UnlockPermission.Description=Toto opr\u00e1vnenie ude\u013euje mo\u017enos\u0165 ru\u010dne odomkn\u00fa\u0165 zdroje, ktor\u00e9 boli uzamknut\u00e9 zostaveniami. 13 | LockableResourcesRootAction.ReservePermission=Rezervova\u0165 14 | LockableResourcesRootAction.ReservePermission.Description=Toto opr\u00e1vnenie poskytuje mo\u017enos\u0165 ru\u010dne rezervova\u0165 uzamykate\u013en\u00e9 zdroje mimo zostavenia. 15 | LockableResourcesRootAction.StealPermission=Ukradn\u00fa\u0165 16 | LockableResourcesRootAction.StealPermission.Description=Toto opr\u00e1vnenie umo\u017e\u0148uje manu\u00e1lne "ukradn\u00fa\u0165" zdroj, ktor\u00fd bol uzamknut\u00fd zostaven\u00edm alebo "preradi\u0165" zdroje rezervovan\u00e9 u\u017e\u00edvate\u013eom. 17 | LockableResourcesRootAction.ViewPermission=Zobrazi\u0165 18 | LockableResourcesRootAction.ViewPermission.Description=Toto opr\u00e1vnenie ude\u013euje mo\u017enos\u0165 zobrazi\u0165 zamykate\u013en\u00e9 zdroje. 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | optionalBlock.title=This build requires lockable resources 24 | entry.resourceNames.title=Resources 25 | entry.labelName.title=Label 26 | optionalProperty.resourceMatchScript.title=Groovy Expression 27 | entry.resourceNamesVar.title=Reserved resources variable name 28 | entry.resourceNumber.title=Number of resources to request -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config_cs.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | optionalBlock.title=Toto sestaven\u00ed vy\u017eaduje uzamykateln\u00e9 zdroje 24 | entry.resourceNames.title=Zdroje 25 | entry.labelName.title=Popisek 26 | optionalProperty.resourceMatchScript.title=Groovy k\u00f3d 27 | entry.resourceNamesVar.title=N\u00e1zev prom\u011bnn\u00e9 pro rezervovan\u00e9 zdroje 28 | entry.resourceNumber.title=Po\u010det zdroj\u016f na vy\u017e\u00e1d\u00e1n\u00ed -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config_de.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | optionalBlock.title=Dieses Build erfordert sperrbare Ressourcen 24 | entry.resourceNames.title=Ressourcen 25 | entry.labelName.title=Label 26 | optionalProperty.resourceMatchScript.title=Groovy Expression 27 | entry.resourceNamesVar.title=Variablenname mit reservierten Ressourcen 28 | entry.resourceNumber.title=Anzahl der anzufordernden Ressourcen -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config_fr.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | optionalBlock.title=Ce job n\u00e9cessite des ressources verrouillables 24 | entry.resourceNames.title=Ressources 25 | entry.labelName.title=Libell\u00e9 26 | optionalProperty.resourceMatchScript.title=Expression Groovy 27 | entry.resourceNamesVar.title=Nom de la variable des ressources r\u00e9serv\u00e9es 28 | entry.resourceNumber.title=Nombre de ressources \u00e0 demander -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/config_sk.properties: -------------------------------------------------------------------------------- 1 | # The MIT License 2 | # 3 | # Copyright 2022 Martin Pokorny. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | optionalBlock.title=Toto zostavenie vy\u017eaduje uzamykate\u013en\u00e9 zdroje 24 | entry.resourceNames.title=Zdroje 25 | entry.labelName.title=\u0160t\u00edtok 26 | optionalProperty.resourceMatchScript.title=Groovy k\u00f3d 27 | entry.resourceNamesVar.title=N\u00e1zov pramennej obsahuj\u00facej rezervovan\u00e9 zdroje 28 | entry.resourceNumber.title=Po\u010det zdrojov na vy\u017eiadanie -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/help-labelName.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | If you have created a pool of resources, i.e. a label, you can take it into use 4 | here. The build will select the resource(s) from the pool that includes all 5 | resources sharing the given label. 6 | Only one of Label, Groovy Expression or Resources fields may be specified. 7 |

8 |
9 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/help-resourceMatchScript.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | You can specify a groovy expression to be evaluated each time a resource is checked 4 | to be appropriate for a build. The expression must result into a boolean value. The 5 | following variables are available, in addition to optional arguments of the currently 6 | evaluated build: 7 |

8 |
9 |
resourceName
10 |
as per resource configuration
11 |
resourceDescription
12 |
as per resource configuration
13 |
resourceLabels
14 |
java.util.List<String> of labels as per resource configuration
15 |
16 |

17 | For matrix jobs, axis names and axis values can be referenced as well. Examples: 18 |

19 |
    20 |
  • resourceLabels.contains("hardcoded")
  • 21 |
  • resourceLabels.contains(axisName)
  • 22 |
  • resourceName == axisName
  • 23 |
24 | 25 |

26 | The script's contents need to pass approval by the Script Security Plugin. 27 |

28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/help-resourceNames.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | When a build is scheduled, it will attempt to lock the specified resources. If 4 | some (or all) the resources are already locked by another build, the build will 5 | be queued until they are released. It is possible to specify an amount for 6 | requested resources below. 7 |

8 |
9 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/help-resourceNamesVar.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Name for the Jenkins variable to store the reserved resources in. Leave empty 4 | to disable. 5 |

6 |
7 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/RequiredResourcesProperty/help-resourceNumber.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Number of resources to request, empty value or 0 means all. 4 |
5 | This is useful, if you have a pool of similar resources, from which you want 6 | one or more to be reserved. 7 |

8 |
9 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/_api.jelly: -------------------------------------------------------------------------------- 1 | 2 | 12 |
13 | This /api adds remote API access to read current resources. 14 |
15 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/index.jelly: -------------------------------------------------------------------------------- 1 | 2 | 11 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

28 | ${%resources.not_configured}
29 | 30 | ${%resources.configure.here(rootURL + "/configure")} 31 | 32 |

33 |
34 | 35 |
36 | 37 | 52 | 53 |
54 |
55 | 56 |
57 |
58 |
59 |
60 | 61 |
62 |
63 |
64 |
65 | 66 |
67 |
68 |
69 | 70 |