Skip to content

Commit

Permalink
Fix CI issues
Browse files Browse the repository at this point in the history
Fixes following:-
- download the different version pip file
- add project dir to git safe to allow installation
  with pip, more details in [1]

[1] https://bugs.launchpad.net/devstack/+bug/1968798

Change-Id: Iedcf4207b51424c11625e34f146ebd67df2dc4c5
  • Loading branch information
chenhb-zte authored and karelyatin committed Jun 29, 2022
1 parent 2359cd4 commit 165c21e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
11 changes: 10 additions & 1 deletion tests/ci/playbooks/rally-install-pre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@
- name: Install pip3 if needed
when: os_distro == "CentOS 7" or os_distro == "Ubuntu 18.04" or os_distro == "Ubuntu 20.04"
shell:
executable: /bin/bash
chdir: '{{ zuul.project.src_dir }}'
cmd: |
curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python_version=`python3 --version`
python_version=`echo $python_version |awk '{print $2}'`
echo $python_version
if [[ $python_version =~ ^3.6 ]]; then
pip_url=https://bootstrap.pypa.io/pip/3.6/get-pip.py
else
pip_url=https://bootstrap.pypa.io/get-pip.py
fi
curl $pip_url -o /tmp/get-pip.py
sudo python3 /tmp/get-pip.py
- name: Update pip3 if needed
Expand Down
5 changes: 5 additions & 0 deletions tests/ci/playbooks/rally-install-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
become: yes
when: bindep_output.stdout_lines

# Required for https://bugs.launchpad.net/devstack/+bug/1968798
- name: Configure project src_dir as git safe
become: yes
command: git config --system --add safe.directory {{ ansible_user_dir }}/{{ zuul.project.src_dir }}

- name: Install Rally system wide
shell:
executable: /bin/sh
Expand Down
8 changes: 7 additions & 1 deletion tests/ci/playbooks/tox-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@
executable: /bin/bash
cmd: |
set -e
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
pip_url="https://bootstrap.pypa.io/get-pip.py"
if [ "{{ python_version.stdout }}" = "3.6" ]; then
pip_url="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
elif [ "{{ python_version.stdout }}" = "3" ]; then
pip_url="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
fi
curl $pip_url -o get-pip.py
python{{ python_version.stdout }} get-pip.py --force-reinstall
- name: Install python tox
Expand Down

0 comments on commit 165c21e

Please sign in to comment.