From 029973d0d600015c88254d8f05e40a8146bbc89b Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 13 Sep 2023 22:56:28 +0900 Subject: [PATCH 1/7] Use PHP8.2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68af623869..1282c5c9ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-22.04 ] - php: [ '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2snapshot' ] + php: [ '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] db: [ mysql, pgsql ] include: - db: mysql From 5d56e51ad3690b27db792c8e189b7920fd90c684 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 13 Sep 2023 22:57:49 +0900 Subject: [PATCH 2/7] Use windows-2022 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1282c5c9ee..7c1b0bc4f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -150,7 +150,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ windows-2019 ] + operating-system: [ windows-2022 ] php: [ 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ] steps: - name: Checkout @@ -179,7 +179,7 @@ jobs: - name: Setup to database run: | - choco install -y mysql --version 5.7.18 + choco install -y mysql mysql --user=root -e "CREATE DATABASE eccube_db DEFAULT COLLATE=utf8_general_ci;" mysql --user=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;" From 3aec3696cca12765d2c8d92aa58407dbbfc233d6 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 13 Sep 2023 23:14:21 +0900 Subject: [PATCH 3/7] Use PostgreSQL on Windows --- .github/workflows/main.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c1b0bc4f6..2318ae4c7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -177,11 +177,15 @@ jobs: - name: composer install run: composer install --no-interaction -o - - name: Setup to database + - name: Start PostgreSQL on Windows + # see https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/ run: | - choco install -y mysql - mysql --user=root -e "CREATE DATABASE eccube_db DEFAULT COLLATE=utf8_general_ci;" - mysql --user=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;" + $pgService = Get-Service -Name postgresql* + Set-Service -InputObject $pgService -Status running -StartupType automatic + Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru + $env:PGPASSWORD = 'root' + & $env:PGBIN\createdb --owner=postgres eccube_db + echo $env:PGBIN >> $Env:GITHUB_PATH - name: Setup PHP uses: nanasess/setup-php@master @@ -190,16 +194,17 @@ jobs: - name: Setup to EC-CUBE env: - DB: mysql - USER: root - DBUSER: root - DBPASS: password + DB: pgsql + DBUSER: postgres + DBPASS: root DBNAME: eccube_db - DBPORT: 3306 + DBPORT: 5432 DBSERVER: 127.0.0.1 HTTP_URL: http://127.0.0.1:8085/ HTTPS_URL: http://127.0.0.1:8085/ - run: bash eccube_install.sh mysql + run: | + echo $PATH + bash eccube_install.sh pgsql shell: bash - run: sleep 1 shell: bash From 03cac2ac43911f9e13e3cd7d5e8d17b21a1584b5 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Thu, 14 Sep 2023 09:54:56 +0900 Subject: [PATCH 4/7] Fix memory leak --- tests/class/SC_Query_Test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/class/SC_Query_Test.php b/tests/class/SC_Query_Test.php index 1f84e0f8a7..d655c75fde 100644 --- a/tests/class/SC_Query_Test.php +++ b/tests/class/SC_Query_Test.php @@ -29,7 +29,7 @@ * @author Kentaro Ohkouchi * @version $Id$ */ -class SC_Query_Test extends PHPUnit_Framework_TestCase +class SC_Query_Test extends PHPUnit_Framework_TestCase { /** @@ -317,7 +317,7 @@ protected function setTestData($column1, $column2, $column3) $sql = "INSERT INTO test_table (column1, column2, column3) VALUES (?, ?, ?)"; $result = $this->objQuery->query($sql, $fields_values); if (PEAR::isError($result)) { - error_log(var_export($result, true)); + throw new \Exception($result->getMessage()); } return $result; From 8131578468553e3c8ba0f24dbbe6b1162b15b96b Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Thu, 14 Sep 2023 10:47:24 +0900 Subject: [PATCH 5/7] Fix authentication method on PostgreSQL for Windows --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2318ae4c7f..8e8694acbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -180,12 +180,18 @@ jobs: - name: Start PostgreSQL on Windows # see https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/ run: | + echo $env:PGBIN >> $Env:GITHUB_PATH $pgService = Get-Service -Name postgresql* Set-Service -InputObject $pgService -Status running -StartupType automatic Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru $env:PGPASSWORD = 'root' - & $env:PGBIN\createdb --owner=postgres eccube_db - echo $env:PGBIN >> $Env:GITHUB_PATH + (Get-Content $env:PGDATA\postgresql.conf) | foreach { $_ -replace "#password_encryption = scram-sha-256","password_encryption = md5" } | Set-Content $env:PGDATA\postgresql.conf + (Get-Content $env:PGDATA\pg_hba.conf) | foreach { $_ -replace "scram-sha-256","md5" } | Set-Content $env:PGDATA\pg_hba.conf + Restart-Service -InputObject $pgService -Force + Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru + & $env:PGBIN\createuser -U postgres -d -R eccube_db_user + & $env:PGBIN\psql -U postgres -c "ALTER role eccube_db_user with password 'root';" postgres + & $env:PGBIN\createdb --owner=eccube_db_user eccube_db - name: Setup PHP uses: nanasess/setup-php@master @@ -195,7 +201,7 @@ jobs: - name: Setup to EC-CUBE env: DB: pgsql - DBUSER: postgres + DBUSER: eccube_db_user DBPASS: root DBNAME: eccube_db DBPORT: 5432 From 3eefb25e9e1d7d7ecf8229563d37e27a1261ac05 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 15 Sep 2023 13:19:32 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=E9=80=A3=E7=B6=9A=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=80=81=E4=BD=95=E6=95=85=E3=81=8B=20MySQL?= =?UTF-8?q?=20=E3=81=AE=20prepare=20statement=20=E3=81=AB=E5=A4=B1?= =?UTF-8?q?=E6=95=97=E3=81=99=E3=82=8B=E5=AF=BE=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 失敗するテストを個別に実行する --- .github/workflows/main.yml | 5 ++++- .../class/util/SC_Utils/SC_Utils_sfGetAddressTest.php | 3 +-- .../util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php | 2 +- .../util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e8694acbb..8db4106162 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,9 +131,12 @@ jobs: - run: sleep 1 - name: Run to PHPUnit - run: data/vendor/bin/phpunit --exclude-group classloader + run: data/vendor/bin/phpunit --exclude-group classloader,mysql_prepare - name: Run to PHPUnit classloader run: data/vendor/bin/phpunit --group classloader + - name: Run to PHPUnit mysql_prepare + # XXX 連続してテストを実行すると、何故か MySQL の prepare statement に失敗するため個別に実行する + run: data/vendor/bin/phpunit --group mysql_prepare - name: Run to PHPUnit SessionFactory run: data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php index 9b0cfc1b64..c01e1e826e 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetAddressTest.php @@ -27,7 +27,7 @@ /** * SC_Utils::sfGetAddress()のテストクラス. * - * + * @group mysql_prepare * @author Hiroko Tamagawa * @version $Id$ */ @@ -191,4 +191,3 @@ protected function setUpAddress() } } } - diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php index 23ef356a04..ba31eaa7d2 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetClassCatCountTest.php @@ -28,6 +28,7 @@ * SC_Utils::sfGetClassCatCount()のテストクラス. * * + * @group mysql_prepare * @author Hiroko Tamagawa * @version $Id$ */ @@ -134,4 +135,3 @@ protected function setUpClassCat() } } } - diff --git a/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php b/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php index bc7224c0e6..db8ec80db9 100644 --- a/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php +++ b/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php @@ -28,6 +28,7 @@ * SC_Utils::sfGetProductClassId()のテストクラス. * TODO del_flgは使わなくて良い?? * TODO classcategory_id1とclasscategory_id2を使わないと一意に指定できない。 + * @group mysql_prepare * @author Hiroko Tamagawa * @version $Id$ */ @@ -49,7 +50,7 @@ protected function tearDown() ///////////////////////////////////////// public function testSfGetProductClassId_存在する製品IDのみを指定した場合_カテゴリ0の対応する製品クラスが取得できる() { - + $this->expected = '2001'; $this->actual = SC_Utils::sfGetProductClassId('2001'); @@ -58,7 +59,7 @@ public function testSfGetProductClassId_存在する製品IDのみを指定し public function testSfGetProductClassId_存在する製品IDのみを指定してカテゴリ0の製品クラスが存在しなければ_nullが返る() { - + $this->expected = null; $this->actual = SC_Utils::sfGetProductClassId('1001'); @@ -67,7 +68,7 @@ public function testSfGetProductClassId_存在する製品IDのみを指定し public function testSfGetProductClassId_存在する製品IDとカテゴリIDを指定した場合_対応する製品クラスが取得できる() { - + $this->expected = '1002'; $this->actual = SC_Utils::sfGetProductClassId('1001', '2'); @@ -76,7 +77,7 @@ public function testSfGetProductClassId_存在する製品IDとカテゴリIDを public function testSfGetProductClassId_存在する製品IDと存在しないカテゴリIDを指定した場合_nullが返る() { - + $this->expected = null; $this->actual = SC_Utils::sfGetProductClassId('1001', '999'); @@ -130,4 +131,3 @@ protected function setUpProductsClass() } } } - From 121a79abc2b2cf7384045d06b97a10f960b55ea2 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 13 Sep 2023 22:41:03 +0900 Subject: [PATCH 7/7] =?UTF-8?q?debian-stretch=20=E3=81=8C=20archive=20?= =?UTF-8?q?=E3=81=B8=E7=A7=BB=E5=8B=95=E3=81=97=E3=81=9F=E3=81=9F=E3=82=81?= =?UTF-8?q?=20sources.list=20=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit archive.debian.org は遅いので cloudfront の mirror を使用する --- .github/workflows/dockerbuild.yml | 40 +++++++++++++++++++++++++++---- .github/workflows/e2e-tests.yml | 40 ++++++++++++++++++++++++++----- Dockerfile | 16 ++++++++++--- 3 files changed, 82 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index e6cdd862bc..592bcf81e7 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] + php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] steps: - name: downcase REPO @@ -32,26 +32,50 @@ jobs: run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql mbstring" >> ${GITHUB_ENV} - echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} + echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} + echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive/debian-security" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 5.5 }} + run: | + echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} + echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} + echo "APCU=" >> ${GITHUB_ENV} echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} - - if: ${{ matrix.php == 5.5 || matrix.php == 5.6 }} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive/debian-security" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 5.6 }} run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} - echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} + echo "APCU=" >> ${GITHUB_ENV} echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} - - if: ${{ matrix.php >= 7.0 && matrix.php <= 7.3 }} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 7.0 }} + run: | + echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} + echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} + echo "APCU=apcu" >> ${GITHUB_ENV} + echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + - if: ${{ matrix.php >= 7.1 && matrix.php <= 7.3 }} run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} echo "APCU=apcu" >> ${GITHUB_ENV} echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=deb.debian.org" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV} - if: ${{ matrix.php >= 7.4 }} run: | echo "GD_OPTIONS=--with-freetype --with-jpeg" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} echo "APCU=apcu" >> ${GITHUB_ENV} echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=deb.debian.org" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV} - name: Checkout uses: actions/checkout@v3 @@ -97,6 +121,9 @@ jobs: GD_OPTIONS=${{ env.GD_OPTIONS }} EXT_INSTALL_ARGS=${{ env.EXT_INSTALL_ARGS }} APCU=${{ env.APCU }} + FORCE_YES=${{ env.FORCE_YES }} + APT_REPO=${{ env.APT_REPO }} + APT_SECURITY_REPO=${{ env.APT_SECURITY_REPO }} - name: Setup to EC-CUBE env: @@ -142,6 +169,9 @@ jobs: GD_OPTIONS=${{ env.GD_OPTIONS }} EXT_INSTALL_ARGS=${{ env.EXT_INSTALL_ARGS }} APCU=${{ env.APCU }} + FORCE_YES=${{ env.FORCE_YES }} + APT_REPO=${{ env.APT_REPO }} + APT_SECURITY_REPO=${{ env.APT_SECURITY_REPO }} - name: Upload evidence if: failure() diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f12c5d3442..a10986636c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -89,7 +89,7 @@ jobs: fail-fast: false matrix: db: [ 'pgsql', 'mysql' ] - php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] + php: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] include: - db: mysql dbport: '3306' @@ -109,22 +109,50 @@ jobs: run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql mbstring" >> ${GITHUB_ENV} - echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} - - if: ${{ matrix.php == 5.5 || matrix.php == 5.6 }} + echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} + echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive/debian-security" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 5.5 }} run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} - echo "APCU=apcu-4.0.11" >> ${GITHUB_ENV} - - if: ${{ matrix.php >= 7.0 && matrix.php <= 7.3 }} + echo "APCU=" >> ${GITHUB_ENV} + echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive/debian-security" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 5.6 }} + run: | + echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} + echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} + echo "APCU=" >> ${GITHUB_ENV} + echo "FORCE_YES=--force-yes" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + - if: ${{ matrix.php == 7.0 }} + run: | + echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} + echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} + echo "APCU=apcu" >> ${GITHUB_ENV} + echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=cloudfront.debian.net/debian-archive" >> ${GITHUB_ENV} + - if: ${{ matrix.php >= 7.1 && matrix.php <= 7.3 }} run: | echo "GD_OPTIONS=--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} echo "APCU=apcu" >> ${GITHUB_ENV} + echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=deb.debian.org" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV} - if: ${{ matrix.php >= 7.4 }} run: | echo "GD_OPTIONS=--with-freetype --with-jpeg" >> ${GITHUB_ENV} echo "EXT_INSTALL_ARGS=gd zip mysqli pgsql opcache" >> ${GITHUB_ENV} echo "APCU=apcu" >> ${GITHUB_ENV} + echo "FORCE_YES=" >> ${GITHUB_ENV} + echo "APT_REPO=deb.debian.org" >> ${GITHUB_ENV} + echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV} - name: Checkout uses: actions/checkout@v3 @@ -142,7 +170,7 @@ jobs: sudo chown -R 1001:1000 zap sudo chmod -R g+w zap sh -c 'echo "> data/config/config.php' - docker build -t ec-cube2 --build-arg PHP_VERSION_TAG="${PHP_VERSION_TAG}" --build-arg GD_OPTIONS="${GD_OPTIONS}" --build-arg EXT_INSTALL_ARGS="${EXT_INSTALL_ARGS}" --build-arg APCU="${APCU}" . + docker build -t ec-cube2 --build-arg PHP_VERSION_TAG="${PHP_VERSION_TAG}" --build-arg GD_OPTIONS="${GD_OPTIONS}" --build-arg EXT_INSTALL_ARGS="${EXT_INSTALL_ARGS}" --build-arg APCU="${APCU}" --build-arg FORCE_YES="${FORCE_YES}" --build-arg APT_REPO="${APT_REPO}" --build-arg APT_SECURITY_REPO="${APT_SECURITY_REPO}" . docker tag ec-cube2 ghcr.io/ec-cube/ec-cube2-php:${PHP_VERSION_TAG}-apache TAG=${PHP_VERSION_TAG}-apache docker-compose up -d diff --git a/Dockerfile b/Dockerfile index 3c902a30f7..bff7982e1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,21 @@ FROM php:${TAG} ARG GD_OPTIONS="--with-freetype --with-jpeg" ARG EXT_INSTALL_ARGS="gd zip mysqli pgsql opcache" ARG APCU="apcu" -ARG FORCE_YES="--force-yes" +ARG FORCE_YES="" +ARG APT_REPO="deb.debian.org" +ARG APT_SECURITY_REPO="security.debian.org" + # See https://github.com/debuerreotype/debuerreotype/issues/10 RUN if [ ! -d /usr/share/man/man1 ]; then mkdir /usr/share/man/man1; fi RUN if [ ! -d /usr/share/man/man7 ]; then mkdir /usr/share/man/man7; fi +RUN if [ ! -e /etc/apt/sources.list ]; then touch /etc/apt/sources.list; fi # for bookworm +RUN sed -i s,deb.debian.org,${APT_REPO},g /etc/apt/sources.list; +RUN sed -i s,security.debian.org,${APT_SECURITY_REPO},g /etc/apt/sources.list; +RUN sed -i s,httpredir.debian.org,${APT_REPO},g /etc/apt/sources.list; # for jessie +RUN sed -i '/stretch-updates/d' /etc/apt/sources.list # for stretch +RUN sed -i '/jessie-updates/d' /etc/apt/sources.list # for jessie + # ext-gd: libfreetype6-dev libjpeg62-turbo-dev libpng-dev # ext-pgsql: libpq-dev # ext-zip: libzip-dev zlib1g-dev @@ -27,7 +37,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN docker-php-ext-configure gd ${GD_OPTIONS} && docker-php-ext-install ${EXT_INSTALL_ARGS} -RUN pecl install ${APCU} && docker-php-ext-enable apcu +RUN if [[ ${APCU} ]]; then pecl install ${APCU} && docker-php-ext-enable apcu; fi # composer COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer @@ -64,4 +74,4 @@ COPY composer.lock ${ECCUBE_PREFIX}/composer.lock RUN composer install --no-scripts --no-autoloader --no-dev -d ${ECCUBE_PREFIX} COPY . ${ECCUBE_PREFIX} -RUN composer dumpautoload -o --apcu +RUN composer dumpautoload -o