Skip to content

Commit b580973

Browse files
author
James Williams
authored
Re-instate use of pyenv (#164)
## What is the goal of this PR? We've re-instated the use of pyenv in certain Factory job definitions. Removing it in favour of using the system python3 had far-reaching ramifications that proved too costly to immediately address. ## What are the changes implemented in this PR? We've re-instated our use of pyenv in the `deploy-pip-*` family of jobs.
1 parent 192ee40 commit b580973

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.factory/automation.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ build:
6666
filter:
6767
owner: vaticle
6868
branch: master
69-
image: vaticle-ubuntu-20.04
69+
image: vaticle-ubuntu-22.04
7070
type: foreground
71-
command: |
71+
command: |
72+
export PYENV_ROOT="/opt/pyenv"
73+
pyenv install 3.7.12
74+
pyenv global 3.7.12
75+
sudo unlink /usr/bin/python3
76+
sudo ln -s $(which python3) /usr/bin/python3
77+
sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.7.12/lib/python3.7/site-packages/lsb_release.py
7278
export DEPLOY_PIP_USERNAME=$REPO_VATICLE_USERNAME
7379
export DEPLOY_PIP_PASSWORD=$REPO_VATICLE_PASSWORD
7480
bazel run --define version=$(git rev-parse HEAD) //grpc/python:deploy-pip -- snapshot
@@ -81,7 +87,14 @@ release:
8187
deployment:
8288
deploy-github:
8389
image: vaticle-ubuntu-22.04
84-
command: |
90+
command: |
91+
export PYENV_ROOT="/opt/pyenv"
92+
pyenv install -s 3.7.12
93+
pyenv global 3.7.12 system
94+
sudo unlink /usr/bin/python3
95+
sudo ln -s $(which python3) /usr/bin/python3
96+
sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.7.9/lib/python3.7/site-packages/lsb_release.py
97+
python3 -m pip install certifi
8598
export NOTES_CREATE_TOKEN=$REPO_GITHUB_TOKEN
8699
bazel run @vaticle_dependencies//tool/release/notes:create -- $FACTORY_OWNER $FACTORY_REPO $FACTORY_COMMIT $(cat VERSION) ./RELEASE_TEMPLATE.md
87100
export DEPLOY_GITHUB_TOKEN=$REPO_GITHUB_TOKEN
@@ -104,8 +117,14 @@ release:
104117
bazel run --define version=$(cat VERSION) //grpc/nodejs:deploy-npm -- release
105118
dependencies: [deploy-github]
106119
deploy-pip-release:
107-
image: vaticle-ubuntu-20.04
120+
image: vaticle-ubuntu-22.04
108121
command: |
122+
export PYENV_ROOT="/opt/pyenv"
123+
pyenv install 3.7.12
124+
pyenv global 3.7.12
125+
sudo unlink /usr/bin/python3
126+
sudo ln -s $(which python3) /usr/bin/python3
127+
sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.7.12/lib/python3.7/site-packages/lsb_release.py
109128
export DEPLOY_PIP_USERNAME=$REPO_PYPI_USERNAME
110129
export DEPLOY_PIP_PASSWORD=$REPO_PYPI_PASSWORD
111130
bazel run --define version=$(cat VERSION) //grpc/python:deploy-pip -- release

0 commit comments

Comments
 (0)