diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 1700c484d9e860e1aa7a1d038a8022694e533d60..743faad3978343744c4f0652562c825dbb256a3a 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -26,6 +26,20 @@ Make PHP Unit Test: except: - schedules +Make PHP Browser Test: + stage: build + tags: + - linux + - dockerd + script: + - make php-browser-test + only: + changes: + - php-browser-test/* + - php-browser-test/**/* + except: + - schedules + Make Android Build: stage: build tags: diff --git a/.gitlab/ci/publish.yml b/.gitlab/ci/publish.yml index c03e3b0cfbe71641ec02960355116e42977667d6..e1d33fa0614518721e1b741ae412cc232bfb7799 100644 --- a/.gitlab/ci/publish.yml +++ b/.gitlab/ci/publish.yml @@ -40,6 +40,20 @@ Publish PHP Unit Test: except: - schedules +Publish PHP Browser Test: + <<: *push_to_registry + variables: + IMG_NAME: "php-browser-test" + needs: ["Make PHP Browser Test"] + only: + refs: + - master + changes: + - php-browser-test/* + - php-browser-test/**/* + except: + - schedules + Publish Android Build: <<: *push_to_registry variables: diff --git a/Makefile b/Makefile index 7083d5ab03b16dbf47eaf6659c7c1a016d57aaf9..427c5d99b10a57a1e0c501083978fc6627f21553 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,13 @@ BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT) .PHONY: all clean test $(DOCKERFILES) static-code-analysis mobile delete_dangling_images security publish utility dotnet -all: php-lint php-unit-test mobile static-code-analysis utility detect-secrets dependency-check xml-lint +all: php-lint php-unit-test php-browser-test mobile static-code-analysis utility detect-secrets dependency-check xml-lint # Image Groups #################### php-lint: php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_7.3 php-lint_7.4 php-lint_8.0 php-lint_8.1 php-lint_8.2 php-lint_latest php-unit-test: php-unit-test_5.6 php-unit-test_7.0 php-unit-test_7.1 php-unit-test_7.2 php-unit-test_7.3 php-unit-test_7.4 php-unit-test_8.0 php-unit-test_8.1 php-unit-test_8.2 php-unit-test_latest +php-browser-test: php-browser-test_8.2 php-browser-test_latest mobile: android-build-server static-code-analysis: static-code-analysis_latest static-code-analysys_php static-code-analysys_python static-code-analysys_android utility: alpine-ssh-client merge-request-check @@ -95,6 +96,14 @@ php-unit-test_8.2: php-unit-test/8.2/Dockerfile php-unit-test_latest: php-unit-test_8.2 docker tag ${REPO_ORG}/php-unit-test:8.2 ${REPO_ORG}/php-unit-test:latest +# PHP Unit Test Images +#################### +php-browser-test_8.2: php-browser-test/8.2/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-browser-test:8.2 -f php-browser-test/8.2/Dockerfile php-browser-test/8.2 + +php-browser-test_latest: php-browser-test_8.2 + docker tag ${REPO_ORG}/php-browser-test:8.2 ${REPO_ORG}/php-browser-test:latest + # Mobile Applications #################### android-build-server: android-build-server/Dockerfile diff --git a/php-browser-test/8.2/Dockerfile b/php-browser-test/8.2/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..14ebb95c63b624592c7b645305cad21a4c153414 --- /dev/null +++ b/php-browser-test/8.2/Dockerfile @@ -0,0 +1,22 @@ +FROM its-registry.unl.edu/unl-its/docker-ci/php-unit-test:8.2 + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="PHP 8.2 Browser Tester" \ + org.label-schema.description="Perform chromedriver browser tests in PHP (Ex. Laravel Dusk)" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +RUN apk add --no-cache chromium-chromedriver + +COPY ./browser-test-entrypoint.sh /usr/local/bin/browser-test-entrypoint +RUN chown root:root /usr/local/bin/browser-test-entrypoint \ + && chmod 755 /usr/local/bin/browser-test-entrypoint + +ENTRYPOINT ["/usr/local/bin/browser-test-entrypoint"] +CMD ["sh"] diff --git a/php-browser-test/8.2/browser-test-entrypoint.sh b/php-browser-test/8.2/browser-test-entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..bbefdbb5b36266f8fbe2493166373b5c851f9edc --- /dev/null +++ b/php-browser-test/8.2/browser-test-entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +chromedriver --allowed-ips="127.0.0.1" > /dev/null & + +exec "$@" \ No newline at end of file diff --git a/php-unit-test/8.2/Dockerfile b/php-unit-test/8.2/Dockerfile index a4dd31fb745aa92249b609f107cf9c9f4afad86e..0f914919e23d4ae276a4d6406763c9a21fc9f95b 100644 --- a/php-unit-test/8.2/Dockerfile +++ b/php-unit-test/8.2/Dockerfile @@ -5,7 +5,7 @@ ARG VCS_REF ARG VERSION LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="PHP 8.2 Unit Tester" \ - org.label-schema.description="" \ + org.label-schema.description="Perform unit tests in PHP (Ex. PHPUnit)" \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vendor="University of Nebraska - Lincoln" \ org.label-schema.version=$VERSION \