Cscart-sdk docker

Good day. After creating and synchronizing the module using cscart-sdk, it is missing from the list of modules. Local CS-Cart is deployed in docker.

artoor@cscart:~/Documents/cscart/web/cscart/modules$ cscart-sdk addon:create test test
Addon: id: "test", scheme version: "3" themes: "responsive", locales: "en_US", dir: "/home/artoor/Documents/cscart/web/cscart/modules/test/"
Created directory "test/app/addons/test"  OK
Created directory "test/design/backend/css/addons/test"  OK
Created directory "test/design/backend/mail/templates/addons/test"  OK
Created directory "test/design/backend/media/fonts/addons/test"  OK
Created directory "test/design/backend/media/images/addons/test"  OK
Created directory "test/design/backend/templates/addons/test"  OK
Created directory "test/js/addons/test"  OK
Created directory "test/var/themes_repository/responsive/css/addons/test"  OK
Created directory "test/var/themes_repository/responsive/layouts/addons/test"  OK
Created directory "test/var/themes_repository/responsive/mail/templates/addons/test"  OK
Created directory "test/var/themes_repository/responsive/media/images/addons/test"  OK
Created directory "test/var/themes_repository/responsive/media/images/logos/addons/test"  OK
Created directory "test/var/themes_repository/responsive/templates/addons/test"  OK
Created addon scheme "test/app/addons/test/addon.xml"  OK
Created directory "test/var/langs/en/addons"  OK
Created locale "en_US" file: "test/var/langs/en/addons/test.po"  OK
artoor@cscart:~/Documents/cscart/web/cscart/modules$ cscart-sdk addon:sync test test $HOME/srv/app/www/dev.cscart.ru
Moving add-on files to the "/home/artoor/Documents/cscart/web/cscart/modules/test/" directory:
0 files and directories have been moved.

Creating symlinks at the "/home/artoor/srv/app/www/dev.cscart.ru/" directory:
Creating symlink for app/addons/test... OK
Creating symlink for var/langs/en/addons/test.po... OK
Creating symlink for js/addons/test... OK
Creating symlink for design/backend/css/addons/test... OK
Creating symlink for design/backend/mail/templates/addons/test... OK
Creating symlink for design/backend/media/images/addons/test... OK
Creating symlink for design/backend/media/fonts/addons/test... OK
Creating symlink for design/backend/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/css/addons/test... OK
Creating symlink for var/themes_repository/responsive/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/layouts/addons/test... OK
Creating symlink for var/themes_repository/responsive/mail/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/media/images/addons/test... OK
Creating symlink for var/themes_repository/responsive/media/images/logos/addons/test... OK

Hi!

As I can see, you’ve passed the relative path in <addon-directory> variable in your log. Try passing the absolute path there.

Anyway

composer: 2.2.6
cscart-sdk: 1.2.1
cscart Multi-Vendorv4.15.1.SP2

artoor@cscart:~/Documents/cscart/web/cscart/modules$ mkdir test

artoor@cscart:~/Documents/cscart/web/cscart/modules$ cscart-sdk addon:create test /home/artoor/Documents/cscart/web/cscart/modules/test
Addon: id: "test", scheme version: "3" themes: "responsive", locales: "en_US", dir: "/home/artoor/Documents/cscart/web/cscart/modules/test/"
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/app/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/design/backend/css/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/design/backend/mail/templates/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/design/backend/media/fonts/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/design/backend/media/images/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/design/backend/templates/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/js/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/css/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/layouts/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/mail/templates/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/media/images/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/media/images/logos/addons/test"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/themes_repository/responsive/templates/addons/test"  OK
Created addon scheme "/home/artoor/Documents/cscart/web/cscart/modules/test/app/addons/test/addon.xml"  OK
Created directory "/home/artoor/Documents/cscart/web/cscart/modules/test/var/langs/en/addons"  OK
Created locale "en_US" file: "/home/artoor/Documents/cscart/web/cscart/modules/test/var/langs/en/addons/test.po"  OK

artoor@cscart:~/Documents/cscart/web/cscart/modules$ cscart-sdk addon:sync test /home/artoor/Documents/cscart/web/cscart/modules/test /home/artoor/srv/app/www/dev.cscart.ru
Moving add-on files to the "/home/artoor/Documents/cscart/web/cscart/modules/test/" directory:
0 files and directories have been moved.
Creating symlinks at the "/home/artoor/srv/app/www/dev.cscart.ru/" directory:
Creating symlink for app/addons/test... OK
Creating symlink for var/langs/en/addons/test.po... OK
Creating symlink for js/addons/test... OK
Creating symlink for design/backend/css/addons/test... OK
Creating symlink for design/backend/mail/templates/addons/test... OK
Creating symlink for design/backend/media/images/addons/test... OK
Creating symlink for design/backend/media/fonts/addons/test... OK
Creating symlink for design/backend/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/css/addons/test... OK
Creating symlink for var/themes_repository/responsive/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/layouts/addons/test... OK
Creating symlink for var/themes_repository/responsive/mail/templates/addons/test... OK
Creating symlink for var/themes_repository/responsive/media/images/addons/test... OK
Creating symlink for var/themes_repository/responsive/media/images/logos/addons/test... OK

Symlinks successfully created in cs cart catalog, but i couldn’t find addon in admin panel (addons.manage)

Please clarify how do you perform the search? Look for the My addon name add-on, or search for test in the search field.

I am doing search as you described, I searched “test” in the search field.

Screenshot from 2024-11-06 09-01-22

Very strange. Unfortunately, I don’t know what the cause of this issue is, since I cannot reproduce it to perform some debugging.

Since you are using Docker, I have some assumptions:

  1. If you are making changes to the folder used by your docker image, check that the volume used by this image can be edited from outside (bind mount for example).
  2. If not, make sure you are running SDK commands inside the container, not outside.
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/artoor/srv/app",
                "Destination": "/app",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/artoor/srv/bin/sendmail",
                "Destination": "/usr/local/bin/sendmail",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/artoor/srv/config/php7.4/php-ini-overrides.ini",
                "Destination": "/usr/local/etc/php/conf.d/00-php.ini",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/artoor/srv/app",
                "Destination": "/app",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/artoor/srv/config/nginx",
                "Destination": "/etc/nginx/conf.d",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

As I can see, the path used in the SDK is different from the path specified in the mounts configuration you provided:

/home/artoor/Documents/cscart/web/cscart/modules/test

versus:

/home/artoor/srv/app

This is my separate directory for modules

Directory for CS-Cart

Or do we need to create addon using SDK in CS-Cart directory? So what’s the point of creating symlinks?

Sorry, I forgot that you also used the sync/symlink command. So I checked how it works in the Docker container. Every symlink saves its properties. So if you created a symlink pointing to /home/artoor/Documents/test_file.php, once that link is placed inside the container’s volume, it will still point to the /home/artoor/Documents/test_file.php path, which doesn’t exist inside the container’s volume, so it will be useless in this case.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.