Skip to content

Commit

Permalink
Merge branch 'sw-27063/fix-composer-installation-php82' into '5.7'
Browse files Browse the repository at this point in the history
SW-27063 - Ensure right version of laminas-code is installed

See merge request shopware/5/product/shopware!1001
  • Loading branch information
PascalThesing committed Mar 21, 2023
2 parents 670a492 + 6f09777 commit 3966e79
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 53 deletions.
4 changes: 0 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ PHP 8.1:
PHP 8.2:
extends: .phpunit_base
image: gitlab.shopware.com:5005/shopware/5/product/image/continuous:8.2
script:
- composer update laminas/laminas-code
- make test-phpunit

MySQL 8.0:
extends: .phpunit_base
Expand Down Expand Up @@ -233,7 +230,6 @@ Elasticsearch 7:
script:
- apk add --no-cache sudo
- export SW_HOST=$(hostname -i)
- composer update laminas/laminas-code
- make init
- make prepare-mink
- chown -R www-data:www-data .
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ debug-config-test: .make.config.build.debug
touch $@

.make.install.composer-dependencies:
composer update laminas/laminas-code
composer install
composer install -d recovery/common
composer bin all install
Expand Down
121 changes: 72 additions & 49 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,49 @@
</target>

<target name="build-continuous" depends="unit-shopware-continuous"/>
<target name="build-unit" depends="build-composer-install, build-cache-dir, build-database, build-snippets-deploy, build-theme-initialize,build-create-admin-account, build-install-lock-file, build-disable-firstrunwizard, install-git-hooks" />
<target name="build-unit" depends="build-composer-install, build-cache-dir, build-database, build-snippets-deploy, build-theme-initialize,build-create-admin-account, build-install-lock-file, build-disable-firstrunwizard, install-git-hooks"/>
<target name="test-unit" depends="unit-shopware"/>

<target name="write-properties" description="Write build-variables to file">
<propertyfile file="${build.dir}/build.properties" comment="Project properties">
<entry key="db.host" value="${db.host}"/>
<entry key="db.name" value="${db.name}"/>
<entry key="db.user" value="${db.user}"/>
<entry key="db.password" value="${db.password}"/>
<entry key="db.port" value="${db.port}"/>
<entry key="app.path" value="${app.path}"/>
<entry key="app.host" value="${app.host}"/>
<entry key="db.host" value="${db.host}"/>
<entry key="db.name" value="${db.name}"/>
<entry key="db.user" value="${db.user}"/>
<entry key="db.password" value="${db.password}"/>
<entry key="db.port" value="${db.port}"/>
<entry key="app.path" value="${app.path}"/>
<entry key="app.host" value="${app.host}"/>
</propertyfile>
</target>

<target name="configure" description="Set up build-variables">
<input message="Please enter db-host:"
addproperty="user.db.host"
defaultvalue="${db.host}" />
defaultvalue="${db.host}"/>

<input message="Please enter db-port:"
addproperty="user.db.port"
defaultvalue="${db.port}" />
defaultvalue="${db.port}"/>

<input message="Please enter db-name:"
addproperty="user.db.name"
defaultvalue="${db.name}" />
defaultvalue="${db.name}"/>

<input message="Please enter db-username:"
addproperty="user.db.user"
defaultvalue="${db.user}" />
defaultvalue="${db.user}"/>

<input message="Please enter db-password:"
addproperty="user.db.password">
</input>

<input message="Please enter app.host (Hostname e.g. example.com):"
addproperty="user.app.host"
defaultvalue="${app.host}" />
defaultvalue="${app.host}"/>

<input message="Please enter app.path (e.g. /shopware. Leave blank if installed in document root):"
addproperty="user.app.path"
defaultvalue="${app.path}" />
defaultvalue="${app.path}"/>

<antcall target="write-properties">
<param name="db.host" value="${user.db.host}"/>
Expand All @@ -79,10 +79,10 @@
<available file="${basedir}/composer.phar" property="composer.binary.present"/>
</target>

<target name="install-composer-binary" depends="check-composer-binary" unless="composer.binary.present">
<target name="install-composer-binary" depends="check-composer-binary" unless="composer.binary.present">
<exec executable="bash" failonerror="true">
<arg value="-c" />
<arg value="curl -s https://getcomposer.org/installer | ${script.php}" />
<arg value="-c"/>
<arg value="curl -s https://getcomposer.org/installer | ${script.php}"/>
</exec>
</target>

Expand All @@ -97,34 +97,40 @@

<target name="build-composer-install" depends="update-composer-binary">
<exec executable="${script.php}" failonerror="true">
<arg value="composer.phar" />
<arg value="install" />
<arg value="--no-interaction" />
<arg value="--optimize-autoloader" />
<arg value="--no-suggest" />
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="laminas/laminas-code"/>
</exec>

<exec executable="${script.php}" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--no-interaction"/>
<arg value="--optimize-autoloader"/>
<arg value="--no-suggest"/>
</exec>
</target>

<target name="build-composer-update" depends="update-composer-binary">
<exec executable="${script.php}" failonerror="true">
<arg value="composer.phar" />
<arg value="update" />
<arg value="--no-interaction" />
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--no-interaction"/>
</exec>
</target>

<target name="check-code-style" depends="build-composer-install">
<exec executable="${script.php}" failonerror="true">
<arg value="vendor/bin/php-cs-fixer" />
<arg value="fix" />
<arg value="--dry-run" />
<arg value="--stop-on-violation" />
<arg value="--verbose" />
<arg value="--show-progress=dots" />
<arg value="vendor/bin/php-cs-fixer"/>
<arg value="fix"/>
<arg value="--dry-run"/>
<arg value="--stop-on-violation"/>
<arg value="--verbose"/>
<arg value="--show-progress=dots"/>
</exec>
</target>

<target name="build-database" depends="build-database-foundation, build-database-deploy-demodata" />
<target name="build-database" depends="build-database-foundation, build-database-deploy-demodata"/>

<target name="build-create-admin-account">
<exec executable="${script.php}" dir="${basedir}/bin" failonerror="true">
Expand Down Expand Up @@ -192,7 +198,7 @@

<target name="build-install-lock-file">
<tstamp>
<format property="installDate" pattern="yyyyMMddHHmm" />
<format property="installDate" pattern="yyyyMMddHHmm"/>
</tstamp>

<echo file="${basedir}/recovery/install/data/install.lock">${installDate}</echo>
Expand Down Expand Up @@ -237,8 +243,8 @@

<target name="unit-continuous-es">
<exec executable="${script.phpunit}" failonerror="true" dir="${test.dir.shopware}">
<arg value="--exclude-group=skipElasticSearch" />
<arg value="--group=elasticSearch" />
<arg value="--exclude-group=skipElasticSearch"/>
<arg value="--group=elasticSearch"/>
<arg value="--log-junit=${log.dir}/junit.xml"/>
</exec>
</target>
Expand All @@ -258,7 +264,7 @@
</target>

<target name="stop-server">
<exec executable="${script.server.stop}" />
<exec executable="${script.server.stop}"/>
</target>

<target name="mink-shopware-continuous-responsive">
Expand All @@ -284,8 +290,8 @@

<target name="static-lint" description="Perform syntax check of sourcecode files">
<exec executable="bash" failonerror="true">
<arg value="-c" />
<arg value="find -L ${basedir}/engine/Shopware/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l" />
<arg value="-c"/>
<arg value="find -L ${basedir}/engine/Shopware/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"/>
</exec>
</target>

Expand All @@ -294,8 +300,8 @@
<arg value="--standard=${build.dir}"/>
<arg value="--report=checkstyle"/>
<arg value="--report-file=${log.dir}/checkstyle.xml"/>
<arg value="--extensions=php" />
<arg value="-n" />
<arg value="--extensions=php"/>
<arg value="-n"/>
<arg value="${app.dir}/"/>
</exec>
</target>
Expand All @@ -311,15 +317,23 @@
</target>

<target name="static-phpcpd" description="PHP Copy/Paste Detector">
<exec executable="${script.phpcpd}" failonerror="false" output="/dev/null" error="${log.dir}/error.log" append="true">
<exec executable="${script.phpcpd}"
failonerror="false"
output="/dev/null"
error="${log.dir}/error.log"
append="true">
<arg value="--log-pmd"/>
<arg value="${log.dir}/cpd.xml"/>
<arg value="${app.dir}/"/>
</exec>
</target>

<target name="static-phploc" description="PHP Lines of Code">
<exec executable="${script.phploc}" failonerror="false" output="${log.dir}/loc.txt" error="${log.dir}/error.log" append="true">
<exec executable="${script.phploc}"
failonerror="false"
output="${log.dir}/loc.txt"
error="${log.dir}/error.log"
append="true">
<arg value="--log-xml"/>
<arg value="${log.dir}/loc.xml"/>
<arg value="--log-csv"/>
Expand All @@ -331,7 +345,12 @@

<target name="static-pdepend">
<mkdir dir="${log.dir}/depend"/>
<exec executable="${script.pdepend}" failonerror="false" output="${log.dir}/depend/output.txt" error="${log.dir}/error.log" append="true" dir="${app.dir}">
<exec executable="${script.pdepend}"
failonerror="false"
output="${log.dir}/depend/output.txt"
error="${log.dir}/error.log"
append="true"
dir="${app.dir}">
<arg value="--summary-xml=${log.dir}/depend/summary.xml"/>
<arg value="--jdepend-chart=${log.dir}/depend/jdepend.svg"/>
<arg value="--overview-pyramid=${log.dir}/depend/pyramid.svg"/>
Expand All @@ -340,7 +359,11 @@
</target>

<target name="build-phpcb" description="Build CodeBrowser">
<exec executable="${script.phpcb}" failonerror="false" output="/dev/null" error="${log.dir}/error.log" append="true">
<exec executable="${script.phpcb}"
failonerror="false"
output="/dev/null"
error="${log.dir}/error.log"
append="true">
<arg value="-l${log.dir}"/>
<arg value="-o${log.dir}/code-browser"/>
<arg value="-s${app.dir}"/>
Expand Down Expand Up @@ -373,11 +396,11 @@
<target name="compile-tinymce" description="Builds a TinyMce package with default used plugins">
<!-- Combine all files -->
<concat destfile="${basedir}/engine/Library/TinyMce/tiny_mce_full.js">
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="tiny_mce.js" />
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="themes/advanced/langs/en.js" />
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="themes/advanced/langs/de.js" />
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="plugins/media_selection/editor_plugin.js" />
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="plugins/fullscreen/editor_plugin.js" />
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="tiny_mce.js"/>
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="themes/advanced/langs/en.js"/>
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="themes/advanced/langs/de.js"/>
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="plugins/media_selection/editor_plugin.js"/>
<fileset dir="${basedir}/engine/Library/TinyMce/" includes="plugins/fullscreen/editor_plugin.js"/>
</concat>
</target>
</project>

0 comments on commit 3966e79

Please sign in to comment.