<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>madd0&#039;s tech blog</title>
	<atom:link href="https://blog.madd0.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.madd0.com</link>
	<description>My thoughts on tech and other hopefully–not–too–irrelevant stuff</description>
	<lastBuildDate>Thu, 30 Jan 2020 17:28:29 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>

<image>
	<url>https://madd0.files.wordpress.com/2020/02/cropped-site_icon.png?w=32</url>
	<title>madd0&#039;s tech blog</title>
	<link>https://blog.madd0.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<cloud domain='blog.madd0.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<atom:link rel="search" type="application/opensearchdescription+xml" href="https://blog.madd0.com/osd.xml" title="madd0&#039;s tech blog" />
	<atom:link rel='hub' href='https://blog.madd0.com/?pushpress=hub'/>
	<item>
		<title>7-Zip compression levels in Azure DevOps Archive Files task</title>
		<link>https://blog.madd0.com/2020/01/30/7-zip-compression-levels-in-azure-devops-archive-files-task/</link>
					<comments>https://blog.madd0.com/2020/01/30/7-zip-compression-levels-in-azure-devops-archive-files-task/#respond</comments>
		
		<dc:creator><![CDATA[Mauricio Díaz Orlich]]></dc:creator>
		<pubDate>Thu, 30 Jan 2020 17:28:29 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[7-Zip]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<category><![CDATA[Azure Pipelines]]></category>
		<guid isPermaLink="false">http://blog.madd0.com/?p=3467</guid>

					<description><![CDATA[In an attempt to make my artifacts smaller, I recently chose to use 7-Zip compression, or archiveType: 7z, in an Archive Files task of an Azure DevOps YAML pipeline. 7-Zip provides 5 compression levels: 1 (fastest), 3 (fast), 5 (normal), 7 (maximum) and 9 (ultra), as well as option 0, which doesn&#8217;t compress anything. I &#8230; <a href="https://blog.madd0.com/2020/01/30/7-zip-compression-levels-in-azure-devops-archive-files-task/" class="more-link">Lire la suite <span class="screen-reader-text">7-Zip compression levels in Azure DevOps Archive Files&#160;task</span></a>]]></description>
										<content:encoded><![CDATA[
<p>In an attempt to make my artifacts smaller, I recently chose to use 7-Zip compression, or <code>archiveType: 7z</code>, in an Archive Files task of an Azure DevOps YAML pipeline. <a href="https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#7Z">7-Zip provides 5 compression levels</a>: 1 (fastest), 3 (fast), 5 (normal), 7 (maximum) and 9 (ultra), as well as option 0, which doesn&rsquo;t compress anything.</p>



<p>I like YAML pipelines, because they live in my repo and I can use templates. However, the online editing experience is not particularly great. Sure, the online editor &laquo;&nbsp;assists&nbsp;&raquo; you when editing a simple file, but if you&rsquo;re referencing templates, you&rsquo;re out of luck (or at least I haven&rsquo;t found a way to edit a template and use the &laquo;&nbsp;assistant&nbsp;&raquo;.)</p>



<p>Long story short, I&rsquo;m editing a template (in a text editor) and I want to specify the compression level in my task.  The official <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/archive-files?view=azure-devops">Archive Files task documentation page</a> unfortunately doesn&rsquo;t document the property that defines this. Luckily, a dummy pipeline and the &laquo;&nbsp;assistant&nbsp;&raquo; allowed me to quickly figure out that I wanted to set the <code>sevenZipCompression</code> property of the task. Of course, since the property wasn&rsquo;t documented, neither were the values that it accepted. So with a little patience and using <a href="https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/ArchiveFilesV2/archivefiles.ts#L129">the task&rsquo;s source code</a> to confirm, I quickly came up with a table, which I decided to persist here for future reference:</p>



<figure class="wp-block-table"><table><thead><tr><th>Level</th><th>Descriptoin</th><th><code>sevenZipCompression</code> value</th><th>Default</th></tr></thead><tbody><tr><td>0</td><td>No compression</td><td>&lsquo;none&rsquo;</td><td></td></tr><tr><td>1</td><td>Fastest compressing</td><td>&lsquo;fastest&rsquo;</td><td></td></tr><tr><td>3</td><td>Fast compressing</td><td>&lsquo;fast&rsquo;</td><td></td></tr><tr><td>5</td><td>Normal compressing</td><td>&lsquo;normal&rsquo;</td><td>yes</td></tr><tr><td>7</td><td>Maximum compressing</td><td>&lsquo;maximum&rsquo;</td><td></td></tr><tr><td>9</td><td>Ultra compressing</td><td>&lsquo;ultra&rsquo;</td><td></td></tr></tbody></table><figcaption>7-zip compression levels for the Azure Pipelines Archive files task</figcaption></figure>



<p>A complete example of the task would look something like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [7]; title: ; notranslate">
- task: ArchiveFiles@2
  displayName: 'Compress Files'
  inputs:
    rootFolderOrFile: '$(Build.BinariesDirectory)'
    includeRootFolder: false
    archiveType: '7z'
    sevenZipCompression: 'maximum'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildNumber).zip'
    replaceExistingArchive: true
</pre></div>


<p></p>



<p>Illustration: <em><a href="https://www.flickr.com/photos/photogestion/4430632949">Emballages compressés</a></em> by <a href="https://www.flickr.com/photos/photogestion/"><a href="https://www.flickr.com/photos/photogestion/">Daniel Hennemand</a></a> is licensed under <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">CC BY-NC-ND 2.0</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.madd0.com/2020/01/30/7-zip-compression-levels-in-azure-devops-archive-files-task/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:thumbnail url="https://madd0.files.wordpress.com/2020/01/4430632949_4bafc28efd_o.jpg" />
		<media:content url="https://madd0.files.wordpress.com/2020/01/4430632949_4bafc28efd_o.jpg" medium="image">
			<media:title type="html">Emballages compresss</media:title>
		</media:content>

		<media:content url="https://0.gravatar.com/avatar/069e93fac34f462d978f2c675582135d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madd0</media:title>
		</media:content>
	</item>
	</channel>
</rss>
