Skip to content

Commit

Permalink
Ensure virtualenv binaries use relative paths
Browse files Browse the repository at this point in the history
This works around the shebang/virtualenv path length limit.
See: pypa/pip#1773

Connects rcbops/u-suk-dev#1080
  • Loading branch information
hughsaunders committed Feb 23, 2017
1 parent aeaf2df commit c97ae94
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pipeline-steps/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def install_ansible(){
# installing pip resets the shebang to be absolute
virtualenv --relocatable .venv
pip install -U ansible pyrax
virtualenv --relocatable .venv
"""
}

Expand Down
2 changes: 2 additions & 0 deletions pipeline-steps/horizon.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ def mitaka_prep() {
if [[ ! -d ".venv" ]]; then
pip install virtualenv
virtualenv .venv
virtualenv --relocatable .venv
fi
source .venv/bin/activate
mv ~/.pip/pip.conf ~/.pip/pip.conf.bak
pip install selenium==2.53.1
pip install -r test-requirements.txt
pip install -r requirements.txt
virtualenv --relocatable .venv
mv ~/.pip/pip.conf.bak ~/.pip/pip.conf
"""
}
Expand Down
2 changes: 2 additions & 0 deletions pipeline-steps/kibana.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def kibana_prep(){
if [ -f ~/.pip/pip.conf ]; then
mv ~/.pip/pip.conf ~/.pip/pip.conf.bak
pip install -r requirements.txt
virtualenv --relocatable .venv
mv ~/.pip/pip.conf.bak ~/.pip/pip.conf
else
pip install -r requirements.txt
virtualenv --relocatable .venv
fi
"""
}
Expand Down
1 change: 1 addition & 0 deletions pipeline-steps/ssh_slave.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def destroy(Map args){
sh """
. ../playbooks/.venv/bin/activate
pip install jenkinsapi
virtualenv --relocatable ../playbooks/.venv
python jenkins_node.py \
delete --name "${args.instance_name}"
"""
Expand Down
1 change: 1 addition & 0 deletions playbooks/setup-jenkins-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
cd {{ lookup('env', 'WORKSPACE') }}/rpc-gating/playbooks
. .venv/bin/activate
pip install jenkinsapi
virtualenv --relocatable .venv
python ../scripts/jenkins_node.py \
create \
--name {{inventory_hostname}} \
Expand Down
1 change: 1 addition & 0 deletions rpc-jobs/install-jenkins-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
sh """#!/bin/bash
. .venv/bin/activate
pip install urllib3==1.18.1
virtualenv --relocatable .venv
"""
common.venvPlaybook(
playbooks: ["playbooks/install_jenkins_plugins.yml"],
Expand Down
1 change: 1 addition & 0 deletions rpc-jobs/jjb-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
source .venv/bin/activate
pip install jenkins-job-builder
virtualenv --relocatable .venv
cat > jenkins_jobs.ini << EOF
[job-builder]
Expand Down

0 comments on commit c97ae94

Please sign in to comment.