diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2ff93383b..fb8861f01a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ variables: value: "master" description: "Run a specific datadog-reliability-env branch downstream" SYSTEM_TESTS_LIBRARY: php + include: - remote: https://gitlab-templates.ddbuild.io/libdatadog/include/ci_authenticated_job.yml - remote: https://gitlab-templates.ddbuild.io/libdatadog/include/one-pipeline.yml @@ -118,3 +119,10 @@ onboarding_tests_k8s_injection: - WEBLOG_VARIANT: - dd-lib-php-init-test-83 - dd-lib-php-init-test-alpine + +requirements_json_test: + rules: + - when: on_success + variables: + REQUIREMENTS_BLOCK_JSON_PATH: "loader/packaging/block_tests.json" + REQUIREMENTS_ALLOW_JSON_PATH: "loader/packaging/allow_tests.json" diff --git a/loader/packaging/allow_tests.json b/loader/packaging/allow_tests.json new file mode 100644 index 0000000000..18374c58e8 --- /dev/null +++ b/loader/packaging/allow_tests.json @@ -0,0 +1,11 @@ +[ + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "musl"}}, + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "musl:1.5"}}, + {"filepath": "/elephp5ant/thing", "args": [], "envars": [], "host": {"os": "linux", "arch": "amd64", "libc": "musl"}}, + {"filepath": "/usr/bin/gluglu", "args": [], "envars": [], "host": {"os": "linux", "arch": "amd64", "libc": "glibc:3.42"}}, + {"filepath": "/opt/php/7/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/opt/php/7.4/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php83", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}} +] diff --git a/loader/packaging/block_tests.json b/loader/packaging/block_tests.json new file mode 100644 index 0000000000..969fc51923 --- /dev/null +++ b/loader/packaging/block_tests.json @@ -0,0 +1,14 @@ +[ + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "amd64", "libc": "glibc:2.15"}}, + {"filepath": "/usr/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "amd64", "libc": "gluglu:2.20"}}, + + {"filepath": "/opt/php5/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/opt/php5.3/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/opt/php/5/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/opt/php/5.4/bin/php", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + + {"filepath": "/usr/bin/php5", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php53", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php-54", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}}, + {"filepath": "/usr/bin/php.54", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}} +] diff --git a/loader/packaging/requirements.json b/loader/packaging/requirements.json new file mode 100644 index 0000000000..ad2ccdefb8 --- /dev/null +++ b/loader/packaging/requirements.json @@ -0,0 +1,45 @@ +{ + "version": 1, + "native_deps": { + "glibc": [ + { + "arch": "x64", + "supported": true, + "description": "From centOS 7", + "min": "2.17" + }, + { + "arch": "arm64", + "supported": true, + "description": "From centOS 7", + "min": "2.17" + } + ], + "musl": [ + { + "arch": "x64", + "supported": true + }, + { + "arch": "arm64", + "supported": true + } + ] + }, + "deny": [ + { + "id": "php5", + "description": "Do not inject if PHP 5", + "os": null, + "cmds": [ + "**/php/5*/**", + "**/php5*/**", + "**/php5*", + "**/php-5*", + "**/php.5*" + ], + "args": [], + "envars": null + } + ] +} diff --git a/tooling/bin/generate-ssi-package.sh b/tooling/bin/generate-ssi-package.sh index 3406e6596a..6d60d84f2c 100755 --- a/tooling/bin/generate-ssi-package.sh +++ b/tooling/bin/generate-ssi-package.sh @@ -62,6 +62,7 @@ for architecture in "${architectures[@]}"; do cp -r ./src ${trace}/ echo "$release_version_sanitized" > ${root}/version + ln ./loader/packaging/requirements.json ${root}/requirements.json ######################## # Final archives