Unverified Commit 2bd85c05 authored by Min Xu's avatar Min Xu Committed by GitHub
Browse files

[chore] fix pyenv download cache (#997)



* [chore] fix pyenv download cache

* fix
Co-authored-by: default avatarMin Xu <min.xu.public@gmail.com>
parent c4af33b6
......@@ -230,6 +230,11 @@ commands:
version:
type: string
steps:
# Cache the pyenv download directory to avoid re-downloading over and over.
- restore_cache:
keys:
- cache-key-pyenv-3-9-7-v1
- run:
name: Setup pyenv
# We used to use the following commands to update pyenv.
......@@ -237,13 +242,22 @@ commands:
# pyenv update
# However, it is not deterministic since pyenv is being updated.
# It is now fixed to a version. (v2.3.0 is broken since it cause bash to fail when it try to do "eval $(pyenv init -)")
#
# We use "-sf" to skip already installed version after cache restoring the pyenv dir. This should avoid redoing
# downloading and installing. The key name has a "v1" in the end so that we can debug and try different cache objects
# while doing development.
command: |
cd /opt/circleci/.pyenv/
git remote update
git checkout v2.2.0
pyenv install -f <<parameters.version>>
pyenv install -sf <<parameters.version>>
pyenv global <<parameters.version>>
- save_cache:
paths:
- /opt/circleci/.pyenv
key: cache-key-pyenv-3-9-7-v1
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment