diff --git a/scripts/github/github_container_verify.sh b/scripts/github/github_container_verify.sh index 1b916ba..3ace79d 100755 --- a/scripts/github/github_container_verify.sh +++ b/scripts/github/github_container_verify.sh @@ -15,8 +15,20 @@ fi echo ">>> VERIFY BUILD CONTAINER <<<" DIR=$(mktemp -d) echo "TEST_COMMAND:${TEST_COMMAND}" -echo "TEST:docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} bash -c 'eval \${TEST_COMMAND} 2>&1 | grep -q -e ${TEST_COMMAND_VERIFY} && echo true || echo false'" -export CONTAINER_OUTPUT=$(docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} bash -c "eval \${TEST_COMMAND} 2>&1 | grep -q -e \"${TEST_COMMAND_VERIFY}\" && echo true || echo false") +if [[ -z "${TEST_COMMAND_DIRECT}" ]]; then + echo "TEST_COMMAND_DIRECT is not empty" + echo "TEST:docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} ${TEST_COMMAND}" + CONTAINER_RESULT=$(docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} ${TEST_COMMAND}) + if [[ "${CONTAINER_RESULT}" == "${TEST_COMMAND_VERIFY}" ]]; then + export CONTAINER_OUTPUT=true + else + export CONTAINER_OUTPUT=false + fi +else + echo "TEST_COMMAND_DIRECT is empty" + echo "TEST:docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} bash -c 'eval \${TEST_COMMAND} 2>&1 | grep -q -e ${TEST_COMMAND_VERIFY} && echo true || echo false'" + export CONTAINER_OUTPUT=$(docker run --env TEST_COMMAND ${IMAGE}:${IMAGE_VERSION} bash -c "eval \${TEST_COMMAND} 2>&1 | grep -q -e \"${TEST_COMMAND_VERIFY}\" && echo true || echo false") +fi echo "CONTAINER_OUTPUT=${CONTAINER_OUTPUT}" >> $GITHUB_ENV echo "CONTAINER_OUTPUT=${CONTAINER_OUTPUT}" >> $GITHUB_OUTPUT diff --git a/scripts/github/github_get_config.sh b/scripts/github/github_get_config.sh index 2fbea6b..9eaa808 100755 --- a/scripts/github/github_get_config.sh +++ b/scripts/github/github_get_config.sh @@ -19,6 +19,10 @@ export TEST_COMMAND_VERIFY=$(grep test.command.verify= Dockerfile | sed -e 's/.* echo "TEST_COMMAND_VERIFY=${TEST_COMMAND_VERIFY}" >> $GITHUB_ENV echo "TEST_COMMAND_VERIFY=${TEST_COMMAND_VERIFY}" >> $GITHUB_OUTPUT +export TEST_COMMAND_DIRECT=$(grep test.command.direct= Dockerfile | sed -e 's/.*test.command.direct="\(.*\)".*/\1/') +echo "TEST_COMMAND_DIRECT=${TEST_COMMAND_DIRECT}" >> $GITHUB_ENV +echo "TEST_COMMAND_DIRECT=${TEST_COMMAND_DIRECT}" >> $GITHUB_OUTPUT + export IMAGE_VERSION=$(grep version= Dockerfile | sed -e 's/.*version="\(.*\)".*/\1/') echo "IMAGE_VERSION=${IMAGE_VERSION}" >> $GITHUB_ENV echo "IMAGE_VERSION=${IMAGE_VERSION}" >> $GITHUB_OUTPUT