jenkins-pipeline | Common Jenkins Pipeline Functions | Plugin library

 by   mozmeao Groovy Version: 20170607.1 License: MPL-2.0

kandi X-RAY | jenkins-pipeline Summary

kandi X-RAY | jenkins-pipeline Summary

jenkins-pipeline is a Groovy library typically used in Plugin, Jenkin applications. jenkins-pipeline has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

A list of functions for Jenkins Pipeline build and used by Mozilla's Marketing Engineering and Operations team.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jenkins-pipeline has a low active ecosystem.
              It has 19 star(s) with 18 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 1 have been closed. On average issues are closed in 10 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of jenkins-pipeline is 20170607.1

            kandi-Quality Quality

              jenkins-pipeline has no bugs reported.

            kandi-Security Security

              jenkins-pipeline has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              jenkins-pipeline is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              jenkins-pipeline releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jenkins-pipeline
            Get all kandi verified functions for this library.

            jenkins-pipeline Key Features

            No Key Features are available at this moment for jenkins-pipeline.

            jenkins-pipeline Examples and Code Snippets

            No Code Snippets are available at this moment for jenkins-pipeline.

            Community Discussions

            QUESTION

            Jenkins executor busy - job with loading bar but no link or id - ghost job
            Asked 2021-May-28 at 15:01

            After Jenkins restart we found few nodes with busy executor. The job that occupies executor have striped white blue loading bar and does not link to any specific build (in fact no build is ongoing for that job). So we don't have id or ui way to abort it, you can see it here:

            How the job looks on jenkins node

            Now, I wanted to find a way to kill it without really looking into cause of the issue, maybe its related to Jenkins pipeline job wont finish in the UI - but in our case we don't have underlying finished job. We tried to kill it by:

            • Restarting node
            • Killing any jenkins/agent threads on node - it just caused node to disconnect
            • Locating it somehow via ui

            None of above worked, the ghost job was still there. Any clues how to kill such job or at least point to it without id ?

            Edit: I found similar thread How to stop an unstoppable zombie job on Jenkins without restarting the server? with plenty answers though different solution that didn't work for me

            ...

            ANSWER

            Answered 2021-May-28 at 14:31

            Ok, so I've found a way to free these executors via groovy script executed on Jenkins Script Console.

            The way I managed to kill it was to get node by label as Computer, iterate through executors (or rather, call the only one ;) ) and call Interrupt()

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

            QUESTION

            Jenkins Pipeline with conditional "When" expression of choice parameters
            Asked 2021-Apr-22 at 15:45

            I'm new to Groovy. I'm not able to figure out what's wrong here.

            Depends on the choice of input, I expect the script to execute either Step 'Hello' or 'Bye' but it skips both. I mostly orientated to this Jenkins pipeline conditional stage using "When" for choice parameters, but still can't figure it out.

            How can I use those choice parameters correctly?

            ...

            ANSWER

            Answered 2021-Apr-22 at 15:45

            From the docs:

            Any parameters provided as part of the input submission will be available in the environment for the rest of the stage.

            This means that your parameter CHOICE does not exist in the other stages. If you want to have a parameter that's available on all the stages, you can define a parameter outside of the stage, i.e.:

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

            QUESTION

            Unable to resolve class - gradle
            Asked 2021-Mar-09 at 16:28

            I have directory structure as below:

            ...

            ANSWER

            Answered 2021-Mar-09 at 16:28

            You have declared a class A in package foo. (Note that the layout doesn't reflect this as the file should be in src/foo/foo/A.groovy, although Groovy doesn't really care).

            However, the test class is not in a package and therefore can't see foo.A. Either import it or move the test class to package foo as well. Alternatively, remove the package declaration from class A, though I don't think that is good practice.

            I also agree with the comment about not changing the layout unless you have a very good reason for it (e.g. you are working on a legacy project). This is probably what has caused confusion about what package the class is actually in.

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

            QUESTION

            Using Declarative Jenkins pipeline from SCM - Subversion - How to get svn Url?
            Asked 2021-Feb-26 at 08:09

            This looks like very basic question about Jenkins usage.

            I have Jenkinsfile located in root folder of my Subversion repository tree. There are many branches (versions/tags) of the product - everywhere is the same Jenkinsfile. So far very basic setup, I suppose.

            I need to provide some steps with current Subversion repository branch/url. There are some similar questions like this or this, but none is working solution for Subversion.

            ...

            ANSWER

            Answered 2021-Feb-26 at 08:09

            QUESTION

            GitHub post-receive hook not triggered on Windows
            Asked 2021-Feb-07 at 12:06

            I'm trying to use a post-receive git-hook to automate the deploy of a simple maven project by triggering a Jenkins pipeline I set up. The source is hosted on a GitHub repo while Jenkins on a container running on my PC. So far, the hook is not triggered after I push to master branch.

            Thing is if I try and run the script manually it just works! I also tried setting chmod +x with Git Bash (after all I'm on Windows) to the post-receive file, unfortunately without success: the hook still does not get triggered. What might be the issue?

            I already tried looking for answers on similar topics here on stackoverflow, but nothing solved my issue. FYI, below the post-receive script (nothing fancy, as you can see):

            ...

            ANSWER

            Answered 2021-Feb-06 at 15:19

            A post-receive hook is run on the server side, not on the client side. That means that it's run at GitHub, assuming you're pushing to GitHub, ant not on your local machine.

            Normally, you'd want a GitHub webhook to notify you of the push event, but you cannot use one here because the machine is running on localhost and such an event has to be able to on a public IP address since GitHub has to send an HTTP request to it.

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

            QUESTION

            Jenkins podTemplate disbale default echo
            Asked 2021-Jan-27 at 14:08

            I am running my jenkins in Kubernetes to create dynamic slave pod based on requirement.

            And each file is uses some credentials from jenkins.

            Now the problem is when I run some command in sh script:"" then that credentials are visible on log view option on UI.

            as below screenshot.

            My Jenkinsfile is looks like below

            ...

            ANSWER

            Answered 2021-Jan-27 at 14:08

            To avoid leaking your credentials into the output, you need to resolve them within the shell interpreter of the shell step method instead of within Jenkins Pipeline. Since withCredentials temporarily assigns to environment variables, this is possible by not interpolating within Groovy:

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

            QUESTION

            groovy.lang.MissingPropertyException: No such property: sh for class: groovy.lang.Binding
            Asked 2020-Dec-21 at 11:03

            Im trying to build a pipeline on Jenkins that runs a command on node and informs me of the following error:

            ...

            ANSWER

            Answered 2020-Dec-21 at 11:03

            Without having the line numbers available and what seems very bad formatting in terms of tabs in the Jenkinsfile following the stack trace is quite hard to debug.

            However I suspect it might be this line sudo sh './gradlew assemble' as sudo isnt a valid groovy command. If you are wanting to run the gradlew as sudo then it would be sh 'sudo ./gradlew assemble'

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

            QUESTION

            Is it possible to use jenkins-agent with given ip pattern in jenkins?
            Asked 2020-Dec-08 at 07:06

            Basically, there are many jenkins-nodes in a jenkins-server. The launch-method of the majority is launch agents via ssh and the host under the launch method option is the actual ip. However, the labels of the majority are empty.

            The main problem is a firewall in front of my server 10.227.10.10. In short, this firewall will block the packets. If using the jenkins-pipeline like below, the packets from some jenkins-nodes may get blocked by the firewall.

            I read the pipeline syntax and the label can be the solution. However, there will be massive work to configure the label part of the jenkins-nodes. Any ideas?

            ...

            ANSWER

            Answered 2020-Dec-08 at 04:27

            I don't believe the IP address is available as a property of the Slave or via getComputer()

            The Pipeline Agent, label only supports explicit labels, but does allow for conditions. You can just make a new label (eg: "227Net" ), add it to the nodes using the console groovy script below, then reference that label in your pipeline:

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

            QUESTION

            New to Jenkins; simple build fails with No such DSL method 'pipeline' found among steps
            Asked 2020-Nov-22 at 22:43

            I have a simple hello world project which is failing on a new Jenkins install. I'm following the instructions in this URL: https://code-maven.com/jenkins-pipeline-hello-world

            For reference, the following simple build pipeline plugins are installed:

            Build Pipeline Plugin 1.5.8
            Pipeline Keep Running Step 1.0
            Pipeline Utility Steps 2.6.1
            Pipeline: API 2.40
            Pipeline: Basic Steps 2.22
            Pipeline: Build Step 2.13
            Pipeline: Groovy 2.85
            Pipeline: Input Step 2.12
            Pipeline: Job 2.40
            Pipeline: Keep Environment Step Plugin 1.0
            Pipeline: Nodes and Processes 2.36
            Pipeline: REST API Plugin 2.18
            Pipeline: SCM Step 2.11
            Pipeline: Stage Step 2.5
            Pipeline: Stage View Plugin 2.18
            Pipeline: Step API 2.23
            Pipeline: Supporting APIs 3.6
            Lockable Resources

            (so that also makes the following links I read before posting not applicable: Jenkins pipeline - No such DSL method 'build', Jenkins Pipeline - java.lang.NoSuchMethodError: No such DSL method 'lock' found among steps, No such DSL method 'pipeline' found among steps)

            So per the tutorial I'm following, I created a pipeline, and in the configuration put the following code in the "Pipeline" section:

            ...

            ANSWER

            Answered 2020-Nov-21 at 20:09

            seems like you're missing a bunch of pipeline plugins. Make sure to install "Pipeline" (ID: workflow-aggregator), it will install other pipeline missing plugins.

            https://plugins.jenkins.io/workflow-aggregator/#dependencies

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

            QUESTION

            Jenkins-pipeline fail : No such DSL method 'androidLint' found among steps
            Asked 2020-Nov-21 at 17:16

            I get a failure for the stage 'Static analysis' during my jenkins-pipeline.

            Here is my Jenkinsfile :

            ...

            ANSWER

            Answered 2020-Nov-21 at 17:16

            After investigation, it seems "androidLint" is not supported by "Warnings Next Generation Plugin", and has been replaced by "androidLintParser"

            the correct step with Warning Next Generation plugin is :

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install jenkins-pipeline

            You can download it from GitHub.

            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/mozmeao/jenkins-pipeline.git

          • CLI

            gh repo clone mozmeao/jenkins-pipeline

          • sshUrl

            git@github.com:mozmeao/jenkins-pipeline.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