Skip to content

Commit

Permalink
ansible: use explicit tap2junit version
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Mar 31, 2023
1 parent 76fd047 commit ebc4c17
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 28 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/baselayout-windows/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# Necessary for junit output in Jenkins jobs
- name: install tap2junit
win_command: 'pip3 install --upgrade tap2junit'
win_command: 'pip3 install --upgrade tap2junit=={{ tap2junit_version }}'

# Necessary for the libuv test job
- block:
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/baselayout-windows/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
tap2junit_version: 0.1.6
9 changes: 8 additions & 1 deletion ansible/roles/baselayout/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@
alternatives:
link: "/usr/bin/python3"
name: python3
path: "/usr/bin/python3.7"
path: "/usr/bin/python3.9"

- name: ubuntu1804 | update python package alternatives
when: os == "ubuntu1804"
alternatives:
link: "/usr/bin/python3"
name: python3
path: "/usr/bin/python3.8"

- name: freebsd | update python package alternatives
when: os == "freebsd12"
Expand Down
7 changes: 4 additions & 3 deletions ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ packages: {
smartos18: [
'gcc7',
'ccache',
'python37'
'python37',
'py37-pip'
],

smartos20: [
Expand All @@ -183,12 +184,12 @@ packages: {

# Default gcc/g++ package is 5.
ubuntu1604: [
'gcc-8,g++-8,gcc-6,g++-6,python3.7,python3.7-distutils',
'gcc-8,g++-8,gcc-6,g++-6,python3.9,python3.9-distutils',
],

# Default gcc/g++ package is 7.
ubuntu1804: [
'gcc-6,g++-6,gcc-8,g++-8',
'gcc-6,g++-6,gcc-8,g++-8,python3.8',
],

ubuntu2204: [
Expand Down
15 changes: 5 additions & 10 deletions ansible/roles/jenkins-worker/tasks/partials/tap2junit/aix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
# aix: python2.7 is default
#

- name: check if pip exists
stat:
path: /usr/bin/pip
register: pip_exists

- name: download get-pip.py
get_url:
url: https://bootstrap.pypa.io/get-pip.py
dest: /home/iojs/get-pip.py
when: pip_exists.stat.exists == False

- name: Locate Python 3
changed_when: No
Expand All @@ -22,28 +17,28 @@

- name: install pip AIX71
raw: /opt/freeware/bin/python3 /home/iojs/get-pip.py
when: pip_exists.stat.exists == False and os == "aix71"
when: os == "aix71"

- name: install pip AIX72
ansible.builtin.command: python3 /home/iojs/get-pip.py
when: pip_exists.stat.exists == False and os == "aix72"
when: os == "aix72"

- name: create symbolic link AIX71
file:
src: "/opt/freeware/bin/pip"
dest: "/usr/bin/pip"
state: link
when: pip_exists.stat.exists == False and os == "aix71"
when: os == "aix71"

- name: create symbolic link AIX72
file:
src: "{{ python3_path.stdout | dirname }}/pip"
dest: "/usr/bin/pip"
state: link
when: pip_exists.stat.exists == False and os == "aix72"
when: os == "aix72"

- name: install tap2junit
pip:
name: tap2junit
name: tap2junit=={{ tap2junit_version }}
state: present
executable: /usr/bin/pip
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: install tap2junit
ansible.builtin.pip:
name: tap2junit
name: tap2junit=={{ tap2junit_version }}
state: present
executable: /usr/bin/pip3
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
- name: install tap2junit
pip:
executable: pip3
name: tap2junit
name: tap2junit=={{ tap2junit_version }}
state: present
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

- name: install tap2junit
pip:
name: tap2junit
name: tap2junit=={{ tap2junit_version }}
state: present
executable: /usr/bin/pip3
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

- name: install tap2junit
pip:
name: tap2junit
name: tap2junit=={{ tap2junit_version }}
state: latest
executable: /usr/local/bin/pip3
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#

- name: install tap2junit
pip: name=tap2junit state=present
pip: name=tap2junit=={{ tap2junit_version }} state=present
15 changes: 11 additions & 4 deletions ansible/roles/jenkins-worker/tasks/partials/tap2junit/smartos.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
---

#
# smartos: python 2.7
# smartos
#

- name: install pip
package: name=py27-pip state=present
- name: smartos | update pip3 symlink
when: os == "smartos18"
file:
dest: "/opt/local/bin/pip3"
state: link
src: "/opt/local/bin/pip3.7"

- name: install tap2junit
pip: name=tap2junit state=present
pip:
executable: /opt/local/bin/pip3
name: tap2junit=={{ tap2junit_version }}
state: present
16 changes: 13 additions & 3 deletions ansible/roles/jenkins-worker/tasks/partials/tap2junit/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
---

#
# ubuntu series: python 2.7
# ubuntu series
#

# Install pip via `get-pip.py`.
- name: download pip install script
ansible.builtin.get_url:
dest: "{{ home }}/{{ server_user }}/get-pip.py"
url: https://bootstrap.pypa.io/get-pip.py

- name: install pip
package: name=python-pip state=present
ansible.builtin.shell:
cmd: python3 {{ home }}/{{ server_user }}/get-pip.py

- name: install tap2junit
pip: name=tap2junit state=present
pip:
name: tap2junit=={{ tap2junit_version }}
state: present
executable: pip3
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
package: name=python3-pip state=present

- name: install tap2junit
pip: name=tap2junit state=present
pip:
name: tap2junit=={{ tap2junit_version }}
state: present
executable: /usr/bin/pip3
2 changes: 2 additions & 0 deletions ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ jobs_variants: {
arm64: '3',
smartos: '2'
}

tap2junit_version: 0.1.6

0 comments on commit ebc4c17

Please sign in to comment.