puzzle / jenkins-pipeline-shared-libraries

Shared functionality for Jenkins Pipeline Groovy scripts.
GNU General Public License v3.0
10 stars 13 forks source link

Tool discovery in dockerized Pipelines #55

Open SylivanKenobi opened 11 months ago

SylivanKenobi commented 11 months ago

If the pipeline runs in a docker container on a VM-Node the SharedLibrary can't find tools from inside the container because it only searches on the vm itself. In my Opinion this Method has to be extended to also search the PATH in the container.

As a workaround the path for the tool can be set manually:

environment {
  executable_kustomize_path = "/usr/local/bin"
}

Example Pipeline:

pipeline {
  agent {
    docker {
      image 'line/kubectl-kustomize'
      label 'docker'
    }
  }
  stages {
    stage('Test') {
      steps {
        kustomize("path/to/yamls")
      }
    }
  }
}