From 33d41214980927458ed0f0466cb0e88ce4c7ce6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=A1gr?= Date: Thu, 3 Feb 2022 21:15:20 +0100 Subject: [PATCH] Ci opstools fix (#85) (#87) * Fix centos-opstools repo in CI * Avoid gpgcheck for centos repo * ... also in repo file * Update .github/workflows/integration.yml Co-authored-by: Matthias Runge * Update .github/workflows/tests.yml Co-authored-by: Matthias Runge Co-authored-by: Leif Madsen Co-authored-by: Matthias Runge (cherry picked from commit 04fc6914eaff79d50853249d7ad9dcdaabd05d9a) --- .github/workflows/integration.yml | 5 +++-- .github/workflows/tests.yml | 3 ++- build/repos/opstools.repo | 19 ++++++++++++++++--- ci/integration/logging/run_bridge.sh | 10 ++-------- ci/integration/logging/run_sg.sh | 10 ++-------- ci/unit/run_tests.sh | 10 ++-------- 6 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ca383094..b0590838 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,6 +1,7 @@ name: Integration testing env: PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core + OPSTOOLS_REPO: https://git.centos.org/rpms/centos-release-opstools/raw/c8s-sig-opstools/f/SOURCES/CentOS-OpsTools.repo QDR_IMAGE: quay.io/interconnectedcloud/qdrouterd:1.15.0 QDR_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/qdr:/etc/qpid-dispatch:ro" @@ -57,7 +58,7 @@ jobs: - name: Start sg-bridge with same branch if: steps.bridge_branch.outcome == 'success' run: | - docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host \ + docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host -e OPSTOOLS_REPO \ -e GITHUB_REF -e BRIDGE_SOCKET --workdir=$(dirname $BRIDGE_SOCKET) \ $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/logging/run_bridge.sh - name: Run rsyslog to produce log messages @@ -119,7 +120,7 @@ jobs: # run integration tests - name: Run sg-core to process log messages run: | - docker run --name=sgcore -d -uroot --network host $TEST_PORT $BRIDGE_VOLUME \ + docker run --name=sgcore -d -uroot --network host $TEST_PORT $BRIDGE_VOLUME -e OPSTOOLS_REPO \ --volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \ $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/logging/run_sg.sh - name: sg-core debug output diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d649e8b..b8b25326 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,7 @@ name: CI env: PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core + OPSTOOLS_REPO: https://git.centos.org/rpms/centos-release-opstools/raw/c8s-sig-opstools/f/SOURCES/CentOS-OpsTools.repo LOKI_IMAGE: grafana/loki:2.1.0 LOKI_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/loki:/etc/loki:ro" @@ -64,7 +65,7 @@ jobs: docker logs loki - name: Run sg-core unit test suite run: | - docker run --name=testsuite -uroot --network host -e COVERALLS_REPO_TOKEN \ + docker run --name=testsuite -uroot --network host -e COVERALLS_REPO_TOKEN -e OPSTOOLS_REPO \ --volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \ $TEST_IMAGE bash $PROJECT_ROOT/ci/unit/run_tests.sh - name: Send coverage diff --git a/build/repos/opstools.repo b/build/repos/opstools.repo index 6d2b4096..aee21884 100644 --- a/build/repos/opstools.repo +++ b/build/repos/opstools.repo @@ -1,6 +1,19 @@ +# CentOS-OpsTools.repo +# +# Please see http://wiki.centos.org/SpecialInterestGroup/OpsTools for more +# information + +[centos-opstools-testing] +name=CentOS-OpsTools - testing repo +baseurl=https://buildlogs.centos.org/centos/$releasever-stream/opstools/$basearch/collectd-5/ +gpgcheck=0 +enabled=0 + [centos-opstools] -name=opstools -baseurl=http://mirror.centos.org/centos/8/opstools/$basearch/collectd-5/ +name=CentOS-OpsTools - collectd +mirrorlist=http://mirrorlist.centos.org/?arch=$basearch&release=$releasever-stream&repo=opstools-collectd-5 +#baseurl=http://mirror.centos.org/$contentdir/$releasever-stream/opstools/$basearch/collectd-5/ gpgcheck=0 enabled=1 -module_hotfixes=1 +skip_if_unavailable=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-OpsTools diff --git a/ci/integration/logging/run_bridge.sh b/ci/integration/logging/run_bridge.sh index e941abe1..d6a5f241 100644 --- a/ci/integration/logging/run_bridge.sh +++ b/ci/integration/logging/run_bridge.sh @@ -5,14 +5,8 @@ set -ex # enable required repo(s) -cat > /etc/yum.repos.d/fedora-eln.repo < /etc/yum.repos.d/fedora-eln.repo < /etc/yum.repos.d/fedora-eln.repo <