Hot answers tagged

6

No, there still isn't any common practice for this since this is not very common. I would recommend you to create a Development Jenkins Environment and run tests against it. Right now you will have to do that from scratch since there are not many open source repositories that could help you. So, how does this Jenkins Development Environment look like? For ...


2

In order to pass masked credentials to your Jenkins job, do the following: In Jenkins, install Credentials Binding plugin. In your Jenkins, go to Credentials and click the global domain. In the left pane, click "Add credential". From the "Kind" dropdown, choose "Username with password". Enter the username and password in the reflective boxes and choose an ...


2

I'm not really sure I understand your question, but you can execute arbitrary Groovy inside of a script block, so you can do just about anything within script. For example, here is my interpretation of what you are asking for: stage ('Execute jobs') { steps { node('node1') { script { parallel_jobs = [:] ...


2

It's possible to use jobDSL from Pipeline. (Im using multibranch pipeline as it allows to configure pipelineTriggers) You can configure your seed job to be a pipeline like this: def gitCredentialsId = 'github-jenkins' def jobsRepoName = 'https://github.com/my-jobs-repo.git' def sharedLibraryRepoName = 'https://github.com/shared-library-repo.git'...


1

Setup pipeline name and default version (e.g. master) in "Global Pipeline Libraries" settings. Then use them in your Jenkinsfile as following #!/usr/bin/env groovy @Library('YourGlobalPipelineName@YourDefaultVersion') _ pipeline { }


1

This might help you with your problem. In the normal pipeline or any Jenkins job, we can define parameters which can be accessed via say ${env.SOME_VARIABLE} My solution for using environment variables in the Jenkins Multibranch Pipeline. Scenario. Say you have a variable named VARIABLE whose value is 123456789. Create a secret text with id and description....


1

You can use Jenkins DSL and pass the environment variable as mentioned in below links: https://jenkins.io/doc/book/pipeline/syntax/#environment https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#withenv-set-environment-variables


1

No, Jenkins file is not created at execution. Actually Jenkins file is a suite of all steps or activity which you want to build as a job or a groovy code. Jenkins file come from code repository, if you added file in your project. Below is a Jenkins file example: pipeline { agent any stages { stage('Build') { steps { ...


1

This is how I did: gitParameter { // The name of the parameter. name('SELECTED_BRANCH') // The type of the list of parameters: Tag - list of all commit tags in repository - returns Tag Name Branch - list of all branch in repository - returns Branch Name Revision - list of all revision sha1 in repository followed by its ...


Only top voted, non community-wiki answers of a minimum length are eligible