0

We've started to use Satis for a private composer repository.

All is going well - except something which we cannot figure out.

--

When we run the satis build - it generates the json and the zips to download.

Our config resembles something like

{
    "name": "Premium Repositories",
    "homepage": "https://some-website.com",
    "require-all": false,
    "repositories": [
        {
            "type": "vcs",
            "url": "git@bitbucket.org:our-repo.git"
        }
    ],
    "archive": {
        "directory": "dist"
    }
}

The json it then generates contains something like

"some/package": {
    "dev-master": {
        "name": "some/package",
        "version": "dev-master",
        "version_normalized": "9999999-dev",
        "source": {
            "type": "git",
            "url": "git@bitbucket.org:selesti/some-package.git",
            "reference": "db0abb6a6983738d768b64684f82d178059b85b4"
        },
        "dist": {
            "type": "zip",
            "url": "https://some-domain/dist/some/package/some-package-dev-master-ec67bc.zip",
            "reference": "db0abb6a6983738d768b64684f82d178059b85b4",
            "shasum": "f04821a159f6f19ea6e5be8624d88f32b168e205"
        },
        "require": {
            "magento/framework": ">=100.0.0",
            "php": "~5.5.0|~5.6.0|>=7.0.0",
            "some/core": ">=3.0.0"
        },
        "time": "2018-02-16T09:00:56+00:00",
        "type": "magento2-module"
    }
}

We can clearly see from this it contains both the zip and the source.

This seems to mean that when we run composer install it tries to install the source version first - which fails as it doesn't have read-access - then it falls back to the dist, which works.

Is this the natural behaviour of composer if there is a source field within the composer.lock ? - And if so, is it possible for satis to not generate the source object, so it automatically goes straight to the dist key?

Thanks

owenmelbz
  • 6,180
  • 16
  • 63
  • 113

1 Answers1

0

I'm not sure if you can exclude source repos from Satis output, but as an alternative, you can tell Composer to use dist repos by default with configuration similar to:

{
    "config": {
        "preferred-install": "dist"
    }
}

You can also specify preferred-install config on package by package basis, as per docs:

{
    "config": {
        "preferred-install": {
            "my-organization/stable-package": "dist",
            "my-organization/*": "source",
            "partner-organization/*": "auto",
            "*": "dist"
        }
    }
}
Edi Modrić
  • 2,240
  • 1
  • 15
  • 18