Search code examples
continuous-integrationshopware6

build-administration in Shopware 6 without database and without var/plugins.json


We are pre-building a docker image for our Shopware in the CI pipeline. During the build, no database is available.

Now we saw that the administration for custom plugins is not built:

During

CI=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true DATABASE_URL= bin/build-administration.sh

This is printed:

#20 0.512 + /var/www/bin/ci bundle:dump
#20 2.309 Warning: Failed to load apps. Loading apps from local. Message: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for _placeholder.test failed: Name or service not known
#20 2.312 

Which makes sense, as there is no database.

One solution would be to add the var/plugins.json to the git repository to make the build work.

Is this the only solution or is there some "smarter" way, to generate the plugins.json with all the plugins which are found in the filesystem?


Solution

  • Adding to dneustadt's answer:

    It is additionally important to use SHOPWARE_SKIP_BUNDLE_DUMP. Otherwise some of the plugins will be dumped to the plugins.json while custom plugins are missing.

    So

    • commit the var/plugins.json to the git
    • use
      CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true DATABASE_URL= bin/build-administration.sh
      CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=true SHOPWARE_SKIP_THEME_COMPILE=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true DATABASE_URL= bin/build-storefront.sh
      
      to build