From d0fe583f7f18206424868f73006a25fa78ac39c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?I=C3=B1igo=20Moreno?= <inigo.moreno@tecnalia.com>
Date: Wed, 22 Sep 2021 10:08:03 +0200
Subject: [PATCH] Test artifacts

---
 ci-templates/core.yml                    | 1 +
 ci-templates/industrial-ci-templates.yml | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ci-templates/core.yml b/ci-templates/core.yml
index 859514f..80029b7 100644
--- a/ci-templates/core.yml
+++ b/ci-templates/core.yml
@@ -21,6 +21,7 @@ stages:
 before_script:
   - apk add --update bash coreutils tar wget
   - docker login tecnalia-docker-dev.artifact.tecnalia.com -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
+  - pip install anybadge
 
 include :
   - ci-templates/syntax-check.yml
diff --git a/ci-templates/industrial-ci-templates.yml b/ci-templates/industrial-ci-templates.yml
index 9f2516f..f982450 100644
--- a/ci-templates/industrial-ci-templates.yml
+++ b/ci-templates/industrial-ci-templates.yml
@@ -6,13 +6,20 @@
     - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config
     - docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
     - docker login tecnalia-docker-dev.artifact.tecnalia.com -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
-  script: .ci_config/gitlab.sh
+  script:
+    - RET=0 && VALUE=passing
+    - .ci_config/gitlab.sh || RET=1 && VALUE=failed
+    - mkdir -p ./badges && anybadge -v $VALUE --label=$ROS_DISTRO -o --file badges/$ROS_DISTRO.svg passing=green failed=red
+    - exit $RET
   variables:
     DOCKER_IMAGE: "${ARTIFACT_DOCKER_URL}/flexbotics-base-devel:${ROS_DISTRO}"
     ADDITIONAL_DEBS: curl
     PARALLEL_BUILDS: 2 # keep this for now, since there seems to be memory limit issues in the ci VM
     AFTER_SETUP_TARGET_WORKSPACE: "rosenv && bash <(curl -Ls https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/scripts/ci_run_entry_points.sh) $$current_ws"
     CMAKE_ARGS: -DCMAKE_CXX_FLAGS=-Wno-ignored-attributes -Wno-int-in-bool-context
+  artifacts:
+    paths:
+      ./badges
 
 
 .industrial_ci_deploy:
-- 
GitLab