Hi,
So many ways to do the same:
- have credentials name with branch name in (my personal choise)
- define a pipeline method to switch/read map
- imbrication of ternary operator
Arnaud
Le lun. 5 déc. 2022, 10:11, Victor Sudakov a écrit :
> What would you do if you needed multiple branches with
What would you do if you needed multiple branches with multiple choices
of variables, like a "case" or "if ... else ... elif" operators?
On 02.12.2022 13:33, Arnaud bourree wrote:
environment {
SERVICE_KEY = credentials("${env.BRANCH_NAME.equals('master') ?
'PROD_SERVICE_KEY' : 'SERVICE_KE
environment {
SERVICE_KEY = credentials("${env.BRANCH_NAME.equals('master') ?
'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")
Le ven. 2 déc. 2022, 03:05, Victor Sudakov a écrit :
> Hello Arnaud,
>
> Can you please post the whole line within environment{} as you suggest it
> should look?
>
> On 02.12.20
Hello Arnaud,
Can you please post the whole line within environment{} as you suggest
it should look?
On 02.12.2022 03:47, Arnaud bourree wrote:
Hi,
env.master'.equals(env.BRANCH_NAME) is String as 'master' is.
Try 'master'.equals(env.BRANCH_NAME) instead of
env.BRANCH_NAME == 'master'
Le me
Hi,
env.master'.equals(env.BRANCH_NAME) is String as 'master' is.
Try 'master'.equals(env.BRANCH_NAME) instead of
env.BRANCH_NAME == 'master'
Le mer. 30 nov. 2022, 05:24, Victor Sudakov a écrit :
> This syntax may be operational, but I need more testing:
>
> environment {
>
> SERVICE_KEY = cr
This syntax may be operational, but I need more testing:
environment {
SERVICE_KEY = credentials("${env.BRANCH_NAME == 'master' ?
'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")
}
On 30.11.2022 09:53, Victor Sudakov wrote:
Have you tested your suggestion?
For me,
SERVICE_KEY_S = credentials(env
Have you tested your suggestion?
For me,
SERVICE_KEY_S = credentials(env.BRANCH_NAME == 'STAGE-NOV28' ?
'SERVICE_KEY' : 'PROD_SERVICE_KEY')
thows the error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
WorkflowScript: 40: Internal function call parameters
Try
credentials(env.BRANCH_NAME='main' ? 'PROD_CLIENT_ID' : 'DEV...')
or some syntax like that..
On Mon, 28 Nov 2022, 06:05 Victor Sudakov, wrote:
> Dear Colleagues,
>
> Can you please suggest a way to use different credentials depending on the
> Git
> branch in a multi-branch pipeline? In oth
Hello John,
I use folders too to organize jobs together and to keep credentials in separate
domains. However, the automatic creation of jobs based on git branches is
important to me therefore I use MultiBranch pipelines.
Do I understand correctly that you have scripted your own implementation of
Due to similar issues, I changed how I was doing it from a single
MultiBranch project.
I've now separate projects for each environment, also use
https://plugins.jenkins.io/cloudbees-folder to create prod and dev folders
which container the environment specific values.
Have a groovy script that crea
10 matches
Mail list logo