Skip to content

Ensure Debian uploads can reference a suite

Mathieu Parent requested to merge sathieu/gitlab:debian_codename into master

While reading the code, I found that upload to Debian using the suite was not working.

Feature flagged

The Debian package feature is still behind a feature flag and not yet enabled on GitLab.com.

See #337288.

Testing

  • install dput-ng (prerequisite: a Debian or derived distribution - like Ubuntu)

    apt install dput-ng
  • Get a private token $api_token (with API scope)

  • Create a project, get the $project id

  • Define a distribution $codename (for example foobar)

  • Create a distribution:

    curl --request POST --header "PRIVATE-TOKEN: $api_token" "http://localhost:3000/api/v4/projects/$project_id/debian_distributions?codename=$codename&suite=unstable"
  • Configure dput-ng:

    $ cat <<EOF > dput.cf
    [gitlab]
    method = http
    fqdn = root:$api_token@localhost:3000
    incoming = /api/v4/projects/$project_id/packages/debian
    EOF
  • Upload (this package is targeting unstable):

    dput --config=dput.cf --unchecked --no-upload-log gitlab spec/fixtures/packages/debian/sample_1.2.3~alpha2_amd64.changes
  • Verify that the package is visible in the interface and available in the repository

    $ sudo mkdir -p /usr/local/share/keyrings
    $ curl --header "PRIVATE-TOKEN: $api_token" \
        "http://localhost:3000/api/v4/projects/$project_id/debian_distributions/$codename/key.asc" \
        | \
        gpg --dearmor \
        | \
        sudo tee /usr/local/share/keyrings/$codename-archive-keyring.gpg \
        > /dev/null
    $ echo "deb [ signed-by=/usr/local/share/keyrings/$codename-archive-keyring.gpg ] http://localhost:3000/api/v4/projects/$project_id/packages/debian $codename main" \
     | sudo tee /etc/apt/sources.list.d/gitlab_project.list > /dev/null
    $ sudo apt-get update
    $ apt show sample-dev
Edited by Mathieu Parent

Merge request reports