gitlab-branch-source-plugin | Jenkins Plugin for GitLab Multibranch Pipeline jobs | Continous Integration library

 by   jenkinsci Java Version: 660.vd45c0f4c0042 License: MIT

kandi X-RAY | gitlab-branch-source-plugin Summary

kandi X-RAY | gitlab-branch-source-plugin Summary

gitlab-branch-source-plugin is a Java library typically used in Devops, Continous Integration, Jenkin applications. gitlab-branch-source-plugin has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

To be fully able to run a Jenkins Continuous Integration on a GitLab repository or project, you require the following plugins:.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              gitlab-branch-source-plugin has a low active ecosystem.
              It has 115 star(s) with 83 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 58 open issues and 38 have been closed. On average issues are closed in 146 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of gitlab-branch-source-plugin is 660.vd45c0f4c0042

            kandi-Quality Quality

              gitlab-branch-source-plugin has no bugs reported.

            kandi-Security Security

              gitlab-branch-source-plugin has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              gitlab-branch-source-plugin is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              gitlab-branch-source-plugin releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed gitlab-branch-source-plugin and discovered the below as its top functions. This is intended to give you an instant insight into gitlab-branch-source-plugin implemented functionality, and help decide if they suit your requirements.
            • Sends notifications for a build
            • Retrieves the source project ID from a MR job
            • Gets the revision ref
            • Retrieve actions for SCM head events
            • Retrieves the actions for the SCM project
            • Retrieve actions for a SCM head
            • Gets the project s projects
            • Get the name of the project based on the given project name
            • Obtain credentials for the given SCM scope
            • Returns a map of SCMS revisions for the given SCM source
            • Handles an HTTP POST request
            • Handles a POST request
            • Get the children of this directory
            • Retrieves a directed revision
            • Adds Gitlab environment variables to the environment
            • Returns the type of a push event
            • Get the type of a file
            • Gets list of projects from server
            • Decorate the context
            • Create a token using the given credentials id
            • Builds the SCM HEAD
            • Reserves a cached image
            • Log comment on build
            • Retrieves the actions of the given owner
            • Creates a new SCM probe
            • Checks if the message is a merge request
            Get all kandi verified functions for this library.

            gitlab-branch-source-plugin Key Features

            No Key Features are available at this moment for gitlab-branch-source-plugin.

            gitlab-branch-source-plugin Examples and Code Snippets

            No Code Snippets are available at this moment for gitlab-branch-source-plugin.

            Community Discussions

            Trending Discussions on gitlab-branch-source-plugin

            QUESTION

            Jenkins: Access job/plugin configuration values inside pipeline
            Asked 2021-Jan-25 at 19:37

            I am trying the access the values set on a job's configuration page from within my pipeline. These values are not made available as params, nor are they injected as envvars.

            Setup

            • Jenkins, v2.263.1
            • GitLab Branch Source plugin, v1.5.3 (link)
            • Multibranch pipeline job which is pointed to a Gitlab repo
            • Remote Jenkinsfile Provider, v1.13 (link)

            Problem

            Ordinarily, one would have a Jenkinsfile in the root of the repo and therefore the scm would be associated with the repo we want to checkout and build. However, in my case the code I want to build is in a different repo to the Jenkinsfile (hence the Remote Jenkinsfile Provider plugin).

            This means that I need to checkout the code I wish to build as an explicit step in the pipeline, and to do that I need to know the repo. This repo is, however, already defined in the job config.

            The Branch Source plugin does export things like the branch name or merge request number/branch/target into appropriate envvars, but NOT the actual repo.

            As this is a multibranch pipeline, I cannot use something like envInject either (multibranch jobs do not provide the option to 'Prepare an environment for the run' as with other jobs)

            Goal

            I would like to be able to access the server, owner and project fields set in the job config page. Ultimately I could manage with just the project's ssh/http address even.

            Is there some clever way of accessing a job's config from within the pipeline?

            Thanks for any suggestions!

            Reference images

            ...

            ANSWER

            Answered 2021-Jan-25 at 19:37

            Within the gitlab branch source plugin (and the documentation) you have a lot more information, than just with the normal branch source plugin. there are environment variables for the project like GITLAB_PROJECT_GIT_SSH_URL/GITLAB_PROJECT_GIT_HTTPS_URL for the git source and many more. So far i did not see one for the server, but that would be parse-able our of the URLs.

            Within this information, it should be fairly easy to checkout the repository and build it.

            As through the process it came clear, that it is needed to also trigger the pipeline manually, and this is normally also possible with variables (not sure about the Remote File plugin). I assume your Jenkinsfile is a groovy script, which opens up a lot of possibilities. You can define variables and use some logic to determine if the env variable or the parameter is used.

            Source https://stackoverflow.com/questions/65848794

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install gitlab-branch-source-plugin

            Jenkins is an open source, self hosting automation server for continuous integration and continuous delivery. The source code of the core Jenkins and its plugins are written in Java. There have been developments on a modern Jenkins Server (see: Blueocean Plugin) using React and other modern front end tools to provide rich user experience. For more Jenkins related information, see documentation.
            After installing the plugin on your Jenkins instance, you need configure your GitLab Server settings.
            On jenkins, select Manage Jenkins. Scroll down to find the GitLab section. Select Add GitLab Server | Select GitLab Server. Now you will now see the GitLab Server Configuration options.
            On jenkins, select Manage Jenkins.
            Select Configure System.
            Scroll down to find the GitLab section.
            Select Add GitLab Server | Select GitLab Server.
            Now you will now see the GitLab Server Configuration options There are 4 fields that needs to be configured: i. Name - Plugin automatically generates an unique server name for you. User may want to configure this field to suit their needs but should make sure it is sufficiently unique. We recommend to keep it as it is. ii. Server URL - Contains the URL to your GitLab Server. By default it is set to "https://gitlab.com". User can modify it to enter their GitLab Server URL e.g. https://gitlab.gnome.org/, http://gitlab.example.com:7990. etc. iii. Credentials - Contains a list of credentials entries that are of type GitLab Personal Access Token. When no credential has been added it shows "-none-". User can add a credential by clicking "Add" button. iv. Mange Web Hook - If you want the plugin to setup web hook on your GitLab project(s) to get push/mr/tag/note events then check this box. iv. Mange System Hook - If you want the plugin to setup system hook on your GitLab project(s) to detect if a project is removed then check this box. Remember plugin can only setup system hook on your server if supplied access token has Admin access. v. Secret Token - The secret token is required to authenticate the webhook payloads received from GitLab Server. Use generate secret token from Advanced options or use your own. If you are a old plugin user and did not set a secret token previously and want secret token to applied to the hooks of your existing jobs, you can add the secret token and rescan your jobs. Existing hooks with new secret token will be applied. vi. Root URL for hooks - By default Root URL for hooks created by this plugin is your Jenkins instance url. You can modify the root URL in by adding your custom root URL. Leave empty if you want Jenkins URL to be your custom hook url. A path is added to your hook ROOT URL /gitlab-webhook/post for webhooks and /gitlab-systemhook/post for system hooks.
            Adding a Personal Access Token Credentials: This is a manual setup. To automatically generate Personal Access Token see next section. i. User is required to add a GitLab Personal Access Token type credentials entry to securely persist the token inside Jenkins. ii. Generate a Personal Access Token on your GitLab Server a. Select profile dropdown menu from top-right corner b. Select `Settings` c. Select `Access Token` from left column d. Enter a name | Set Scope to `api` (If admin also give `sudo` which required for systemhooks and mr comment trigger) e. Select `Create Personal Access Token` f. Copy the token generated iii. Return to Jenkins | Select Add in Credentials field | Select Jenkins. iv. Set Kind to GitLab Personal Access Token. v. Enter Token. vi. Enter a unique id in ID. vii. Enter a human readable description. viii. Select Add.
            Testing connection: i. Select your desired token in the Credentials dropdown. ii. Select Test Connection. iii. It should return something like Credentials verified for user {username}.
            Select Apply (at the bottom).
            GitLab Server is now setup on Jenkins.
            GitLab Branch Source Plugin allows you to create 2 type of jobs:.
            Multibranch Pipeline Jobs - For single project.
            Folder Organisation - For multiple projects inside a owner (user/group/subgroup).

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/jenkinsci/gitlab-branch-source-plugin.git

          • CLI

            gh repo clone jenkinsci/gitlab-branch-source-plugin

          • sshUrl

            git@github.com:jenkinsci/gitlab-branch-source-plugin.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Continous Integration Libraries

            chinese-poetry

            by chinese-poetry

            act

            by nektos

            volkswagen

            by auchenberg

            phpdotenv

            by vlucas

            watchman

            by facebook

            Try Top Libraries by jenkinsci

            jenkins

            by jenkinsciJava

            docker

            by jenkinsciPowerShell

            pipeline-examples

            by jenkinsciGroovy

            blueocean-plugin

            by jenkinsciJava