{"id":7273,"date":"2025-08-26T09:33:30","date_gmt":"2025-08-26T09:33:30","guid":{"rendered":"https:\/\/techhub.saworks.io\/docs\/tutoriel-github-intermediaire\/creer-des-applications-avec-azure-devops\/taches-de-compilation\/"},"modified":"2025-09-24T12:02:34","modified_gmt":"2025-09-24T12:02:34","slug":"taches-de-compilation","status":"publish","type":"docs","link":"https:\/\/techhub.saworks.io\/fr\/docs\/tutoriel-github-intermediaire\/creer-des-applications-avec-azure-devops\/taches-de-compilation\/","title":{"rendered":"t\u00e2ches de compilation"},"content":{"rendered":"\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>Mara a maintenant une copie du code du jeu spatial. Elle va le compiler en utilisant Microsoft Azure Pipelines au lieu du serveur de build Ubuntu 22.04 existant. Avant de pouvoir faire cela, elle doit r\u00e9fl\u00e9chir aux scripts de build existants. Suivez-la pendant qu&rsquo;elle associe les scripts existants aux t\u00e2ches d\u2019Azure Pipelines. R\u00e9fl\u00e9chissez \u00e0 la mani\u00e8re dont vous pouvez faire la m\u00eame chose avec votre propre processus de build.<\/strong><\/p>\n\n\n\n<p>Voici quelques notes que Mara a recueillies lors de sa discussion avec Andy, le responsable du d\u00e9veloppement :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>La machine de build fonctionne sous Ubuntu 22.04.<\/li>\n\n\n\n<li>Elle contient des outils de build comme :\n<ul class=\"wp-block-list\">\n<li><strong>npm<\/strong>, le gestionnaire de paquets pour Node.js<\/li>\n\n\n\n<li><strong>NuGet<\/strong>, le gestionnaire de paquets pour .NET<\/li>\n\n\n\n<li><strong>.NET SDK<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Le projet utilise&nbsp;<strong>Sass (Syntactically Awesome Style Sheets)<\/strong>&nbsp;pour faciliter la cr\u00e9ation de fichiers CSS.<\/li>\n\n\n\n<li>Le projet utilise l\u2019outil&nbsp;<strong>gulp<\/strong>&nbsp;pour minifier les fichiers JavaScript et CSS.<\/li>\n\n\n\n<li>Un fichier minifi\u00e9 exclut les donn\u00e9es inutiles (comme les espaces blancs) et raccourcit les noms de variables pour acc\u00e9l\u00e9rer le t\u00e9l\u00e9chargement.<\/li>\n<\/ul>\n\n\n\n<p>Voici les \u00e9tapes du processus de build :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Pour installer les paquets Node.js d\u00e9finis dans&nbsp;<code>package.json<\/code>, ex\u00e9cuter&nbsp;<code>npm install<\/code>.<\/li>\n\n\n\n<li>Pour convertir les fichiers Sass (<code>.scss<\/code>) en fichiers CSS (<code>.css<\/code>), ex\u00e9cuter&nbsp;<code>node-sass<\/code>.<\/li>\n\n\n\n<li>Pour minifier les fichiers JavaScript et CSS, ex\u00e9cuter&nbsp;<code>gulp<\/code>.<\/li>\n\n\n\n<li>Pour aider l\u2019\u00e9quipe QA \u00e0 identifier le num\u00e9ro et la date du build, imprimer les informations de build dans le r\u00e9pertoire&nbsp;<code>wwwroot<\/code>.<\/li>\n\n\n\n<li>Pour installer les d\u00e9pendances du projet, ex\u00e9cuter&nbsp;<code>dotnet restore<\/code>.<\/li>\n\n\n\n<li>Pour compiler l\u2019application en configurations Debug et Release, ex\u00e9cuter&nbsp;<code>dotnet build<\/code>.<\/li>\n\n\n\n<li>Pour empaqueter l\u2019application dans un fichier&nbsp;<code>.zip<\/code>&nbsp;et copier les r\u00e9sultats sur un partage r\u00e9seau pour que l\u2019\u00e9quipe QA puisse les r\u00e9cup\u00e9rer, ex\u00e9cuter&nbsp;<code>dotnet publish<\/code>.<\/li>\n<\/ol>\n\n\n\n<p><strong>Mara cr\u00e9e un script shell qui ex\u00e9cute les t\u00e2ches qu\u2019elle a identifi\u00e9es. Elle le lance sur son ordinateur portable.<\/strong><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-background is-layout-constrained wp-block-group-is-layout-constrained\" style=\"border-width:1px;border-radius:15px;background-color:#9b51e04d\">\n<h3 class=\"wp-block-heading\"><strong>Remarque<\/strong><\/h3>\n\n\n\n<p>Vous n\u2019avez pas besoin d\u2019ex\u00e9cuter ce script ni de le comprendre enti\u00e8rement. Il est pr\u00e9sent\u00e9 ici pour illustrer ce que fait typiquement un script de build.<\/p>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">Bash<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>#!\/bin\/bash\n\n# Install Node.js modules as defined in package.json.\nnpm install --quiet\n\n# Compile Sass (.scss) files to standard CSS (.css).\nnode-sass Tailspin.SpaceGame.Web\/wwwroot\n\n# Minify JavaScript and CSS files.\ngulp\n\n# Print the date to wwwroot\/buildinfo.txt.\necho `date` > Tailspin.SpaceGame.Web\/wwwroot\/buildinfo.txt\n\n# Install the latest .NET packages the app depends on.\ndotnet restore\n\n# Build the app under the Debug configuration.\ndotnet build --configuration Debug\n\n# Publish the build to the \/tmp directory.\ndotnet publish --no-build --configuration Debug --output \/tmp\/Debug\n\n# Build the app under the Release configuration.\ndotnet build --configuration Release\n\n# Publish the build to the \/tmp directory.\ndotnet publish --no-build --configuration Release --output \/tmp\/Release<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A737D\">#!\/bin\/bash<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Install Node.js modules as defined in package.json.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">npm<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">install<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--quiet<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Compile Sass (.scss) files to standard CSS (.css).<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">node-sass<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">Tailspin.SpaceGame.Web\/wwwroot<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Minify JavaScript and CSS files.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">gulp<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Print the date to wwwroot\/buildinfo.txt.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">echo<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">`<\/span><span style=\"color: #6F42C1\">date<\/span><span style=\"color: #032F62\">`<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #D73A49\">&gt;<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6F42C1\">Tailspin.SpaceGame.Web\/wwwroot\/buildinfo.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Install the latest .NET packages the app depends on.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">dotnet<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">restore<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Build the app under the Debug configuration.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">dotnet<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">build<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--configuration<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">Debug<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Publish the build to the \/tmp directory.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">dotnet<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">publish<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--no-build<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--configuration<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">Debug<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--output<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">\/tmp\/Debug<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Build the app under the Release configuration.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">dotnet<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">build<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--configuration<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">Release<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Publish the build to the \/tmp directory.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6F42C1\">dotnet<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">publish<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--no-build<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--configuration<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">Release<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">--output<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #032F62\">\/tmp\/Release<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Le r\u00e9pertoire&nbsp;<code>\/tmp<\/code>&nbsp;imite le partage r\u00e9seau de l\u2019\u00e9quipe.<\/strong><\/p>\n\n\n\n<p>Apr\u00e8s avoir ex\u00e9cut\u00e9 le script, Mara se rend compte qu\u2019il est incomplet. Par exemple, il ne g\u00e8re pas les erreurs. Il ne pr\u00e9vient personne en cas d\u2019erreurs de build. M\u00eame lorsqu\u2019il y a des erreurs, il continue \u00e0 s\u2019ex\u00e9cuter. Il n\u2019installe pas non plus les outils n\u00e9cessaires \u00e0 chaque \u00e9tape.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Qu\u2019est-ce qu\u2019une t\u00e2che Azure Pipelines ?<\/strong><\/h3>\n\n\n\n<p>Dans Azure Pipelines, une&nbsp;<strong>t\u00e2che<\/strong>&nbsp;est un script ou une proc\u00e9dure empaquet\u00e9e, abstraite avec un ensemble d\u2019entr\u00e9es.<\/p>\n\n\n\n<p>Une t\u00e2che Azure Pipelines masque les d\u00e9tails sous-jacents. Cette abstraction facilite l\u2019ex\u00e9cution de fonctions de build courantes, comme le t\u00e9l\u00e9chargement des outils de build ou des paquets dont votre application d\u00e9pend, ou encore la compilation de votre projet avec Visual Studio ou Xcode.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Pour compiler un projet C# ciblant .NET<\/strong>, voici un exemple utilisant la t\u00e2che&nbsp;<code>DotNetCoreCLI@2<\/code>&nbsp;:<\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>task: DotNetCoreCLI@2\n  displayName: 'Build the project'\n  inputs:\n    command: 'build'\n    arguments: '--no-restore --configuration Release'\n    projects: '**\/*.csproj'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #22863A\">task<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">DotNetCoreCLI@2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">displayName<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;Build the project&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">inputs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">command<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;build&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">arguments<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;--no-restore --configuration Release&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">projects<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;**\/*.csproj&#39;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Le pipeline pourrait traduire cette t\u00e2che en cette commande :<\/strong><\/p>\n\n\n\n<p>.NET CLI<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dotnet build MyProject.csproj --no-restore --configuration Release<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>D\u00e9composons un peu plus cette t\u00e2che :<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>La t\u00e2che&nbsp;<code>DotNetCoreCLI@2<\/code>&nbsp;correspond \u00e0 la commande&nbsp;<code>dotnet<\/code>.<\/li>\n\n\n\n<li><code>displayName<\/code>&nbsp;d\u00e9finit le nom de la t\u00e2che affich\u00e9 dans l\u2019interface utilisateur. Vous verrez cela en action bient\u00f4t.<\/li>\n\n\n\n<li><code>inputs<\/code>&nbsp;d\u00e9finit les arguments transmis \u00e0 la commande.<\/li>\n\n\n\n<li><code>command<\/code>&nbsp;sp\u00e9cifie qu\u2019il faut ex\u00e9cuter la sous-commande&nbsp;<code>dotnet build<\/code>.<\/li>\n\n\n\n<li><code>arguments<\/code>&nbsp;sp\u00e9cifie les arguments suppl\u00e9mentaires \u00e0 transmettre \u00e0 la commande.<\/li>\n\n\n\n<li><code>projects<\/code>&nbsp;indique quels projets compiler. Cet exemple utilise le motif g\u00e9n\u00e9rique&nbsp;<code>**\/*.csproj<\/code>. Les \u00e9l\u00e9ments&nbsp;<code>**<\/code>&nbsp;et&nbsp;<code>*.csproj<\/code>&nbsp;sont des exemples de ce qu\u2019on appelle des&nbsp;<strong>motifs glob<\/strong>&nbsp;:\n<ul class=\"wp-block-list\">\n<li><code>**<\/code>&nbsp;indique qu\u2019il faut rechercher dans le r\u00e9pertoire courant et tous ses sous-r\u00e9pertoires.<\/li>\n\n\n\n<li><code>*.csproj<\/code>&nbsp;indique tous les fichiers avec l\u2019extension&nbsp;<code>.csproj<\/code>.<\/li>\n\n\n\n<li>Les&nbsp;<strong>caract\u00e8res g\u00e9n\u00e9riques<\/strong>&nbsp;permettent d\u2019agir sur plusieurs fichiers sans les sp\u00e9cifier un par un. Si vous devez agir sur un fichier sp\u00e9cifique, vous pouvez le nommer directement au lieu d\u2019utiliser des jokers.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Le symbole&nbsp;<code>@<\/code>&nbsp;dans le nom de la t\u00e2che \u2014 par exemple&nbsp;<code>DotNetCoreCLI@2<\/code>&nbsp;\u2014 fait r\u00e9f\u00e9rence \u00e0 la&nbsp;<strong>version de la t\u00e2che<\/strong>. Lorsque de nouvelles versions sont disponibles, vous pouvez migrer progressivement vers la derni\u00e8re pour b\u00e9n\u00e9ficier des nouvelles fonctionnalit\u00e9s.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Comment les t\u00e2ches sont-elles utilis\u00e9es dans un pipeline ?<\/strong><\/h3>\n\n\n\n<p>Ensuite, Mara va associer les commandes de son script aux t\u00e2ches Azure Pipelines. Un&nbsp;<strong>pipeline<\/strong>&nbsp;est cr\u00e9\u00e9 \u00e0 l\u2019aide d\u2019un fichier&nbsp;<strong>YAML<\/strong>, un format compact qui facilite la structuration des donn\u00e9es typiques des fichiers de configuration. Les fichiers YAML de pipeline sont g\u00e9n\u00e9ralement maintenus directement avec le code source de l\u2019application.<\/p>\n\n\n\n<p>Mara a d\u00e9j\u00e0 utilis\u00e9 YAML pour d\u00e9finir des t\u00e2ches de build et des configurations similaires. Elle appr\u00e9cie aussi l\u2019id\u00e9e de&nbsp;<strong>maintenir la d\u00e9finition du build comme du code<\/strong>, tout comme elle le ferait pour n\u2019importe quelle autre partie de son projet.<\/p>\n\n\n\n<p>Pour d\u00e9finir son build, Mara choisit d\u2019utiliser&nbsp;<strong>Visual Studio Code<\/strong>&nbsp;pour cr\u00e9er un fichier YAML. Elle y saisit toutes les t\u00e2ches Azure Pipelines qu\u2019elle utilisera pour remplacer les commandes de script existantes.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Associer les commandes du script aux t\u00e2ches Azure Pipelines<\/strong><\/h3>\n\n\n\n<p>Vous allez maintenant suivre Mara pendant qu\u2019elle associe les commandes de son script aux t\u00e2ches Azure Pipelines.<\/p>\n\n\n\n<p>Pour chaque commande, Mara consulte la documentation de r\u00e9f\u00e9rence. Celle-ci classe les t\u00e2ches par fonction, comme&nbsp;<strong>build<\/strong>&nbsp;ou&nbsp;<strong>d\u00e9ploiement<\/strong>.<\/p>\n\n\n\n<p>Par exemple, la t\u00e2che CLI .NET Core&nbsp;<code>DotNetCoreCLI@2<\/code>&nbsp;permet d\u2019ex\u00e9cuter des commandes&nbsp;<code>dotnet<\/code>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Ce tableau associe les commandes du script aux nouvelles t\u00e2ches Azure Pipelines :<\/strong><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Commande du script<\/strong><\/th><th><strong>T\u00e2che Azure Pipelines<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>npm install<\/code><\/td><td><code>Npm@1<\/code><\/td><\/tr><tr><td><code>node-sass<\/code><\/td><td><code>CmdLine@2<\/code> (ou <code>script<\/code>)<\/td><\/tr><tr><td><code>gulp<\/code><\/td><td><code>gulp@1<\/code><\/td><\/tr><tr><td><code>echo \\<\/code>date\u00ab\u00a0<\/td><td><code>CmdLine@2<\/code> (ou <code>script<\/code>)<\/td><\/tr><tr><td><code>dotnet restore<\/code><\/td><td><code>DotNetCoreCLI@2<\/code><\/td><\/tr><tr><td><code>dotnet build<\/code><\/td><td><code>DotNetCoreCLI@2<\/code><\/td><\/tr><tr><td><code>dotnet publish<\/code><\/td><td><code>DotNetCoreCLI@2<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Il n\u2019existe pas de type de t\u00e2che int\u00e9gr\u00e9 pour ex\u00e9cuter&nbsp;<code>node-sass<\/code>&nbsp;ou pour imprimer la date dans un fichier. Pour ces cas, Mara utilise la t\u00e2che&nbsp;<strong><code>CmdLine@2<\/code><\/strong>, qui lui permet d\u2019ex\u00e9cuter n\u2019importe quelle commande. Plus couramment, on utilise la t\u00e2che&nbsp;<strong><code>script<\/code><\/strong>, qui est un raccourci pour&nbsp;<code>CmdLine@2<\/code>.<\/p>\n\n\n\n<p>Pour en savoir plus sur les autres raccourcis de t\u00e2ches courants, consultez la documentation de r\u00e9f\u00e9rence sur le sch\u00e9ma YAML pour Azure Pipelines \u2013 section&nbsp;<strong>steps<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"forminator-guttenberg\"><form\r\n\t\t\t\tid=\"forminator-module-7276\"\r\n\t\t\t\tclass=\"forminator-ui forminator-quiz forminator-quiz-7276 forminator-quiz--list forminator-design--default  \"\r\n\t\t\t\tmethod=\"post\"\r\n\t\t\t\tdata-forminator-render=\"0\"\r\n\t\t\t\tdata-form-id=\"7276\"\r\n\t\t\t\t data-color-option=\"default\" data-design=\"default\" data-quiz=\"knowledge\" aria-live=\"polite\" data-spacing=\"default\" data-alignment=\"left\" style=\"display: none;\"\r\n\t\t\t\tdata-uid=\"6a04e1b62f560\"\r\n\t\t\t><div role=\"alert\" aria-live=\"polite\" class=\"forminator-response-message forminator-error forminator-hidden\"><\/div>\r\n\t\t\t\t\t<h3 class=\"forminator-quiz--title\">V\u00e9rifiez vos connaissances<\/h3>\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t<div\r\n\t\t\ttabindex=\"0\"\r\n\t\t\trole=\"checkbox\"\r\n\t\t\tid=\"question-1344-1577\"\r\n\t\t\tclass=\"forminator-question forminator-last\"\r\n\t\t\tdata-multichoice=\"false\"\r\n\t\t\taria-labelledby=\"question-1344-1577-label\"\r\n\t\t\taria-describedby=\"question-1344-1577-description\"\r\n\t\t\taria-required=\"true\"\r\n\t\t>\r\n\r\n\t\t\t<span id=\"question-1344-1577-label\" class=\"forminator-legend\">1. Une t\u00e2che de build :<\/span>\r\n\t\t\t\r\n\t\t\t\t\t<label for=\"question-1344-1577-0-6a04e1b62fcc4\" class=\"forminator-answer forminator-only--text\">\r\n\r\n\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\t\t\t\tname=\"answers[question-1344-1577-0]\"\r\n\t\t\t\t\t\t\tvalue=\"0\"\r\n\t\t\t\t\t\t\tid=\"question-1344-1577-0-6a04e1b62fcc4\"\r\n\t\t\t\t\t\t\tclass=\"\"\r\n\t\t\t\t\t\t\/>\r\n\r\n\t\t\t\t\t\t<span class=\"forminator-answer--design\" for=\"question-1344-1577-0-6a04e1b62fcc4\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<span class=\"forminator-answer--status\" aria-hidden=\"true\"><\/span>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"forminator-answer--name\">A. D\u00e9finit comment une \u00e9tape de test, de build ou de d\u00e9ploiement est ex\u00e9cut\u00e9e.<\/span>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<\/span>\r\n\t\t\t\t\t<\/label>\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t<label for=\"question-1344-1577-1-6a04e1b62fcc4\" class=\"forminator-answer forminator-only--text\">\r\n\r\n\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\t\t\t\tname=\"answers[question-1344-1577-1]\"\r\n\t\t\t\t\t\t\tvalue=\"1\"\r\n\t\t\t\t\t\t\tid=\"question-1344-1577-1-6a04e1b62fcc4\"\r\n\t\t\t\t\t\t\tclass=\"\"\r\n\t\t\t\t\t\t\/>\r\n\r\n\t\t\t\t\t\t<span class=\"forminator-answer--design\" for=\"question-1344-1577-1-6a04e1b62fcc4\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<span class=\"forminator-answer--status\" aria-hidden=\"true\"><\/span>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"forminator-answer--name\">B. Est identique \u00e0 l\u2019utilitaire make<\/span>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<\/span>\r\n\t\t\t\t\t<\/label>\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t<label for=\"question-1344-1577-2-6a04e1b62fcc4\" class=\"forminator-answer forminator-only--text\">\r\n\r\n\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\t\t\t\tname=\"answers[question-1344-1577-2]\"\r\n\t\t\t\t\t\t\tvalue=\"2\"\r\n\t\t\t\t\t\t\tid=\"question-1344-1577-2-6a04e1b62fcc4\"\r\n\t\t\t\t\t\t\tclass=\"\"\r\n\t\t\t\t\t\t\/>\r\n\r\n\t\t\t\t\t\t<span class=\"forminator-answer--design\" for=\"question-1344-1577-2-6a04e1b62fcc4\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<span class=\"forminator-answer--status\" aria-hidden=\"true\"><\/span>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"forminator-answer--name\">C. Est ex\u00e9cut\u00e9e sur l\u2019agent de build une fois le build termin\u00e9 pour nettoyer le syst\u00e8me.<\/span>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<\/span>\r\n\t\t\t\t\t<\/label>\r\n\r\n\t\t\t\t\t\r\n\t\t\t<span id=\"question-1344-1577-description\" class=\"forminator-question--result\"><\/span>\r\n\r\n\t\t<\/div>\r\n\t\t<input type=\"hidden\" name=\"referer_url\" value=\"\" \/><div class=\"forminator-quiz--result\"><button class=\"forminator-button forminator-button-submit \" data-loading=\"Calculating Result\" >Envoyer<\/button><\/div><input type=\"hidden\" id=\"forminator_nonce\" name=\"forminator_nonce\" value=\"352e14fb6d\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/fr\/wp-json\/wp\/v2\/docs\/7273\" \/><input type=\"hidden\" name=\"has_lead\" value=\"\"><input type=\"hidden\" name=\"form_id\" value=\"7276\"><input type=\"hidden\" name=\"page_id\" value=\"7273\"><input type=\"hidden\" name=\"current_url\" value=\"https:\/\/techhub.saworks.io\/fr\/docs\/tutoriel-github-intermediaire\/creer-des-applications-avec-azure-devops\/taches-de-compilation\/\"><input type=\"hidden\" name=\"action\" value=\"forminator_submit_form_quizzes\" \/><\/form><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mara a maintenant une copie du code du jeu spatial. Elle va le compiler en utilisant Microsoft Azure Pipelines au lieu du serveur [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":7024,"menu_order":35,"template":"","doc_tag":[],"doc_badge":[],"class_list":["post-7273","docs","type-docs","status-publish","hentry"],"author_avatar":"https:\/\/secure.gravatar.com\/avatar\/6a70e7c73db9f245e650948d09d74f61?s=96&d=mm&r=g","author_name":"Annick N'dri","_links":{"self":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7273"}],"collection":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7273\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7024"}],"wp:attachment":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/media?parent=7273"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_tag?post=7273"},{"taxonomy":"doc_badge","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_badge?post=7273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}