Skip to content
Snippets Groups Projects

Publication sur le registre de paquets Gitlab-Forge en curl

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by erwan.salmon

    Commande curl permettant de publier un fichier sur le registre de paquet Gitlab Forge.

    Référence Gitlab :

    curl --header "PRIVATE-TOKEN: $GL_TOKEN" --upload-file path/to/file https://gitlab-forge.din.developpement-durable.gouv.fr/api/v4/projects/:project_id/packages/generic/:pkg_name/:pkg_version/:file

    Avec

    • GL_TOKEN : jeton privé Gitlab ayant un droit d'écriture sur le registre
    • path/to/file : chemin vers le fichier à publier
    • :project_id : identifiant numérique du projet
    • :pkg_name : nom du paquet
    • :pkg_version : version du paquet
    • :file : nom du fichier dans le registre

    Exemple

    curl --header "PRIVATE-TOKEN: $GL_TOKEN" --upload-file app-0.12.sql https://gitlab-forge.din.developpement-durable.gouv.fr/api/v4/projects/1234/packages/generic/app-dbexport/0.12/app-dbexport-0.12.sql
    Edited
    snippetfile1.txt 208 B
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment