Skip to content
Snippets Groups Projects
Commit 3342af4b authored by Dylan Aïssi's avatar Dylan Aïssi Committed by Andrej Shadura
Browse files

group-package-centric-tpl: pass an header with JOB-TOKEN to curl


In order to retrieve artifacts from private gitlab projects,
we need to pass the gitlab CI_JOB_TOKEN as header to curl
otherwise access is not granted.

Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent 057e3b51
No related branches found
No related tags found
1 merge request!591Fix token usage for private git repositories and retrieve source package from the build-source job instead of obs-capture
......@@ -26,13 +26,13 @@ job_name: Run {{SOURCE_PKG_NAME}}-in-{{image_name}}
- #systemctl restart systemd-timesyncd
{%- endif %}
- apt update -q && apt install curl unzip -q -y
- curl -O {{BUILD_RESULTS_URL}}/artifacts-list.txt
- 'curl -H "JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}" -O {{BUILD_RESULTS_URL}}/artifacts-list.txt'
- BIN_PKG_LIST="{{BIN_PKG_LIST}}"
- |
for DEB in ${BIN_PKG_LIST}
do
DEB_PATH=$(grep "${DEB}_.*_{{arch}}\.deb$" artifacts-list.txt)
curl -O {{BUILD_RESULTS_URL}}/${DEB_PATH}
curl -H "JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}" -O {{BUILD_RESULTS_URL}}/${DEB_PATH}
done
- sudo apt install ./*.deb -q -y
from: inline
......@@ -44,9 +44,9 @@ job_name: Run {{SOURCE_PKG_NAME}}-in-{{image_name}}
name: "Run {{SOURCE_PKG_NAME}} test"
run:
steps:
- curl -O {{BUILD_RESULTS_URL}}/artifacts-list.txt
- 'curl -H "JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}" -O {{BUILD_RESULTS_URL}}/artifacts-list.txt'
- DEBTAR_PATH=$(grep -m 1 "{{ SOURCE_PKG_NAME }}.*\.debian\.tar\.xz$" artifacts-list.txt)
- curl --output {{SOURCE_PKG_NAME}}.debian.tar.xz {{BUILD_RESULTS_URL}}/${DEBTAR_PATH}
- 'curl -H "JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}" --output {{SOURCE_PKG_NAME}}.debian.tar.xz {{BUILD_RESULTS_URL}}/${DEBTAR_PATH}'
- tar -xf {{SOURCE_PKG_NAME}}.debian.tar.xz
- mkdir -p debian/tests/
- cd debian/tests/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment