1

I want to deploy shopware 6.5 with deployer 7 with bitbucket pipelines. When I commit my changes to bitbucket the pipeline get executed. But then it hangs in some defined tasks in the deploy.php.

The shopware tasks look like this:

task('sw:deploy', [
    'sw:touch_install_lock',
    'sw:build',
    'sw:database:migrate',
    'sw:theme:compile',
    'sw:cache:clear',
]);

At first I got an error in 'sw:build' saying that with this line is an error:

run('cd {{release_path}} && bash bin/build-js.sh');

Then I thought I need a database for that command and have to skip it. For that I removed that command and replaced it with some tasks from the deployer/recipe/shopware.php:

task('sw:deploy', [
    'sw:touch_install_lock',
    'sw:database:migrate',
    'sw:theme:compile',
    'sw:cache:clear',
]);

task('sw-build-without-db:get-remote-config', static function () {
    if (!test('[ -d {{current_path}} ]')) {
        return;
    }
    within('{{deploy_path}}/current', function () {
        run('{{bin/php}} ./bin/console bundle:dump');
        download('{{deploy_path}}/current/var/plugins.json', './var/');

        run('{{bin/php}} ./bin/console theme:dump');
        download('{{deploy_path}}/current/files/theme-config', './files/');
    });
});

task('sw-build-without-db:build', static function () {
    runLocally('CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=1 SHOPWARE_SKIP_THEME_COMPILE=1 bin/build-js.sh');
});


task('sw-build-without-db', [
    'sw-build-without-db:get-remote-config',
    'sw-build-without-db:build',
]);

before('deploy:update_code', 'sw-build-without-db');

But now I got this error:

[localhost] run CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=1 SHOPWARE_SKIP_THEME_COMPILE=1 bin/build-js.sh
[localhost] Cannot check extensions for required npm installations as jq is not installed
[localhost] /opt/atlassian/pipelines/agent/build/bin/build-administration.sh: line 53: cd: /opt/atlassian/pipelines/agent/build/vendor/shopware/administration/Resources/app/administration: No such file or directory
[server.de] error  in deploy.php on line 106:
[server.de] exit code 1 (General error)
done sw-build-without-db:build 91ms
ERROR: Task sw-build-without-db:build failed!

I have installed jq on my Macbook but the error is still there.

I wonder if that have to be executed in docker in bitbucket. In the pipelines tag I got this messages:

time="2023-07-13T13:33:00.176324092Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2023-07-13T13:33:00.176761183Z" level=warning msg="Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network." host="tcp://0.0.0.0:2375"
time="2023-07-13T13:33:00.176825537Z" level=warning msg="Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there!" host="tcp://0.0.0.0:2375"

I would be grateful for some hints.

Gunnarius
  • 59
  • 5
  • I believe the error comes from bitbucket, not from deployer. And I guess also that bitbucket is using docker - maybe this helps: https://stackoverflow.com/questions/67126094/how-to-connect-to-docker-daemon-in-bitbucket-pipeline ? – Alex Jul 31 '23 at 17:10

0 Answers0