-
Bug
-
Resolution: Fixed
-
Minor
-
Jenkins ver. 2.89.3
Bitbucket Plugin ver. 2.4.2
Kubernetes-plugin ver. 1.8.4
Openshift ver. 3.10
Hi,
We're having a problem when we define the pod configuration over the pipeline, we're lossing the vars injected by the Bitbucket Plugin (from the payload hook).
If we define the agent to use from a label (previously configurated in the pod template on the kubernetes config) we've the envs.
Jenkinsfile Head:
pipeline { agent{ node('pod-label') } stages { ..... ENVs: . GIT_URL=[https://bitbucket.*******|https://bitbucket.%2A%2A%2A%2A%2A%2A%2A/] GIT_BRANCH=develop .
But, in the other way:
Jenkinsfile Head:
pipeline { agent { kubernetes { label 'power-pod' inheritFrom 'pod-label' containerTemplate { name 'jnlp' args '${computer.jnlpmac} ${computer.name}' resourceLimitMemory '6Gi' image 'registry/image:latest' } }
This envs doesn't exist, the error over the pipeline is provocated by:
code:
def TEMP_VAR= env.GIT_URL ?: env.GIT_URL_1 GIT_SPLIT_URL= TEMP_VAR.substring(0,TEMP_VAR.lastIndexOf(".")) error: java.lang.NullPointerException: Cannot invoke method lastIndexOf() on null object
Thanks,
Regards.