osmith has uploaded this change for review.

View Change

ansible/coverity: extract into subdirectory

The tarball provided by coverity doesn't have the same version in the
name as in the directory inside the tarball.

Tarball:
cov-analysis-linux64-2022.06.tar.gz
Directory:
cov-analysis-linux64-2022.6.0

Work around this by extracting it into a subdirectory and using glob to
match the directory name.

Related: OS#5793
Change-Id: I2b96d1e47f2697706a042937b2852f0fc5032a7b
---
M ansible/roles/install-coverity/tasks/main.yml
1 file changed, 7 insertions(+), 8 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/30418/1
diff --git a/ansible/roles/install-coverity/tasks/main.yml b/ansible/roles/install-coverity/tasks/main.yml
index 5baf6f3..4047fb8 100644
--- a/ansible/roles/install-coverity/tasks/main.yml
+++ b/ansible/roles/install-coverity/tasks/main.yml
@@ -13,9 +13,9 @@
ignore_errors: yes
tags: [coverity]

-- name: create /opt/coverity
+- name: create /opt/coverity/{{ coverity_version }}/
file:
- path: /opt/coverity/
+ path: /opt/coverity/{{ coverity_version }}/
state: directory
when: coverity_copy.failed == False
tags: [coverity]
@@ -23,16 +23,15 @@
- name: unpack coverity
unarchive:
src: "/tmp/{{ coverity_installer_file }}"
- dest: /opt/coverity/
+ dest: /opt/coverity/{{ coverity_version }}
remote_src: yes
when: coverity_copy.failed == False
tags: [coverity]

-- name: create link /opt/coverity/last
- file:
- src: /opt/coverity/cov-analysis-linux64-{{ coverity_version }}
- dest: /opt/coverity/current
- state: link
+- name: create link /opt/coverity/current
+ shell: ln -sf /opt/coverity/{{ coverity_version }}/* /opt/coverity/current
+ args:
+ warn: false
when: coverity_copy.failed == False
tags: [coverity]


To view, visit change 30418. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I2b96d1e47f2697706a042937b2852f0fc5032a7b
Gerrit-Change-Number: 30418
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange