<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
    <title>La Forge - ci</title>
    <subtitle>Le blog de la Forge</subtitle>
    <link rel="self" type="application/atom+xml" href="https://staging.lafor.ge/tags/ci/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://staging.lafor.ge"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-04-22T00:00:00+00:00</updated>
    <id>https://staging.lafor.ge/tags/ci/atom.xml</id>
    <entry xml:lang="fr">
        <title>Partie 2: Pipeline de CI</title>
        <published>2024-04-22T00:00:00+00:00</published>
        <updated>2024-04-22T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://staging.lafor.ge/crates-2/"/>
        <id>https://staging.lafor.ge/crates-2/</id>
        
        <content type="html" xml:base="https://staging.lafor.ge/crates-2/">&lt;details &gt;
	&lt;summary&gt;&lt;span&gt;Les articles de la série&lt;/span&gt;&lt;/summary&gt;
	&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;/crates-1&quot;&gt;Partie 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;/crates-3&quot;&gt;Partie 3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/details&gt;
&lt;p&gt;Bonjour à toutes et à tous 😀&lt;/p&gt;
&lt;p&gt;Dans l’article &lt;a href=&quot;/crates-1/&quot;&gt;précédent&lt;/a&gt; nous avons poussé à la main des crates en utilisant curl en local.&lt;/p&gt;
&lt;p&gt;Ce n’est pas du tout satisfaisant.&lt;/p&gt;
&lt;p&gt;Nous allons automatiser tout ça via la CI. Et comme nous avons commencé avec la package registry de Gitlab, on va également utilisé la Gitlab CI.&lt;/p&gt;
&lt;p&gt;J’ai un certain nombre d’exigences.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;une adresse unique pour toutes les crates, je ne veaux pas à avoir à me rappeler du chemin à chaque fois&lt;/li&gt;
&lt;li&gt;le versionnage est explicite et basé sur la version du package publié&lt;/li&gt;
&lt;li&gt;support des versions flottantes de dev&lt;/li&gt;
&lt;li&gt;ces versions de devs ont un versionnage implicite et automatique&lt;/li&gt;
&lt;li&gt;cela doit être le moins contraignant à utiliser, le moins de boilerplate possible&lt;/li&gt;
&lt;li&gt;il doit gérer les workspace Rust&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Autant dire qu’il y a un peu de travail.&lt;/p&gt;
&lt;h2 id=&quot;pipeline-de-ci-1o1&quot;&gt;Pipeline de CI 1o1&lt;/h2&gt;
&lt;p&gt;Commençons par la base.&lt;/p&gt;
&lt;p&gt;Si vous créez un fichier &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; à la racine d’un projet git et que vous le poussez sur Gitlab, cela va indiquer à Gitlab qu’il faut lancer un pipeline de CI.&lt;/p&gt;
&lt;p&gt;Son format est le suivant&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;tage1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;tage2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ob1&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;tage1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ob2&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;tage1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ob3&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;tage2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cela créé un graphe d’exécution qui va ressembler à ceci&lt;/p&gt;
&lt;pre class=&quot;mermaid&quot;&gt;
  

flowchart LR
    job1 --&gt;job3
    job2 --&gt; job3


&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;job1&lt;/code&gt; et &lt;code&gt;job2&lt;/code&gt; doivent tous les deux réussir si l’on veut que &lt;code&gt;job3&lt;/code&gt; s’exécute. Ce système de strates se nomme des &lt;em&gt;stages&lt;/em&gt; et permettent de réaliser des
checkpoints bloquants entre les différentes étapes.&lt;/p&gt;
&lt;p&gt;Par exemple ne packager que si le build est un succès est une bonne idée. 😎&lt;/p&gt;
&lt;p&gt;Nous nous allons définir un stage qui s’appellera &lt;code&gt;package&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Bon et maintenant, qu’est ce que l’on fait de nos jobs ?.&lt;/p&gt;
&lt;p&gt;La première chose est de définir une image qui sera notre environnement de packaging, nous faisons du rust, ça sera donc une image rust. Et de préférence versionnée.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ackage-crate&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nous allons écrire du bash, ce qui reste la meilleure façon d’intéragir avec un environnement.&lt;/p&gt;
&lt;p&gt;Et ce bash vient se mettre dans un &lt;em&gt;array&lt;/em&gt; nommé &lt;code&gt;scripts&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ackage-crate&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;cho &amp;quot;Hello World&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;packaging-en-ci&quot;&gt;Packaging en CI&lt;/h2&gt;
&lt;p&gt;D’abord récapitulons ce que nous avons fait en local:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nous avons défini un &lt;code&gt;.ssh/config&lt;/code&gt; contenant le host de notre proxy&lt;/li&gt;
&lt;li&gt;nous avons lancé les commandes de packaging&lt;/li&gt;
&lt;li&gt;nous avons fait du curl&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ok, mimons ce fonctionnement.&lt;/p&gt;
&lt;p&gt;Tout d’abord occupons-nous du SSH.&lt;/p&gt;
&lt;p&gt;La première chose que l’on va faire c’est définir des informations sous forme de variable d’environnement&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;RATE_PACKAGE_ENDPOINT=$CRATES_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;RATE_PACKAGE_USER=personal-token&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Bien maintenant le packaging en lui-même.&lt;/p&gt;
&lt;p&gt;Il nécessite plusieurs éléments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;l’addresse de l’API gitlab trouvable dans la variable injectée &lt;code&gt;$CI_API_V4_URL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;la version du package&lt;/li&gt;
&lt;li&gt;le nom du package&lt;/li&gt;
&lt;li&gt;le chemin vers le fichier &lt;code&gt;.crate&lt;/code&gt; à générer à partier des informations précédentes&lt;/li&gt;
&lt;li&gt;le token que l’on possède déjà&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pour rappel, cela à cette tête-là:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;-header&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;PRIVATE-TOKEN: &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;TOKEN&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;-upload-file&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; target/package/&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_FILE&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ENDPOINT&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;/projects/&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;PROJECT_ID&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;/packages/generic/&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_NAME&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_VERSION&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_FILE&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Commençons par récupérer le nom et la version du package.&lt;/p&gt;
&lt;p&gt;Pour cela nous pouvons utiliser un utiliser un utilitaire qui se nomme &lt;code&gt;tomlq&lt;/code&gt;, il vient avec &lt;code&gt;yq&lt;/code&gt; et permet de réaliser des requêtes &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://jqlang.github.io/jq/&quot;&gt;jq&lt;/a&gt; sur un fichier toml.&lt;/p&gt;
&lt;p&gt;Pour cela, on se rajoute la dépendance.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;apt&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; update&lt;/span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; apt&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; install&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; yq&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Puis on génère nos variables.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; CRATE_NAME&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;=&lt;/span&gt;&lt;span&gt;$(&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;tomlq&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;.package.name&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;  |&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; tr&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; CRATE_NAME&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;=&lt;/span&gt;&lt;span&gt;$(&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;tomlq&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;.package.version&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;  |&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; tr&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On vient “trim” les guillemets qui vont nous ennuyer par la suite.&lt;/p&gt;
&lt;p&gt;On peut alors constituer notre &lt;code&gt;$CRATE_FILE&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; CRATE_FILE&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;=&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_NAME&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;-&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_VERSION&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;crate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Il nous faut également un &lt;code&gt;$CRATE_PACKAGE_PROJECT_ID&lt;/code&gt; que l’on défini dans les variables d’environement&lt;/p&gt;
&lt;p&gt;Nous avons tous les ingédients, nous pouvons créer notre job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; gitlab token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_TOKEN&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_JOB_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; l&amp;#39;ID du projet qui supportera les crates par défaut le project du job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PROJECT_ID&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_PROJECT_ID&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; API user&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER_API&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; J&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;OB-TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ackage-crate&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si tout se passe bien, vous devriez voir apparaître dans la package registry de votre projet Gitlab un paquet &lt;code&gt;project v0.1.0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Maintenant intéressons nous au cas où le projet nécessite une dépendence qui elle même est privée.&lt;/p&gt;
&lt;p&gt;On se créé un projet pour tester.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;cargo&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;-lib&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; need_project&lt;/span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; cd&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; need_project&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;mkdir&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; .cargo&lt;/span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; cat&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;span&gt; EOF&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; .cargo/config&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;[registries.private-crate]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;index = &amp;quot;ssh://noa-crates.cleverapps.io/noa-crates/project&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;[net]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;git-fetch-with-cli = true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;  &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;project = {version=&amp;quot;0.1.0&amp;quot;, registry=&amp;quot;private-crate&amp;quot;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Comme vous pouvez le voir, nous allons devoir nous authentifier.&lt;/p&gt;
&lt;p&gt;Pour cela nous définissons dans l’objet &lt;code&gt;variables&lt;/code&gt; les différentes informations nécessaire à la connexion SSH.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_TOKEN&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_JOB_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;oa-crates.cleverapps.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PORT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-14&quot;&gt; 22066&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ersonal-token&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On créé le répertoire &lt;code&gt;.ssh&lt;/code&gt; avec les bons droits&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;mkdir&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ~/.ssh&lt;/span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt; chmod&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-14&quot;&gt; 700&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ~/.ssh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Via &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://linuxize.com/post/bash-heredoc/&quot;&gt;heredoc&lt;/a&gt; nous générons la configuration SSH:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;cat&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;span&gt; EOF&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ~/.ssh/config&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;Host &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    User &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_USER&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    Port &lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Mais cela n’est pas suffisant, il faut également générer une clef privée pour que la connexion SSH se fasse.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;ssh-keygen&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ed25519&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et finalement récupérer la clef publique de notre proxy SSH, sinon la connexion échouera en non-intéractif car le endpoint n’est pas “connu”.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;ssh-keyscan&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_PORT&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ok, notre job de CI est maintenant capable de réaliser notre authentification au proxy.&lt;/p&gt;
&lt;p&gt;Nous pouvons rassembler les pièces du puzzle&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; gitlab token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_TOKEN&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_JOB_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; l&amp;#39;ID du projet qui supportera les crates par défaut le project du job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PROJECT_ID&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_PROJECT_ID&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; API user&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER_API&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; J&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;OB-TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Host du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;oa-crates.cleverapps.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Port d&amp;#39;écoute du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PORT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-14&quot;&gt; 22066&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Utilisateur associé au token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ersonal-token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ackage-crate&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; configuration SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;kdir -p ~/.ssh &amp;amp;&amp;amp; chmod -R 700 ~/.ssh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        cat &amp;lt;&amp;lt; EOF &amp;gt; ~/.ssh/config &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        Host $CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            User $CRATE_PACKAGE_USER:$CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            Port $CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; création de la paire de clefs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keygen -t ed25519 -f ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; ajout de la clef publique du proxy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keyscan -p $CRATE_PACKAGE_PORT $CRATE_PACKAGE_ENDPOINT &amp;gt;&amp;gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et là c’est le drame 😫&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;fatal: Could not read from remote repository.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Please make sure you have the correct access rights&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;and the repository exists.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Oui, votre &lt;code&gt;$CI_JOB_TOKEN&lt;/code&gt; n’a de droit que sur le projet &lt;code&gt;need_project&lt;/code&gt; pas &lt;code&gt;project&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Mais heureusement, il est possible de régler le souci en passant en paramètre du job un token apte à intéragir avec les deux projets, pour Gitlab SaaS en gratuit nous n’avons pas le choix, ça sera forcément des token personnels, mais pour des version self-hosted, il est possible de créer des group token.&lt;/p&gt;
&lt;p&gt;Bref, dans la configuration de la CI du projet &lt;code&gt;need_project&lt;/code&gt; rajouté une variable d’environnement &lt;code&gt;CRATE_PACKAGE_TOKEN&lt;/code&gt; avec votre token.&lt;/p&gt;
&lt;p&gt;Il faut également redéfinir le &lt;code&gt;CRATE_PACKAGE_USER_API&lt;/code&gt; à &lt;code&gt;PRIVATE-TOKEN&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;On relance&lt;/p&gt;
&lt;p&gt;Si tout est correct,&lt;/p&gt;
&lt;p&gt;Votre pipeline devrait afficher quelque part ceci:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ cargo package&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;warning: manifest has no description, license, license-file, documentation, homepage or repository.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Packaging need_project v0.1.0 (/builds/noa-crates/need_project2)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Verifying need_project v0.1.0 (/builds/noa-crates/need_project2)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Updating `private-crate` index&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;From ssh://noa-crates.cleverapps.io/noa-crates/project&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; * [new ref]                    -&amp;gt; origin/HEAD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Downloading crates ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Downloaded project v0.1.0 (registry `private-crate`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Compiling project v0.1.0 (registry `private-crate`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Compiling need_project v0.1.0 (/builds/noa-crates/need_project2/target/package/need_project-0.1.0)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Finished dev [unoptimized + debuginfo] target(s) in 3.00s&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cela prouve que votre arbre de dépendences privée est bien reconstruite en CI. 🤩&lt;/p&gt;
&lt;p&gt;Succès ⁉️&lt;/p&gt;
&lt;p&gt;Oui et non, c’est très contraignant de connaître toute cette mécanique, on ne gère pas encore les workspace et les versions de pre-release sont impossible à réaliser en l’état.&lt;/p&gt;
&lt;p&gt;Bref on repars en chasse !&lt;/p&gt;
&lt;h2 id=&quot;versions-de-pre-release&quot;&gt;Versions de pre-release&lt;/h2&gt;
&lt;p&gt;Qu’est ce qu’une version de pre-release pour moi ?&lt;/p&gt;
&lt;p&gt;Une version de pre-release c’est une version pas fini mais qui est nécessaire de packager pour d’autres développements.&lt;/p&gt;
&lt;p&gt;Si on se fie à la notation &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://doc.rust-lang.org/cargo/reference/semver.html&quot;&gt;semver&lt;/a&gt; suivie par cargo.&lt;/p&gt;
&lt;p&gt;Il est possible de créer des versions qui ne sont pas “finies” en les suffixant d’un attribut.&lt;/p&gt;
&lt;p&gt;par exemple &lt;code&gt;1.0.0-alpha.0&lt;/code&gt;, le suffixe de version &lt;code&gt;alpha.0&lt;/code&gt; indique la notion de pre-release de cette &lt;code&gt;1.0.0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Mais on peut y mettre ce que l’on désire comme le SHA1 réduit de 8 caratères du commit de version.&lt;/p&gt;
&lt;p&gt;C’est ce que j’ai décidé de faire pour générer des versions comme &lt;code&gt;1.0.2-2e92f1ff&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Pour cela nous allons concaténer la version récupérer du Cargo.toml et la joindre au contenu de la varaible &lt;code&gt;$CI_COMMIT_SHORT_SHA&lt;/code&gt; injecté par le job.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; CRATE_VERSION&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_VERSION&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CI_COMMIT_SHORT_SHA&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ok easy non ?&lt;/p&gt;
&lt;p&gt;Alors non, si vous tentez de faire ça comme cela, la commande &lt;code&gt;cargo package&lt;/code&gt; n’utilisera pas votre version modifiée et créera un &lt;code&gt;target/package/project-0.1.0.crate&lt;/code&gt; au lieu
du &lt;code&gt;target/package/project-0.1.0-2e92f1ff.crate&lt;/code&gt; voulu.&lt;/p&gt;
&lt;p&gt;Il va falloir trafiquer le Cargo.toml pour mettre à jour la version.&lt;/p&gt;
&lt;p&gt;tomlq permet au moyen du paramètre &lt;code&gt;--arg&lt;/code&gt; d’injecter de l’environnement.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;tomlq&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;-arg&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; VERSION&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;CRATE_VERSION&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;.package.version = $VERSION&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-3&quot;&gt; &amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml.modified&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;mv&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml.modified&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; Cargo.toml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et il faut également rajouter un paramètre &lt;code&gt;--allow-dirty&lt;/code&gt; pour packager sans avoir à commiter.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cargo package --allow-dirty&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On est bon ?&lt;/p&gt;
&lt;p&gt;Presque.&lt;/p&gt;
&lt;p&gt;Il faut que l’on découple les run entre la branche &lt;code&gt;main&lt;/code&gt; et les autres: je veux que le package de release ne se déclenche que sur la branche main et pas ailleurs.&lt;/p&gt;
&lt;p&gt;Et je veux également que le run du packaging de pre-release soit une tâche manuelle.&lt;/p&gt;
&lt;p&gt;Heuresement Gitlab Ci permet de configurer tout ceci.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitlab-ci.yml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-dev&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; nécessite une intervention humaine&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    w&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;hen&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;anual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; si la branche n&amp;#39;est pas main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ules&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;f&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-prod&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; seulement si c&amp;#39;est main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;    o&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;nly&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et maintenant on rempli&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; gitlab token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_TOKEN&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_JOB_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; l&amp;#39;ID du projet qui supportera les crates par défaut le project du job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PROJECT_ID&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_PROJECT_ID&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; API user&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER_API&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; J&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;OB-TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Host du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;oa-crates.cleverapps.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Port d&amp;#39;écoute du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PORT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-14&quot;&gt; 22066&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Utilisateur associé au token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ersonal-token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-dev&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; nécessite une intervention humaine&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  w&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;hen&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;anual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; si la branche n&amp;#39;est pas main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ules&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;f&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; configuration SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;kdir -p ~/.ssh &amp;amp;&amp;amp; chmod -R 700 ~/.ssh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        cat &amp;lt;&amp;lt; EOF &amp;gt; ~/.ssh/config &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        Host $CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            User $CRATE_PACKAGE_USER:$CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            Port $CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; création de la paire de clefs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keygen -t ed25519 -f ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; ajout de la clef publique du proxy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keyscan -p $CRATE_PACKAGE_PORT $CRATE_PACKAGE_ENDPOINT &amp;gt;&amp;gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; on créé la version flottante&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$CRATE_VERSION-$CI_COMMIT_SHORT_SHA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; On remplace la version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;omlq --arg VERSION $CRATE_VERSION -t &amp;#39;.package.version = $VERSION&amp;#39; Cargo.toml &amp;gt; Cargo.toml.modified&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;v Cargo.toml.modified Cargo.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package --allow-dirty&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-prod&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; seulement si c&amp;#39;est main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  o&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;nly&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; configuration SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;kdir -p ~/.ssh &amp;amp;&amp;amp; chmod -R 700 ~/.ssh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        cat &amp;lt;&amp;lt; EOF &amp;gt; ~/.ssh/config &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        Host $CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            User $CRATE_PACKAGE_USER:$CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;            Port $CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; création de la paire de clefs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keygen -t ed25519 -f ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; ajout de la clef publique du proxy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keyscan -p $CRATE_PACKAGE_PORT $CRATE_PACKAGE_ENDPOINT &amp;gt;&amp;gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si l’on&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; checkout&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; `&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;dev&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-2 z-d-4&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; push&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-4 z-d-11&quot;&gt;-set-upstream&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; origin&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; dev&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Un pipeline avec une tâche manuelle va apparaître&lt;/p&gt;
&lt;p&gt;Et dedans normalement&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ cargo package --allow-dirty&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Packaging need_project v0.1.0-0eb85488 (/builds/noa-crates/need_project2)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Verifying need_project v0.1.0-0eb85488 (/builds/noa-crates/need_project2)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Updating `private-crate` index&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;From ssh://noa-crates.cleverapps.io/noa-crates/project&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; * [new ref]                    -&amp;gt; origin/HEAD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Downloading crates ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Downloaded project v0.1.0 (registry `private-crate`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Compiling project v0.1.0 (registry `private-crate`)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   Compiling need_project v0.1.0-0eb85488 (/builds/noa-crates/need_project2/target/package/need_project-0.1.0-0eb85488)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Finished dev [unoptimized + debuginfo] target(s) in 2.89s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Packaged 6 files, 4.7KiB (1.8KiB compressed)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Félicitation, vous avez packagé votre version &lt;code&gt;0.1.0-0eb85488&lt;/code&gt; de &lt;code&gt;need_project&lt;/code&gt; et celle-ci peut alors se retrouver dans la package registry de &lt;code&gt;need_project&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;factorisation&quot;&gt;Factorisation&lt;/h2&gt;
&lt;p&gt;Tout cela c’est très bien mais on voit bien que les étapes sont très semblables entre le job de release et de pre-release.&lt;/p&gt;
&lt;p&gt;Il doit être possible de mettre en place un système qui permet de factoriser ces répétitions, et ce mécanisme ne provient pas de Gitlab mais du format YAML, lui-même.&lt;/p&gt;
&lt;p&gt;Il s’agit des &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/&quot;&gt;YAML anchors&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Qu’est ce que l’on peut factoriser ?&lt;/p&gt;
&lt;p&gt;Tout d’abord les dépendences&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;dependencies&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;dependencies&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Puis la définition de la configuration SSH&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ssh-connexion&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;ssh-connexion:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; configuration SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;kdir -p ~/.ssh &amp;amp;&amp;amp; chmod -R 700 ~/.ssh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    cat &amp;lt;&amp;lt; EOF &amp;gt; ~/.ssh/config &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    Host $CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        User $CRATE_PACKAGE_USER:$CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        Port $CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; création de la paire de clefs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keygen -t ed25519 -f ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; ajout de la clef publique du proxy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keyscan -p $CRATE_PACKAGE_PORT $CRATE_PACKAGE_ENDPOINT &amp;gt;&amp;gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ensuite, la récupération des informations du package.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;version&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et finalement, le packaging en lui-même&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package --allow-dirty&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; l&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;s target/package/$CRATE_FILE&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl -i --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl -i --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On peut alors jouer aux légos 🧱&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;dependencies&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ssh-connexion&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-dev&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; manuel&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  w&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;hen&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;anual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; si la branche n&amp;#39;est pas main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ules&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;f&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; on créé la version flottante&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$CRATE_VERSION-$CI_COMMIT_SHORT_SHA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; On remplace la version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;omlq --arg VERSION $CRATE_VERSION -t &amp;#39;.package.version = $VERSION&amp;#39; Cargo.toml &amp;gt; Cargo.toml.modified&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;v Cargo.toml.modified Cargo.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-prod&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; seulement si c&amp;#39;est main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  o&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;nly&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ain&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C’est quand même plus clean comme ça 😀&lt;/p&gt;
&lt;details &gt;
	&lt;summary&gt;&lt;span&gt;.gitlab-ci.yml&lt;/span&gt;&lt;/summary&gt;
	&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ariables&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; gitlab token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_TOKEN&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_JOB_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; l&amp;#39;ID du projet qui supportera les crates par défaut le project du job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PROJECT_ID&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_PROJECT_ID&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; API user&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER_API&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; J&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;OB-TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Host du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;oa-crates.cleverapps.io&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Port d&amp;#39;écoute du proxy SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_PORT&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-14&quot;&gt; 22066&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; Utilisateur associé au token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  C&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;RATE_PACKAGE_USER&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ersonal-token&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;dependencies&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;dependencies&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; dépendences&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;pt update &amp;amp;&amp;amp; apt install -y yq&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ssh-connexion&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;ssh-connexion&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; configuration SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;kdir -p ~/.ssh &amp;amp;&amp;amp; chmod -R 700 ~/.ssh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    cat &amp;lt;&amp;lt; EOF &amp;gt; ~/.ssh/config &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    Host $CRATE_PACKAGE_ENDPOINT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        User $CRATE_PACKAGE_USER:$CRATE_PACKAGE_TOKEN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;        Port $CRATE_PACKAGE_PORT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;    EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; création de la paire de clefs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keygen -t ed25519 -f ~/.ssh/id_ed25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; ajout de la clef publique du proxy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;sh-keyscan -p $CRATE_PACKAGE_PORT $CRATE_PACKAGE_ENDPOINT &amp;gt;&amp;gt; ~/.ssh/known_hosts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo package --allow-dirty&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;argo metadata --format-version 1 &amp;gt; metadata.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; l&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;s target/package/$CRATE_FILE&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; upload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl -i --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file target/package/${CRATE_FILE} &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/$CRATE_FILE&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;#39;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;curl -i --header &amp;quot;$CRATE_PACKAGE_USER_API: $CRATE_PACKAGE_TOKEN&amp;quot; --upload-file metadata.json &amp;quot;${CI_API_V4_URL}/projects/${CRATE_PACKAGE_PROJECT_ID}/packages/generic/${CRATE_NAME}/${CRATE_VERSION}/metadata.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;version&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; récupération des informations du paquet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_NAME=$(tomlq &amp;#39;.package.name&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$(tomlq &amp;#39;.package.version&amp;#39; Cargo.toml  | tr -d &amp;#39;&amp;quot;&amp;#39;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;dependencies&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ssh-connexion&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-dev&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; manuel&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  w&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;hen&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;anual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; si la branche n&amp;#39;est pas main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;ules&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;f&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; on créé la version flottante&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_VERSION=$CRATE_VERSION-$CI_COMMIT_SHORT_SHA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;xport CRATE_FILE=${CRATE_NAME}-${CRATE_VERSION}.crate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;    #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; On remplace la version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;omlq --arg VERSION $CRATE_VERSION -t &amp;#39;.package.version = $VERSION&amp;#39; Cargo.toml &amp;gt; Cargo.toml.modified&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;v Cargo.toml.modified Cargo.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;elease-prod&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;mage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ust:1.77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;tage&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ackaging&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-7 z-d-7&quot;&gt; seulement si c&amp;#39;est main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  o&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;nly&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; m&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;ain&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;  s&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;cript&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;prepare&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    -&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-10&quot;&gt; *&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;packaging&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/details&gt;
&lt;p&gt;Pour le &lt;a href=&quot;/crates-3&quot;&gt;prochain&lt;/a&gt;, article on verra comment gérer le problème épineux des workspaces.&lt;/p&gt;
</content>
        
    </entry>
</feed>
