jenkins-pipeline

Jenkins generate new parameters based on another parameter value

给你一囗甜甜゛ 提交于 2021-02-17 05:01:22
问题 I have a choice parameter called 'Data Center' which has two values DC01 and DC02. If user chooses DC01 I want few other build parameters to show up, if he chooses DC02 I want other parameters to show up. Is there any way to do it? If user chooses DC01, I want two more fields such as 'hostname' and 'IP address' which are just text fields. I have tried using Active Choice Plugin, but I don't think we can generate text field parameters using that. Can anyone help? 回答1: We can generate text

How can I male groovy on Jenkins mask the output of a variable the same way it does for credentials?

无人久伴 提交于 2021-02-17 03:59:05
问题 Is there a way in groovy on Jenkins to take an arbitrary String variable - say the result of an API call to another service - and make Jenkins mask it in console output as it does automatically for values read in from the Credentials Manager? 回答1: UPDATED SOLUTION: To hide the output of a variable you can use the Mask Password Plugin Here is an exemple: String myPassword = 'toto' node { println "my password is displayed: ${myPassword}" wrap([$class: 'MaskPasswordsBuildWrapper',

Importing class from git - unable to resolve class

馋奶兔 提交于 2021-02-15 07:52:31
问题 I am constructing a Shared Library which I want to have class definitions, such as: package com.org.pipeline.aws String family JsonObject taskDefinition class TaskDefinition { def getTaskDefinition(family) { def jsonSlurper = new groovy.json.JsonSlurper() def object = slurper.parseText( sh(returnStdout: true, script: "aws ecs describe-task-definition --task-definition ${family}" ) ) return assert object instanceof Map taskDefinition = object["taskDefinition"] } } And I am importing it via a

How can I use different private docker agents based on parameter in Jenkins declarative pipeline?

喜夏-厌秋 提交于 2021-02-13 17:10:06
问题 I am trying to choose a different docker agent from a private container registry based on an a parameter in Jenkins pipeline. For my example let's say I have 'credsProd' and 'credsTest' saved in the credentials store. My attempt is as follows: pipeline { parameters { choice( name: 'registrySelection', choices: ['TEST', 'PROD'], description: 'Is this a deployment to STAGING or PRODUCTION environment?' ) } environment { URL_VAR = "${env.registrySelection == "PROD" ? "urlProd.azure.io" :

How can I use different private docker agents based on parameter in Jenkins declarative pipeline?

拥有回忆 提交于 2021-02-13 17:05:51
问题 I am trying to choose a different docker agent from a private container registry based on an a parameter in Jenkins pipeline. For my example let's say I have 'credsProd' and 'credsTest' saved in the credentials store. My attempt is as follows: pipeline { parameters { choice( name: 'registrySelection', choices: ['TEST', 'PROD'], description: 'Is this a deployment to STAGING or PRODUCTION environment?' ) } environment { URL_VAR = "${env.registrySelection == "PROD" ? "urlProd.azure.io" :

How can I use different private docker agents based on parameter in Jenkins declarative pipeline?

谁都会走 提交于 2021-02-13 17:04:11
问题 I am trying to choose a different docker agent from a private container registry based on an a parameter in Jenkins pipeline. For my example let's say I have 'credsProd' and 'credsTest' saved in the credentials store. My attempt is as follows: pipeline { parameters { choice( name: 'registrySelection', choices: ['TEST', 'PROD'], description: 'Is this a deployment to STAGING or PRODUCTION environment?' ) } environment { URL_VAR = "${env.registrySelection == "PROD" ? "urlProd.azure.io" :

Does all the plugins present in the avaliable tab compatible with the version of master jenkins?

 ̄綄美尐妖づ 提交于 2021-02-11 17:15:35
问题 Say if I have 2 Jenkins master A: Jenkins version2.22 B: Jenkins version 2.35 So when I go to manage Jenkins --> manage plugins I see available plugins. Does that mean that all the plugins listed in available plugins are compatible with that particular version of Jenkins? For Eg: Available plugins in Jenkins master A are compatible with 2.22 versions of Jenkins. and Available plugins in Jenkins master B are compatible with 2.35 version Jenkins. 回答1: Jenkins shows the latest plugins' versions

Does all the plugins present in the avaliable tab compatible with the version of master jenkins?

佐手、 提交于 2021-02-11 17:15:29
问题 Say if I have 2 Jenkins master A: Jenkins version2.22 B: Jenkins version 2.35 So when I go to manage Jenkins --> manage plugins I see available plugins. Does that mean that all the plugins listed in available plugins are compatible with that particular version of Jenkins? For Eg: Available plugins in Jenkins master A are compatible with 2.22 versions of Jenkins. and Available plugins in Jenkins master B are compatible with 2.35 version Jenkins. 回答1: Jenkins shows the latest plugins' versions

Does all the plugins present in the avaliable tab compatible with the version of master jenkins?

安稳与你 提交于 2021-02-11 17:15:02
问题 Say if I have 2 Jenkins master A: Jenkins version2.22 B: Jenkins version 2.35 So when I go to manage Jenkins --> manage plugins I see available plugins. Does that mean that all the plugins listed in available plugins are compatible with that particular version of Jenkins? For Eg: Available plugins in Jenkins master A are compatible with 2.22 versions of Jenkins. and Available plugins in Jenkins master B are compatible with 2.35 version Jenkins. 回答1: Jenkins shows the latest plugins' versions

Deploying Azure Webjobs from Jenkins pipeline

筅森魡賤 提交于 2021-02-11 17:00:04
问题 Please guide me to setup the procedure how to deploy the azure web jobs from Jenkins Pipeline. I have gone through the google of searching the documentation but couldn't able to make it. 回答1: After many tests I did it by adding the OutputPath parameter in the deploy script and deleting the folder before. The script looks like this: dir('Publish'){ deleteDir() } bat "\"${tool 'Your MS Build'}\" Path_To_Project.csproj /p:Configuration=Release /p:DeployOnBuild=true /p:AllowUntrustedCertificate