Re: Conditional pipeline not working

2020-04-01 Thread Ramadoni
Hi, Really thanks for your explanation, i just configure using multibranch project, and i have new problem that github webhook not running in multibranch project... Anyway thanks so much. Regards, Kurusetra On Tue, Mar 31, 2020 at 9:47 PM Gianluca wrote: > Hi, > environment variables like

Re: Conditional pipeline not working

2020-03-31 Thread Gianluca
Hi, environment variables like "env.BRANCH_NAME" are not part of Jenkins core itself ... they are injected by additional plugins. So, yes, you have to use "Multibranch" project type ... because it's that project that will inject that environment variables from what I know. Look at the section

Re: Conditional pipeline not working

2020-03-31 Thread Ramadoni
Hi, I'm using freestyle project type, it should be "Multibranch" project type? Yes, i'm sure that my project is configured to checkout "master" branch. > git show-ref --tags -d # timeout=10 > Checking out Revision a57c28b1efb0749a9b89b72b540557e226b116bd (origin/master) > > git config

Re: Conditional pipeline not working

2020-03-31 Thread Gianluca
Hi, we are using if (env.BRANCH_NAME == 'master') in our pipeline and works great... so, if you tried with the line above ... this means that there is an error on how the pipeline is configured and run. Are you using Multibranch project type? Are you sure your project is configured to checkout

Re: Conditional pipeline not working

2020-03-31 Thread kurusetra
Hi, Already changed from 'origin/master' to 'master' but still no luck, pipeline still build the 'dev' image dan deploy to namespace 'dev', even i commit in 'master' branch... Yes i'm using github.com for codes repository... Thanks Kurusetra On Tuesday, March 31, 2020 at 9:00:40 PM UTC+7,

Re: Conditional pipeline not working

2020-03-31 Thread Gianluca
We use similar conditionals ... and I think your error is in the branch name: env.BRANCH_NAME == 'origin/master' that should be instead: env.BRANCH_NAME == 'master' Because, if I'm guessing right, you are using Git ... and then the first part is the remote name, not the branch: / :-) So,

Conditional pipeline not working

2020-03-31 Thread kurusetra
Hi, I just created jenkinsfile for deploy sample application to my k8s, but the deployment always build "dev" image and deploy to dev namespace in k8s. i tried to commit in master branch but still build "dev" image dan deploy to "dev" namespace in k8s. Please advice... whats wrong with my