{"id":25723501,"url":"https://github.com/cs-si/tuleap-jenkins-lib","last_synced_at":"2026-04-15T21:31:38.344Z","repository":{"id":77444681,"uuid":"234123464","full_name":"CS-SI/tuleap-jenkins-lib","owner":"CS-SI","description":"A Jenkins library for Tuleap features","archived":false,"fork":false,"pushed_at":"2020-10-01T09:08:11.000Z","size":120,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-02-25T20:40:50.844Z","etag":null,"topics":["groovy","jenkins","tuleap"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CS-SI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-15T16:28:25.000Z","updated_at":"2020-10-01T09:05:16.000Z","dependencies_parsed_at":"2023-02-26T10:45:51.888Z","dependency_job_id":null,"html_url":"https://github.com/CS-SI/tuleap-jenkins-lib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/CS-SI/tuleap-jenkins-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CS-SI%2Ftuleap-jenkins-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CS-SI%2Ftuleap-jenkins-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CS-SI%2Ftuleap-jenkins-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CS-SI%2Ftuleap-jenkins-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CS-SI","download_url":"https://codeload.github.com/CS-SI/tuleap-jenkins-lib/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CS-SI%2Ftuleap-jenkins-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31861298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["groovy","jenkins","tuleap"],"created_at":"2025-02-25T20:36:54.763Z","updated_at":"2026-04-15T21:31:38.332Z","avatar_url":"https://github.com/CS-SI.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"Utilitary Jenkins Library to integrate with [Tuleap](https://www.tuleap.org/).\r\n\r\n![Java CI](https://github.com/CS-SI/tuleap-jenkins-lib/workflows/Java%20CI/badge.svg)\r\n[![Build Status](https://travis-ci.org/CS-SI/tuleap-jenkins-lib.svg?branch=develop)](https://travis-ci.org/CS-SI/tuleap-jenkins-lib)\r\n\r\nThis library needs to be *trusted*, so it has to be declared in Jenkins in the [Global Shared Libraries](https://jenkins.io/doc/book/pipeline/shared-libraries/#global-shared-libraries).\r\n\r\n# Features\r\n\r\n## Build status\r\n\r\nTuleap offers an API to report effective build status to the associated commit, allowing this information to be displayed on the pull request dashboard.\r\nBut this feature requires some non trivial actions, as described in the [related documentation](https://docs.tuleap.org/user-guide/code-review/pullrequest.html#configure-jenkins-to-tuleap-feedback).\r\n\r\nThe `sendTuleapStatus` step simplifies this action.\r\nThe expected parameters:\r\n\r\n* `tuleapServer`: Server's URL (example: `https://tuleap.example.com`).\r\n* `targetRepo`: Path to the repository (example: `project-name/repo-name.git`).\r\n* `status`: Effective status (`\"success\"` / `\"failure\"`). If not set, the status is based on the current build (cf. `${currentBuild.currentResult}`).\r\n* `gitToken`: Specific token to access the API. This token can be retrieved in the administration dashboard of the repository, in the **Token** tab.\r\n\r\nAs the Git Token is volatile (it is possible to revoke and regenerate this token) and quite sensitive, it is recommended to store this information as a Text Credential in Jenkins, credential associated to the folder of the project/repository concerned.\r\n\r\nIn the following examples, the API token is named `git-token` in Jenkins.\r\n\r\nDeclarative Pipeline example:\r\n\r\n```groovy\r\npipeline {\r\n    environment {\r\n        GIT_TOKEN = credentials('git-token')\r\n    }\r\n    stages {\r\n        // ...\r\n    }\r\n    post {\r\n        always {\r\n            sendTuleapStatus gitToken: this.env.GIT_TOKEN,\r\n                             tuleapServer: 'https://tuleap.example.com',\r\n                             targetRepo: 'project-name/repo-name.git'\r\n        }\r\n    }\r\n}\r\n\r\n```\r\n\r\nScripted Pipeline example:\r\n\r\n```groovy\r\nwithCredentials([\r\n    string(credentialsId: 'git-token', variable: 'token_git'),\r\n]){\r\n    sendTuleapStatus gitToken: this.env.token_git,\r\n                     targetRepo: 'projet/depot-test.git',\r\n                     status: \"success\"\r\n}\r\n```\r\n\r\n## File upload\r\n\r\nTuleap offers an API to upload files in the [FRS](https://docs.tuleap.org/user-guide/documents-and-files/frs.html).\r\nIt is usefull to have the hability to upload file from the CI/CD pipeline in order to automatically store the delivery.\r\n\r\nThe `uploadTuleapFile` step simplify this action.\r\nThe expected parameters:\r\n\r\n* `tuleapServer`: Server's URL (example: `https://tuleap.example.com`).\r\n* `accessKey`: the API token of the user, generated from the personnal page.\r\n* `fileName`: the file's name to create in the release.\r\n* `filePath`: the path to the effective file to upload.\r\n\r\nAs the `accessKey` is volatile (it is possible to revoke and regenerate this token) and quite sensitive, it is recommended to store this information as a Text Credential in Jenkins, credential associated to the folder of the project/repository concerned.\r\n\r\nThen, to decide where to upload the file, we have to provide other optional arguments:\r\n\r\n* `projectId`: the Id (numeric) of the project.\r\n* `packageId`: the Id (numeric) of the package concerned.\r\n* `packageName`: the name of the package concerned, if packageId is not known. Requires a valid projectId.\r\n* `releaseId`: the Id (numeric) of the release concerned.\r\n* `releaseName`: the name of the release concerned, if releaseId is not known. Requires a valid projectId. The release would be created if not found.\r\n\r\nTheir usage depends on the situation:\r\n\r\n1. We know the `releaseId`, so we just provide it.\r\n2. We don't know the `releaseId`, but its name or we want to create it, so we provide `releaseName`. In this case, we have to provide the `packageId`. If we don't know the id but we know its name, we can provide `packageName`. But in this case, we have to provide the `projectId`.\r\n\r\nIn the following examples, the access key is named `tuleap-token` in Jenkins).\r\n\r\nDeclarative Pipeline example:\r\n\r\n```groovy\r\npipeline {\r\n    environment {\r\n        API_KEY = credentials('tuleap-token')\r\n    }\r\n    stages {\r\n        // ...\r\n    }\r\n    post {\r\n        always {\r\n            uploadTuleapFile tuleapServer: \"https://tuleap.example.com\",\r\n                                accessKey: \"${API_KEY}\",\r\n                                packageId: 110,\r\n                                releaseName: \"${BRANCH_NAME}\",\r\n                                fileName: \"impl-1.0-SNAPSHOT.jar\",\r\n                                filePath: \"${WORKSPACE}/impl/target/impl-1.0-SNAPSHOT.jar\"\r\n        }\r\n    }\r\n}\r\n\r\n```\r\n\r\n## Label pull request\r\n\r\nTuleap offers an API to update labels on a pull request. The pull request is determined by the commit hash of the current jenkins build.\r\n\r\nThe `labelTuleapPR` step simplify this action. The expected parameters:\r\n\r\n* `accessKey` The API token of the user, generated from the personnal page.\r\n* `tuleapServer` Server's URL.\r\n* `targetProject` The project name or id where to search the PR.\r\n* `targetRepo` The repository name or id where to search to PR.\r\n* `addLabels` The label or list of label name to add on the PR.\r\n* `rmLabels` The label or list of label name to remove on the PR.\r\n\r\nAs the `accessKey` is volatile (it is possible to revoke and regenerate this token) and quite sensitive, it is recommended to store this information as a Text Credential in Jenkins, credential associated to the folder of the project/repository concerned.\r\n\r\nConcern the parameter `addLabels` and `rmLabels`, a least one of these parameter are required. Both could be also given in the same call.\r\n\r\nIn the following examples, the access key is named `tuleap-token` in Jenkins).\r\n\r\nDeclarative Pipeline example:\r\n\r\n```groovy\r\npipeline {\r\n    environment {\r\n        TULEAP_ACCESS_KEY = credentials('tuleap-token')\r\n    }\r\n    stages {\r\n        // ...\r\n    }\r\n    post {\r\n        failure {\r\n            labelTuleapPR accessKey: this.env.TULEAP_ACCESS_KEY,\r\n                          tuleapServer: \"https://tuleap.example.com\",\r\n                          targetProject: \"project_name\",\r\n                          targetRepo: \"git_repo_name\",\r\n                          addLabels: [\"COMPILATION FAILED\"]\r\n        }\r\n        success {\r\n            labelTuleapPR accessKey: this.env.TULEAP_ACCESS_KEY,\r\n                          tuleapServer: \"https://tuleap.example.com\",\r\n                          targetProject: \"project_name\",\r\n                          targetRepo: \"git_repo_name\",\r\n                          rmLabels: [\"COMPILATION FAILED\"]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Comment pull request\r\n\r\nTuleap offers an API to post a comment on a pull request. The pull request is determined by the commit hash of the current jenkins build.\r\n\r\nThe `commentTuleapPR` step simplify this action. The expected parameters:\r\n\r\n* `accessKey` The API token of the user, generated from the personnal page.\r\n* `tuleapServer` Server's URL.\r\n* `targetProject` The project name or id where to search the PR.\r\n* `targetRepo` The repository name or id where to search to PR.\r\n* `comment` The comment to post on the PR.\r\n\r\nAs the `accessKey` is volatile (it is possible to revoke and regenerate this token) and quite sensitive, it is recommended to store this information as a Text Credential in Jenkins, credential associated to the folder of the project/repository concerned.\r\n\r\nIn the following examples, the access key is named `tuleap-token` in Jenkins).\r\n\r\nDeclarative Pipeline example:\r\n\r\n```groovy\r\npipeline {\r\n    environment {\r\n        TULEAP_ACCESS_KEY = credentials('tuleap-token')\r\n    }\r\n    stages {\r\n        // ...\r\n    }\r\n    post {\r\n        always {\r\n            commentTuleapPR accessKey: this.env.TULEAP_ACCESS_KEY,\r\n                            tuleapServer: \"https://tuleap.example.com\",\r\n                            targetProject: \"project_name\",\r\n                            targetRepo: \"git_repo_name\",\r\n                            comment: \"Result of the build: ${env.BUILD_URL}\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n# License\r\n\r\nCf. [license file](LICENSE.txt)\r\n\r\n# References\r\n\r\nMore documentation to develop a library at \u003chttps://jenkins.io/doc/book/pipeline/shared-libraries/\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-si%2Ftuleap-jenkins-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcs-si%2Ftuleap-jenkins-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-si%2Ftuleap-jenkins-lib/lists"}