Skip to content
Snippets Groups Projects
Commit 590380d4 authored by Emanuele Aina's avatar Emanuele Aina Committed by Vignesh Raman
Browse files

Fetch cached data from GitLab itself


Retrieving the published data can be complicated on downstream
deployment where the data is auth protected.

Since GitLab stores it as an artifact accessible using the job token,
use it to side-step the issue.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 7a0524b9
No related branches found
No related tags found
1 merge request!107Fetch cached data from GitLab itself
......@@ -18,7 +18,6 @@ variables:
For instance use `*` to process all updates, `dash` to only process `pkg/dash`.
Leave it empty to not trigger any update.
value: ""
DASHBOARD_DATA: https://infrastructure.pages.apertis.org/dashboard/packaging.yaml
stages:
- lint
......@@ -87,15 +86,17 @@ packaging-data-fetch-downstream:
wget
script:
- CACHE_ARGS=""
- ARTIFACT_URL=${ARTIFACT_URL:-$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_DEFAULT_BRANCH/raw/public/packaging.yaml?job=pages}
- |
if [ -n "$DASHBOARD_DATA" ]
if [ "$ARTIFACT_URL" != none ]
then
wget "$DASHBOARD_DATA" -O packaging.yaml || true
wget --header "JOB-TOKEN: $CI_JOB_TOKEN" "$ARTIFACT_URL" -O cache.yaml
fi
- |
if [ -f packaging.yaml ]
if [ -e cache.yaml ]
then
CACHE_ARGS="--cache packaging.yaml"
echo Load cacheable data from cache.yaml
CACHE_ARGS="--cache cache.yaml"
fi
- ./bin/packaging-data-fetch-downstream
--gitlab-api-token "${DASHBOARD_GITLAB_API_TOKEN}"
......
......@@ -42,6 +42,7 @@ if __name__ == "__main__":
print("set -eux")
print(f"FILTER=pkg/{args.filter_packages or '*'}")
print("ARTIFACT_URL=none")
print("TRIGGER_UPDATES=")
print("TRIGGER_FROM_JOB=")
print("DASHBOARD_OSCRC=")
......@@ -49,6 +50,7 @@ if __name__ == "__main__":
print("CI_SERVER_URL=")
print("CI_PROJECT_URL=")
print("CI_JOB_URL=")
print("CI_JOB_TOKEN=")
print("CI_PIPELINE_URL=")
print("CI_COMMIT_REF_NAME=wip/test")
if args.loglevel == logging.DEBUG:
......
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