From 2bf138914f64f4b2c47bf9c42941c001e70cfd05 Mon Sep 17 00:00:00 2001 From: Grzegorz Rajchman Date: Thu, 26 Oct 2023 09:18:49 +0100 Subject: [PATCH] PLT-72 MongoDB extension and library upgrade (#143) --- .circleci/config.yml | 50 ++++++++++------------------- .travis.yml | 26 --------------- build.xml | 70 ----------------------------------------- composer.json | 12 ++++--- docker-compose.yml | 32 ++++++------------- docker/Dockerfile-php55 | 26 ++++++++++----- docker/Dockerfile-php56 | 10 ------ docker/Dockerfile-php70 | 10 ------ docker/Dockerfile-php72 | 10 ------ docker/Dockerfile-php73 | 15 +++++++++ 10 files changed, 67 insertions(+), 194 deletions(-) delete mode 100644 .travis.yml delete mode 100644 build.xml delete mode 100644 docker/Dockerfile-php56 delete mode 100644 docker/Dockerfile-php70 delete mode 100644 docker/Dockerfile-php72 create mode 100644 docker/Dockerfile-php73 diff --git a/.circleci/config.yml b/.circleci/config.yml index 88cb397..557c1a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,39 +1,23 @@ version: 2.1 -parameters: &version - version: - type: string - default: "php55" - -commands: - install_composer_dependencies: - parameters: *version - description: Install composer dependencies for << parameters.version >> - steps: - - run: docker-compose run << parameters.version >> composer install - unit_tests: - parameters: *version - description: Run unit tests for << parameters.version >> - steps: - - run: docker-compose run << parameters.version >> ./vendor/bin/phpunit test/unit - performance_tests: - parameters: *version - description: Run performance tests for << parameters.version >> - steps: - - run: docker-compose run << parameters.version >> ./vendor/bin/phpunit test/performance jobs: test: - parameters: *version - machine: - image: ubuntu-2004:202010-01 + parameters: + php_version: + type: string + docker: + - image: talis/tripod-php:<< parameters.php_version >>-latest + environment: + RESQUE_SERVER: redis + - image: mongo:3.2.21 + name: mongodb + - image: redis:6.2.6 + name: redis steps: - checkout - - install_composer_dependencies: - version: << parameters.version >> - - unit_tests: - version: << parameters.version >> - - performance_tests: - version: << parameters.version >> + - run: composer install + - run: ./vendor/bin/phpunit test/unit + - run: ./vendor/bin/phpunit test/performance workflows: build_and_test: @@ -41,8 +25,6 @@ workflows: - test: matrix: parameters: - version: + php_version: - php55 - - php56 - - php70 - - php72 \ No newline at end of file + - php73 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d659de..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -dist: trusty -addons: - apt: - packages: - ant -language: php -sudo: required -php: -- 7.0 -- 5.6 -- 5.5 -services: -- redis -- docker -before_install: -- docker pull rossfsinger/mongo-2.6.12 -- docker run -d -p 127.0.0.1:27017:27017 -v ~/data:/data/db rossfsinger/mongo-2.6.12:latest -- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini -- sleep 15 -install: -- composer install -script: ant -notifications: - hipchat: - rooms: - secure: ZVAxv+jZawDdIgLyNERg8IkK3EPZNz04OKZeUrVj55clceDXPmpYv3TC/Gw/xuR19i52HGlqFlYDMNlfl689lzJE45rhabTwMNpAch8R7p5QAKUTCZOkIRfBKPTW68dSRndJf/Y6nsf0kSdKEdgSFCced3JchhvZrScPGBoSRaI= diff --git a/build.xml b/build.xml deleted file mode 100644 index 3ac4ad0..0000000 --- a/build.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Checking to see if composer.phar exists... - - - - - Installing composer... - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/composer.json b/composer.json index 2bc3d46..9a9d929 100644 --- a/composer.json +++ b/composer.json @@ -17,14 +17,18 @@ "homepage": "http://talis.com/" } ], + "suggest": { + "mongodb/mongodb": "MongoDB driver library", + "resque/php-resque": "Redis backed library for background jobs" + }, "require": { "php" : ">=5.5", - "semsol/arc2": "v2.2.4", - "chrisboulton/php-resque": "dev-master#98fde571db008a8b48e73022599d1d1c07d4a7b5", - "monolog/monolog" : "~1.13", - "mongodb/mongodb": "1.0.5" + "semsol/arc2": "2.2.6", + "monolog/monolog" : "~1.13" }, "require-dev": { + "resque/php-resque": "v1.3.4", + "mongodb/mongodb": "1.4.3", "phpunit/phpunit": "^4.8", "squizlabs/php_codesniffer": "3.2.*" }, diff --git a/docker-compose.yml b/docker-compose.yml index c60fda1..f459c91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,42 +6,28 @@ x-base-config: &base-config - ./vendor:/var/tripod-php/vendor:delegated links: - "mongo32:mongodb" - - redis + - redis depends_on: - mongo32 - - redis - working_dir: /var/tripod-php + - redis + working_dir: /var/tripod-php env_file: .env services: - php55: - # build: + php55: + # build: # context: ./docker # dockerfile: Dockerfile-php55 image: talis/tripod-php:php55-latest <<: *base-config - - php56: - # build: - # context: ./docker - # dockerfile: Dockerfile-php56 - image: talis/tripod-php:php56-latest - <<: *base-config - php70: - # build: + php73: + # build: # context: ./docker - # dockerfile: Dockerfile-php70 - image: talis/tripod-php:php70-latest + # dockerfile: Dockerfile-php73 + image: talis/tripod-php:php73-latest <<: *base-config - php72: - # build: - # context: ./docker - # dockerfile: Dockerfile-php72 - image: talis/tripod-php:php72-latest - <<: *base-config - mongo32: image: mongo:3.2.21 diff --git a/docker/Dockerfile-php55 b/docker/Dockerfile-php55 index b4d5daf..698a864 100644 --- a/docker/Dockerfile-php55 +++ b/docker/Dockerfile-php55 @@ -1,10 +1,22 @@ FROM php:5.5-cli -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +# Debian jessie repositories have been moved to archive +# https://lists.debian.org/debian-devel-announce/2023/02/msg00004.html +RUN rm /etc/apt/sources.list && \ + echo 'deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main' >> /etc/apt/sources.list && \ + echo 'deb [trusted=yes] http://archive.debian.org/debian jessie main' >> /etc/apt/sources.list && \ + echo 'Acquire::Check-Valid-Until "false";' >> /etc/apt/apt.conf -RUN apt-get update && apt-get install -y git ca-certificates && \ - chmod +x /usr/local/bin/install-php-extensions && \ - install-php-extensions pcntl redis mongodb-1.1.9 && \ - curl https://getcomposer.org/installer > /tmp/composer-setup.php && \ - php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer \ - && rm /tmp/composer-setup.php \ No newline at end of file +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + git \ + unzip \ + zip \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=mlocati/php-extension-installer:2.1.58 /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions pcntl redis mongodb-1.5.5 && \ + curl https://getcomposer.org/installer >/tmp/composer-setup.php && \ + php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer && \ + rm /tmp/composer-setup.php diff --git a/docker/Dockerfile-php56 b/docker/Dockerfile-php56 deleted file mode 100644 index b133506..0000000 --- a/docker/Dockerfile-php56 +++ /dev/null @@ -1,10 +0,0 @@ -FROM php:5.6-cli - -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions && \ - install-php-extensions pcntl redis mongodb-1.1.9 && \ - curl https://getcomposer.org/installer > /tmp/composer-setup.php && \ - php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer \ - && rm /tmp/composer-setup.php && \ - apt-get update && apt-get install -y git \ No newline at end of file diff --git a/docker/Dockerfile-php70 b/docker/Dockerfile-php70 deleted file mode 100644 index b37b157..0000000 --- a/docker/Dockerfile-php70 +++ /dev/null @@ -1,10 +0,0 @@ -FROM php:7.0-cli - -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions && \ - install-php-extensions pcntl redis mongodb-1.1.9 && \ - curl https://getcomposer.org/installer > /tmp/composer-setup.php && \ - php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer \ - && rm /tmp/composer-setup.php && \ - apt-get update && apt-get install -y git \ No newline at end of file diff --git a/docker/Dockerfile-php72 b/docker/Dockerfile-php72 deleted file mode 100644 index 416b040..0000000 --- a/docker/Dockerfile-php72 +++ /dev/null @@ -1,10 +0,0 @@ -FROM php:7.2-cli - -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions && \ - install-php-extensions pcntl redis mongodb-1.4.4 && \ - curl https://getcomposer.org/installer > /tmp/composer-setup.php && \ - php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer \ - && rm /tmp/composer-setup.php && \ - apt-get update && apt-get install -y git \ No newline at end of file diff --git a/docker/Dockerfile-php73 b/docker/Dockerfile-php73 new file mode 100644 index 0000000..078b83c --- /dev/null +++ b/docker/Dockerfile-php73 @@ -0,0 +1,15 @@ +FROM php:7.3-cli + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + git \ + unzip \ + zip \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=mlocati/php-extension-installer:2.1.58 /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions pcntl redis mongodb-1.5.5 && \ + curl https://getcomposer.org/installer >/tmp/composer-setup.php && \ + php /tmp/composer-setup.php --install-dir /usr/local/bin/ --filename composer && \ + rm /tmp/composer-setup.php