From de760689b618d08460ae5b2db96856bb3ca549ef Mon Sep 17 00:00:00 2001 From: Guillermo Sanchez Gavier Date: Wed, 15 May 2024 17:01:37 +0200 Subject: [PATCH] fix: ubuntu16 pre-build container (#16) --- .github/workflows/testing.yml | 7 ++++++- prepare_platform.sh | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b40be4c..adb1f41 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -6,8 +6,13 @@ jobs: molecule-packaging-tests: name: Launch molecule tests with infra-agent package runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # test building and using pre-build containers. + build_docker: ["true",""] env: - TESTING: 'true' + TESTING: ${{ matrix.build_docker}} steps: - uses: actions/checkout@v2 diff --git a/prepare_platform.sh b/prepare_platform.sh index 39cdad1..02580dc 100755 --- a/prepare_platform.sh +++ b/prepare_platform.sh @@ -63,6 +63,13 @@ set_platforms_config() { yq -i ".platforms[] |= select(.name == \"$PLATFORM\") += {\"image\":\"$PLATFORM\", \"dockerfile\": \"./dockerfiles/$PLATFORM\"}" $FILE_PATH else yq -i ".platforms[] |= select(.name == \"$PLATFORM\") += {\"image\":\"ghcr.io/newrelic/pkg-installation-testing-action-$PLATFORM\"}" $FILE_PATH + + # Prevent molecule to install extra tools in the pre-build image + # https://ansible.readthedocs.io/projects/molecule/guides/custom-image/ + # ubuntu16 python 2 installation was being corrupted by this behaivor. + if [[ $PLATFORM == "ubuntu1604" ]]; then + yq -i ".platforms[] |= select(.name == \"$PLATFORM\") += {\"pre_build_image\": true}" $FILE_PATH + fi fi # debian based distributions need to set up the init command