How can I use Satis to recognize my Gitlab Releases instead of tags?

450 Views Asked by At

When pointing satis to a Gitlab repo, it chooses a dist url that mirrors the source url instead of finding the Gitlab Release and using the dist zip artifact.

Let's say your satis.json looks like this:

{
 "repositories": [
    { "type": "vcs", "url": "[email protected]:group-name/project-name.git" },
  ],
  "require-all": true
}

When you run satis build satis.json, satis will create a packages.json that looks like this:

{
    "packages": {
        "group-name/project-name": {
            "v1.0.1": {
                "name": "group-name/project-name",
                "version": "v1.0.1",
                "version_normalized": "1.0.1.0",
                "source": {
                    "type": "git",
                    "url": "[email protected]:group-name/project-name.git",
                    "reference": "68da091ec3d6891e8519095a8066b28eb2261c20"
                },
                "dist": {
                    "type": "zip",
                    "url": "https://gitlab.com/api/v4/projects/group-name%2Fproject-name/repository/archive.zip?sha=68da091ec3d6891e8519095a8066b28eb2261c20",
                    "reference": "68da091ec3d6891e8519095a8066b28eb2261c20",
                    "shasum": ""
                },
                "require": {
                    "composer/installers": "v1.0.6"
                },
                "require-dev": {
                    "wp-coding-standards/wpcs": "^2.2"
                },
                "time": "2020-01-13T04:39:57+00:00",
                "type": "wordpress-plugin"
            }
    }
}

The problem

The dist.url is simply an API call to Gitlab to generate a zip of the files as they appear within the git repo.

But I'm carefully constructing a zip distributable as part of my CI builds that contains minified javascript, generated css, etc. This zip distributable is then attached to a Gitlab Release as an artifact.

I want satis to find my GitLab Release and use the zip artifact in the dist.url. In my case, it would look something like this:

                "dist": {
                    "type": "zip",
                    "url": "https://gitlab.com/api/v4/projects/11301246/jobs/400678589/artifacts/project-name-1.0.1.zip",
                },
0

There are 0 best solutions below