macros, docs, releng: Use `sudo -H` pip install 83/62883/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 24 Sep 2018 15:13:00 +0000 (17:13 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 24 Sep 2018 15:13:00 +0000 (17:13 +0200)
This is still far from a clean and secure approach, as `pip install`
should not be ran with `sudo`.
However, `-H` limits the area we touch and also fixes some incompat
between disto-provided pip and pip-provided pip.

Change-Id: I0e19dfeaf66f6f453e3868c71016305ae050f0c8
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
jjb/global/releng-macros.yaml
jjb/opnfvdocs/docs-rtd.yaml
jjb/releng/releng-release-create-venv.sh

index 8055fdb..fe24ed5 100644 (file)
       - shell: |
           #!/bin/bash
           # Install python package
-          sudo pip install "flake8==2.6.2"
+          sudo -H pip install "flake8==2.6.2"
 
           echo "Checking python code..."
           for f in $(egrep '\.py$' modified_files)
       - shell: |
           #!/bin/bash
           # sudo Install python packages
-          sudo pip install "yamllint==1.8.2"
+          sudo -H pip install "yamllint==1.8.2"
 
           echo "Checking yaml file..."
           for f in $(egrep '\.ya?ml$' modified_files)
index ece8569..fc99bd3 100644 (file)
@@ -88,7 +88,7 @@
               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
           fi
       - shell: |
-          sudo pip install virtualenv
+          sudo -H pip install virtualenv
           virtualenv $WORKSPACE/venv
           . $WORKSPACE/venv/bin/activate
           pip install --upgrade pip
index 0d5635b..de585fd 100644 (file)
@@ -10,7 +10,7 @@
 set -e -o pipefail
 echo "---> Create virtualenv"
 
-sudo pip install virtualenv
+sudo -H pip install virtualenv
 virtualenv $WORKSPACE/venv
 # shellcheck source=$WORKSPACE/venv/bin/activate disable=SC1091
 source $WORKSPACE/venv/bin/activate