From 82790dfefc98686fb268a75f76ba44a7f09f133c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20Benn=C3=A9e?= Date: Wed, 15 Mar 2023 17:43:03 +0000 Subject: [PATCH] scripts/ci: update gitlab-runner playbook to handle CentOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This was broken when we moved to using the pre-built packages as we didn't take care to ensure we used RPMs where required. NB: I could never get this to complete on my test setup but I suspect this was down to network connectivity and timeouts while downloading. Fixes: 69c4befba1 (scripts/ci: update gitlab-runner playbook to use latest runner) Signed-off-by: Alex Bennée Message-Id: <20230315174331.2959-5-alex.bennee@linaro.org> --- scripts/ci/setup/gitlab-runner.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/ci/setup/gitlab-runner.yml b/scripts/ci/setup/gitlab-runner.yml index 95d4199c03..1a1b270ff2 100644 --- a/scripts/ci/setup/gitlab-runner.yml +++ b/scripts/ci/setup/gitlab-runner.yml @@ -48,13 +48,29 @@ - debug: msg: gitlab-runner arch is {{ gitlab_runner_arch }} - - name: Download the matching gitlab-runner + - name: Download the matching gitlab-runner (DEB) get_url: dest: "/root/" url: "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_{{ gitlab_runner_arch }}.deb" + when: + - ansible_facts['distribution'] == 'Ubuntu' + + - name: Download the matching gitlab-runner (RPM) + get_url: + dest: "/root/" + url: "https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_{{ gitlab_runner_arch }}.rpm" + when: + - ansible_facts['distribution'] == 'CentOS' - - name: Install gitlab-runner via package manager + - name: Install gitlab-runner via package manager (DEB) apt: deb="/root/gitlab-runner_{{ gitlab_runner_arch }}.deb" + when: + - ansible_facts['distribution'] == 'Ubuntu' + + - name: Install gitlab-runner via package manager (RPM) + yum: name="/root/gitlab-runner_{{ gitlab_runner_arch }}.rpm" + when: + - ansible_facts['distribution'] == 'CentOS' - name: Register the gitlab-runner command: "/usr/bin/gitlab-runner register --non-interactive --url {{ gitlab_runner_server_url }} --registration-token {{ gitlab_runner_registration_token }} --executor shell --tag-list {{ ansible_facts[\"architecture\"] }},{{ ansible_facts[\"distribution\"]|lower }}_{{ ansible_facts[\"distribution_version\"] }} --description '{{ ansible_facts[\"distribution\"] }} {{ ansible_facts[\"distribution_version\"] }} {{ ansible_facts[\"architecture\"] }} ({{ ansible_facts[\"os_family\"] }})'" -- 2.11.0