Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36221

Add workflow support for pyenv-plugin

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • pyenv-plugin
    • Jenkins 2.10/Ubuntu 16

      It would be nice to have workflow support for the pyenv-plugin, maybe as a wrapper? A tool would be cool too... With the plugin installed currently, this can be somewhat achieved by simply hacking out the locations and using pyenv as is.

          env.PYENV_VERSION = "2.7.11"
          env.PYENV_ROOT = "${env.HOME}/.pyenv"
          env.PATH = "${env.PYENV_ROOT}/shims:${env.PYENV_ROOT}/bin:${env.PATH}"
          // -s flag will only download 2.7.11 if it doesn't exist already
          sh "pyenv install -s ${env.PYENV_VERSION}; eval \"\$(pyenv init -)\"; pyenv shell ${env.PYENV_VERSION}"
      

      There is a problem with this though. pyenv can run into concurrency issues while re-hashing. The plugin actually seems to have support for handling this with a file lock, but it would be a bit complicated to "redo" that functionality in a pipeline. I imagine it would be more beneficial just to expose this as a wrapper or installable version tools.

      Some references to the current semaphore locking system:
      https://github.com/yyuu/pyenv/issues/174#issuecomment-58499673
      https://github.com/jenkinsci/pyenv-plugin/blob/master/lib/pyenv.rb#L24

            Unassigned Unassigned
            mtraynham Matt Traynham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: